xcbuild: Get rid of developer.nix, move to wrapper

also:

- add custom outputs "specs" for xcbuild
- get rid of unneeded tools
- update xcbuild
- add more comments
- fixup xcbuild derivations

Affected xcbuild derivations include:

- adv_cmds
- network_cmds
- basic_cmds
This commit is contained in:
Matthew Bauer
2016-11-15 19:13:23 -06:00
parent 4685bd7853
commit fc1f6f55ea
7 changed files with 35 additions and 55 deletions
@@ -1,18 +0,0 @@
{ stdenv, platform, toolchain, xcbuild, writeText }:
stdenv.mkDerivation {
name = "Xcode.app";
buildInputs = [ xcbuild ];
buildCommand = ''
mkdir -p $out/Contents/Developer/Library/Xcode/Specifications/
cp ${xcbuild}/Library/Xcode/Specifications/* $out/Contents/Developer/Library/Xcode/Specifications/
mkdir -p $out/Contents/Developer/Platforms/
cd $out/Contents/Developer/Platforms/
ln -s ${platform}
mkdir -p $out/Contents/Developer/Toolchains/
cd $out/Contents/Developer/Toolchains/
ln -s ${toolchain}
'';
}
+9 -27
View File
@@ -12,33 +12,11 @@ let
ProjectName = "OSXPlatformSupport";
};
Tools = [
{
Identifier = "com.apple.build-tools.nmedit";
Type = "Tool";
Name = "Nmedit";
}
{
Identifier = "com.apple.compilers.resource-copier";
Type = "Tool";
Name = "Resource Copier";
}
{
Identifier = "com.apple.compilers.yacc";
Type = "Tool";
Name = "Yacc";
InputFileTypes = [ "sourcecode.yacc" ];
ExecDescription = "Yacc $(InputFile)";
}
{
Identifier = "com.apple.compilers.lex";
Type = "Tool";
Name = "Lex";
ExecDescription = "Lex $(InputFile)";
InputFileTypes = [ "sourcecode.lex" ];
}
];
# These files are all based off of Xcode spec fies found in
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Speciications/.
# Based off of the MacOSX Architectures.xcpsec file. All i386 stuff
# is removed because NixPkgs only supports darwin-x86_64.
Architectures = [
{
Identifier = "Standard";
@@ -81,6 +59,8 @@ let
}
];
# Based off of the MacOSX Package Types.xcpsec file. Only keep the
# bare minimum needed.
PackageTypes = [
{
Identifier = "com.apple.package-type.mach-o-executable";
@@ -123,6 +103,9 @@ let
}
];
# Based off of the MacOSX Product Types.xcpsec file. All
# bundles/wrapper are removed, because we prefer dynamic products in
# NixPkgs.
ProductTypes = [
{
Identifier = "com.apple.product-type.tool";
@@ -158,7 +141,6 @@ stdenv.mkDerivation {
mkdir -p $out/Developer/Library/Xcode/Specifications/
cd $out/Developer/Library/Xcode/Specifications/
plutil -convert xml1 -o Tools.xcspec ${writeText "Tools.xcspec" (builtins.toJSON Tools)}
plutil -convert xml1 -o Architectures.xcspec ${writeText "Architectures.xcspec" (builtins.toJSON Architectures)}
plutil -convert xml1 -o PackageTypes.xcspec ${writeText "PackageTypes.xcspec" (builtins.toJSON PackageTypes)}
plutil -convert xml1 -o ProductTypes.xcspec ${writeText "ProductTypes.xcspec" (builtins.toJSON ProductTypes)}
+1 -1
View File
@@ -5,7 +5,7 @@ xcbuildBuildPhase() {
echo "running xcodebuild"
xcodebuild OTHER_CFLAGS="$NIX_CFLAGS_COMPILE" OTHER_LDFLAGS="$NIX_LDFLAGS" build
xcodebuild OTHER_CFLAGS="$NIX_CFLAGS_COMPILE" OTHER_CPLUSPLUSFLAGS="$NIX_CFLAGS_COMPILE" OTHER_LDFLAGS="$NIX_LDFLAGS" build
runHook postBuild
}
+11 -6
View File
@@ -23,10 +23,6 @@ let
inherit sdk platformName xcbuild;
};
developer = callPackage ./developer.nix {
inherit platform toolchain xcbuild;
};
xcconfig = writeText "nix.xcconfig" ''
SDKROOT=${sdkName}
'';
@@ -50,13 +46,22 @@ stdenv.mkDerivation {
ln -s $file
done
mkdir -p $out/Library/Xcode/
ln -s ${xcbuild}/Library/Xcode/Specifications $out/Library/Xcode/Specifications
mkdir -p $out/Platforms/
ln -s ${platform} $out/Platforms/
mkdir -p $out/Toolchains/
ln -s ${toolchain} $out/Toolchains/
wrapProgram $out/bin/xcodebuild \
--add-flags "-xcconfig ${xcconfig}" \
--add-flags "DERIVED_DATA_DIR=." \
--set DEVELOPER_DIR "${developer}"
--set DEVELOPER_DIR "$out"
wrapProgram $out/bin/xcrun \
--add-flags "-sdk ${sdkName}" \
--set DEVELOPER_DIR "${developer}"
--set DEVELOPER_DIR "$out"
'';
passthru = {