xcbuild: move setup hook to xcbuildHook

Not every package that needs xcbuild will want to use its build phase.
I have moved the xcbuild setup hook to the new attribute xcbuildHook.
This means that dontUseXcbuild is no longer needed. If you just need
to call xcbuild on its own you can just refer to xcbuild.
This commit is contained in:
Matthew Bauer
2018-07-09 17:13:58 -04:00
parent 35b2c0edf2
commit 0534ceac81
19 changed files with 54 additions and 39 deletions
+3 -5
View File
@@ -19,11 +19,9 @@ xcbuildInstallPhase () {
runHook postInstall
}
if [ -z "$dontUseXcbuild" ]; then
buildPhase=xcbuildBuildPhase
if [ -z "$installPhase" ]; then
installPhase=xcbuildInstallPhase
fi
buildPhase=xcbuildBuildPhase
if [ -z "$installPhase" ]; then
installPhase=xcbuildInstallPhase
fi
# if [ -d "*.xcodeproj" ]; then
@@ -1,7 +1,8 @@
{ appleDerivation, xcbuild, IOKit }:
{ appleDerivation, xcbuildHook, IOKit }:
appleDerivation {
buildInputs = [ xcbuild IOKit ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ IOKit ];
xcbuildFlags = "-target caffeinate";
installPhase = ''
install -D Products/Deployment/caffeinate $out/bin/caffeinate
@@ -1,8 +1,9 @@
{ stdenv, appleDerivation, xcbuild, gnumake, Security
{ stdenv, appleDerivation, xcbuildHook, gnumake, Security
, libsecurity_utilities, libsecurity_cdsa_utilities }:
appleDerivation {
buildInputs = [ xcbuild libsecurity_utilities libsecurity_cdsa_utilities ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ libsecurity_utilities libsecurity_cdsa_utilities ];
DSTROOT = "$out";
@@ -2,7 +2,6 @@
appleDerivation {
# We can't just run the root build, because https://github.com/facebook/xcbuild/issues/264
dontUseXcbuild = true;
# pkill requires special private headers that are unavailable in
# NixPkgs. These ones are needed:
@@ -49,7 +48,8 @@ appleDerivation {
# ln -s $out/share/man/man1/pkill.1 $out/share/man/man1/pgrep.1
'';
buildInputs = [ xcbuild ncurses libutil-new ];
nativeBuildInputs = [ xcbuild ];
buildInputs = [ ncurses libutil-new ];
meta = {
platforms = stdenv.lib.platforms.darwin;
@@ -1,7 +1,7 @@
{ stdenv, appleDerivation, fetchurl, xcbuild }:
{ stdenv, appleDerivation, fetchurl, xcbuildHook }:
appleDerivation rec {
buildInputs = [ xcbuild ];
nativeBuildInputs = [ xcbuildHook ];
# These PBXcp calls should be patched in xcbuild to allow them to
# automatically be prefixed.
@@ -1,7 +1,7 @@
{ stdenv, fetchurl, appleDerivation, xcbuild }:
{ stdenv, fetchurl, appleDerivation, xcbuildHook }:
appleDerivation rec {
buildInputs = [ xcbuild ];
nativeBuildInputs = [ xcbuildHook ];
patchPhase = ''
substituteInPlace rpcgen/rpc_main.c \
@@ -1,7 +1,9 @@
{ stdenv, appleDerivation, xcbuild, lib, hostPlatform, Libc, xnu, libutil-new }:
{ stdenv, appleDerivation, xcbuildHook
, lib, hostPlatform, Libc, xnu, libutil-new }:
appleDerivation {
buildInputs = [ xcbuild libutil-new ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ libutil-new ];
NIX_CFLAGS_COMPILE = "-I.";
NIX_LDFLAGS = "-lutil";
@@ -1,7 +1,9 @@
{ appleDerivation, xcbuild, CoreSymbolication, xnu, bison, flex, darling, stdenv }:
{ appleDerivation, xcbuildHook, CoreSymbolication
, xnu, bison, flex, darling, stdenv }:
appleDerivation {
buildInputs = [ xcbuild CoreSymbolication xnu bison flex darling ];
nativeBuildInputs = [ xcbuildHook flex bison ];
buildInputs = [ CoreSymbolication darling ];
NIX_CFLAGS_COMPILE = "-DCTF_OLD_VERSIONS -DPRIVATE -DYYDEBUG=1 -I${xnu}/Library/Frameworks/System.framework/Headers";
NIX_LDFLAGS = "-L./Products/Release";
xcbuildFlags = "-target dtrace";
@@ -1,7 +1,8 @@
{ stdenv, appleDerivation, xcbuild, zlib, bzip2, lzma, ncurses, libutil-new }:
{ stdenv, appleDerivation, xcbuildHook, zlib, bzip2, lzma, ncurses, libutil-new }:
appleDerivation rec {
buildInputs = [ xcbuild zlib bzip2 lzma ncurses libutil-new ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ zlib bzip2 lzma ncurses libutil-new ];
# some commands not working:
# mtree: _simple.h not found
@@ -1,8 +1,8 @@
{ stdenv, appleDerivation, xcbuild }:
{ stdenv, appleDerivation, xcbuildHook }:
# TODO: make this the official libutil expression once we've integrated xcbuild in the bootstrap
appleDerivation {
buildInputs = [ xcbuild ];
nativeBuildInputs = [ xcbuildHook ];
prePatch = ''
substituteInPlace tzlink.c \
@@ -1,7 +1,9 @@
{ stdenv, appleDerivation, xcbuild, openssl, Librpcsvc, xnu, libpcap, developer_cmds }:
{ stdenv, appleDerivation, xcbuildHook
, openssl, Librpcsvc, xnu, libpcap, developer_cmds }:
appleDerivation rec {
buildInputs = [ xcbuild openssl xnu Librpcsvc libpcap developer_cmds ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ openssl xnu Librpcsvc libpcap developer_cmds ];
NIX_CFLAGS_COMPILE = " -I./unbound -I${xnu}/Library/Frameworks/System.framework/Headers/";
@@ -1,9 +1,10 @@
{ appleDerivation, xcbuild, Security
{ appleDerivation, xcbuildHook, Security
, libsecurity_codesigning, libsecurity_utilities, libsecurity_cdsa_utilities
, xnu, osx_private_sdk, pcsclite}:
appleDerivation {
buildInputs = [ xcbuild Security libsecurity_utilities
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ Security libsecurity_utilities
libsecurity_cdsa_utilities libsecurity_codesigning
pcsclite ];
@@ -1,7 +1,7 @@
{ stdenv, appleDerivation, xcbuild }:
{ stdenv, appleDerivation, xcbuildHook }:
appleDerivation rec {
buildInputs = [ xcbuild ];
nativeBuildInputs = [ xcbuildHook ];
patchPhase = ''
# NOTE: these hashes must be recalculated for each version change
@@ -1,7 +1,8 @@
{ stdenv, appleDerivation, fetchurl, xcbuild, ncurses, bzip2, zlib, lzma }:
{ stdenv, appleDerivation, fetchurl, xcbuildHook, ncurses, bzip2, zlib, lzma }:
appleDerivation {
buildInputs = [ xcbuild ncurses bzip2 zlib lzma ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ ncurses bzip2 zlib lzma ];
# patches to use ncursees
# disables md5
@@ -1,7 +1,8 @@
{xcbuild, appleDerivation, apple_sdk, ncurses, libutil-new, lib}:
{xcbuildHook, appleDerivation, apple_sdk, ncurses, libutil-new, lib}:
appleDerivation {
buildInputs = [ xcbuild apple_sdk.frameworks.IOKit ncurses libutil-new ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ apple_sdk.frameworks.IOKit ncurses libutil-new ];
NIX_LDFLAGS = "-lutil";
installPhase = ''
install -D Products/Release/libtop.a $out/lib/libtop.a
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, xcbuild }:
{ stdenv, fetchFromGitHub, xcbuildHook }:
stdenv.mkDerivation
{ name = "insert_dylib-2016.08.28";
@@ -8,7 +8,7 @@ stdenv.mkDerivation
rev = "c8beef66a08688c2feeee2c9b6eaf1061c2e67a9";
sha256 = "0az38y06pvvy9jf2wnzdwp9mp98lj6nr0ldv0cs1df5p9x2qvbya";
};
buildInputs = [ xcbuild ];
nativeBuildInputs = [ xcbuildHook ];
installPhase =
''
prog=$(find . -type f -name insert_dylib)
+3 -2
View File
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, xcbuild, Foundation, AddressBook }:
{ stdenv, fetchurl, xcbuildHook, Foundation, AddressBook }:
stdenv.mkDerivation rec {
version = "1.1a-3";
@@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "0wdqc1ndgrdhqapvvgx5xihc750szv08lp91x4l6n0gh59cpxpg3";
};
buildInputs = [ xcbuild Foundation AddressBook ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ Foundation AddressBook ];
installPhase = ''
mkdir -p $out/bin
+3 -2
View File
@@ -1,4 +1,4 @@
{ fetchurl, stdenv, fetchFromGitHub, xcbuild, libiconv, Cocoa, ncurses }:
{ fetchurl, stdenv, fetchFromGitHub, xcbuildHook, libiconv, Cocoa, ncurses }:
stdenv.mkDerivation rec {
name = "pinentry-mac-0.9.4";
@@ -10,7 +10,8 @@ stdenv.mkDerivation rec {
sha256 = "0g75302697gqcxyf2hyqzvcbd5pyss1bl2xvfd40wqav7dlyvj83";
};
buildInputs = [ xcbuild libiconv Cocoa ncurses ];
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ libiconv Cocoa ncurses ];
installPhase = ''
mkdir -p $out/Applications
+3
View File
@@ -8607,6 +8607,9 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) CoreServices CoreGraphics ImageIO;
stdenv = buildPackages.clangStdenv;
};
xcbuildHook = makeSetupHook {
deps = [ xcbuild ];
} ../development/tools/xcbuild/setup-hook.sh ;
xmlindent = callPackage ../development/web/xmlindent {};