diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2016-11-12 15:51:25 -0600 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2016-11-15 19:13:23 -0600 |
commit | fc1f6f55ea6c7eb1f98027db532683755fb7d4b9 (patch) | |
tree | 43ffe21f8ccd9b8e6cb1c4bb761b2ab2a427a1c3 /pkgs/development/tools/xcbuild | |
parent | 4685bd7853c40ec970eaf722fcae993c10bb1b5d (diff) | |
download | nixlib-fc1f6f55ea6c7eb1f98027db532683755fb7d4b9.tar nixlib-fc1f6f55ea6c7eb1f98027db532683755fb7d4b9.tar.gz nixlib-fc1f6f55ea6c7eb1f98027db532683755fb7d4b9.tar.bz2 nixlib-fc1f6f55ea6c7eb1f98027db532683755fb7d4b9.tar.lz nixlib-fc1f6f55ea6c7eb1f98027db532683755fb7d4b9.tar.xz nixlib-fc1f6f55ea6c7eb1f98027db532683755fb7d4b9.tar.zst nixlib-fc1f6f55ea6c7eb1f98027db532683755fb7d4b9.zip |
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
Diffstat (limited to 'pkgs/development/tools/xcbuild')
-rw-r--r-- | pkgs/development/tools/xcbuild/developer.nix | 18 | ||||
-rw-r--r-- | pkgs/development/tools/xcbuild/platform.nix | 36 | ||||
-rw-r--r-- | pkgs/development/tools/xcbuild/setup-hook.sh | 2 | ||||
-rw-r--r-- | pkgs/development/tools/xcbuild/wrapper.nix | 17 |
4 files changed, 21 insertions, 52 deletions
diff --git a/pkgs/development/tools/xcbuild/developer.nix b/pkgs/development/tools/xcbuild/developer.nix deleted file mode 100644 index 826571238de4..000000000000 --- a/pkgs/development/tools/xcbuild/developer.nix +++ /dev/null @@ -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} - ''; -} diff --git a/pkgs/development/tools/xcbuild/platform.nix b/pkgs/development/tools/xcbuild/platform.nix index c54f7f83e0ee..0b03d4120e85 100644 --- a/pkgs/development/tools/xcbuild/platform.nix +++ b/pkgs/development/tools/xcbuild/platform.nix @@ -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)} diff --git a/pkgs/development/tools/xcbuild/setup-hook.sh b/pkgs/development/tools/xcbuild/setup-hook.sh index b0ae8dd6e8e2..c3b26a6ac796 100644 --- a/pkgs/development/tools/xcbuild/setup-hook.sh +++ b/pkgs/development/tools/xcbuild/setup-hook.sh @@ -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 } diff --git a/pkgs/development/tools/xcbuild/wrapper.nix b/pkgs/development/tools/xcbuild/wrapper.nix index 2b01bdbb52b2..fc03c273fc58 100644 --- a/pkgs/development/tools/xcbuild/wrapper.nix +++ b/pkgs/development/tools/xcbuild/wrapper.nix @@ -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 = { |