Merge pull request #100388 from thefloweringash/darwin-dylib-names-hook

treewide: move fixDarwinDylibNames to nativeBuildInputs
This commit is contained in:
Daiderd Jordan 2020-10-21 19:25:48 +02:00 committed by GitHub
commit bb0b872b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 91 additions and 76 deletions

View File

@ -24,10 +24,10 @@ stdenv.mkDerivation rec {
buildInputs =
[ bzip2 freetype ghostscript graphviz libjpeg libpng libtiff libX11 libxml2
zlib libtool libwebp
]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
];
nativeBuildInputs = [ xz ];
nativeBuildInputs = [ xz ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
postInstall = ''
sed -i 's/-ltiff.*'\'/\'/ $out/bin/*

View File

@ -1,6 +1,6 @@
{ lib, mkDerivation, fetchFromGitHub, fetchpatch
, python, ruby, qtbase, qtmultimedia, qttools, qtxmlpatterns
, which, perl, makeWrapper, fixDarwinDylibNames
, which, perl, makeWrapper
}:
mkDerivation rec {

View File

@ -22,7 +22,8 @@ stdenv.mkDerivation rec {
sha256 = "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx";
};
buildInputs = [ python fixDarwinDylibNames ]
nativeBuildInputs = optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ python ]
++ optional javaBindings jdk
++ optionals ocamlBindings [ ocaml findlib zarith ]
;

View File

@ -17,7 +17,8 @@ in mkDerivation {
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [ fixDarwinDylibNames autoPatchelfHook ];
nativeBuildInputs = [ autoPatchelfHook ]
++ lib.optional hostPlatform.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [ curl tzdata ] ++ lib.optional hostPlatform.isLinux glibc;
installPhase = ''

View File

@ -17,7 +17,8 @@ in mkDerivation {
dontConfigure = true;
dontBuild = true;
nativeBuildInputs = [ fixDarwinDylibNames autoPatchelfHook ];
nativeBuildInputs = [ autoPatchelfHook ]
++ lib.optional hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ libxml2 stdenv.cc.cc ];

View File

@ -19,10 +19,10 @@ let
'';
nativeBuildInputs = [ cmake python3 lld ]
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++14"

View File

@ -21,9 +21,10 @@ stdenv.mkDerivation {
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3;
++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ];
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"

View File

@ -20,10 +20,10 @@ let
'';
nativeBuildInputs = [ cmake python3 lld ]
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++14"

View File

@ -19,10 +19,10 @@ let
'';
nativeBuildInputs = [ cmake python3 ]
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"

View File

@ -25,9 +25,11 @@ stdenv.mkDerivation {
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3;
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ];
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"

View File

@ -19,10 +19,10 @@ let
'';
nativeBuildInputs = [ cmake python3 ]
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"

View File

@ -25,9 +25,11 @@ stdenv.mkDerivation {
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3;
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ];
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"

View File

@ -20,10 +20,10 @@ let
'';
nativeBuildInputs = [ cmake python3 ]
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm lld ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm lld ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"

View File

@ -24,9 +24,12 @@ stdenv.mkDerivation {
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3;
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ] ;
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"

View File

@ -20,10 +20,10 @@ let
'';
nativeBuildInputs = [ cmake python3 ]
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm lld ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm lld ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"

View File

@ -25,9 +25,10 @@ stdenv.mkDerivation {
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3;
++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ];
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"

View File

@ -20,10 +20,10 @@ let
'';
nativeBuildInputs = [ cmake python3 ]
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm lld ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libxml2 llvm lld ];
cmakeFlags = [
"-DCMAKE_CXX_FLAGS=-std=c++11"

View File

@ -21,9 +21,10 @@ stdenv.mkDerivation {
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3;
++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libcxxabi ];
cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"

View File

@ -17,9 +17,8 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" ];
buildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection glib ];
nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection glib ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [
# Required by atk.pc

View File

@ -146,11 +146,11 @@ stdenv.mkDerivation {
enableParallelBuilding = true;
nativeBuildInputs = [ which ];
nativeBuildInputs = [ which ]
++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
depsBuildBuild = [ buildPackages.stdenv.cc ];
buildInputs = [ expat zlib bzip2 libiconv ]
++ optional (stdenv.hostPlatform == stdenv.buildPlatform) icu
++ optional stdenv.isDarwin fixDarwinDylibNames
++ optional enablePython python
++ optional enableNumpy python.pkgs.numpy;

View File

@ -18,7 +18,8 @@ stdenv.mkDerivation rec {
outputs = [ "bin" "dev" "out" "man" "devdoc" ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ autoreconfHook fixDarwinDylibNames pruneLibtoolFiles ];
nativeBuildInputs = [ autoreconfHook pruneLibtoolFiles ]
++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs =
[ openssl db gettext kerberos ]
++ lib.optional enableLdap openldap

View File

@ -60,9 +60,7 @@ stdenv.mkDerivation rec {
gobject-introspection
makeWrapper
glib
] ++ stdenv.lib.optional stdenv.isDarwin [
fixDarwinDylibNames
];
] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [
glib

View File

@ -18,10 +18,11 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ libGL ];
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [ cmake ]
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ libX11 libXrandr libXinerama libXcursor libXi libXext ]
++ lib.optionals stdenv.isDarwin [ Cocoa Kernel fixDarwinDylibNames ];
++ lib.optionals stdenv.isDarwin [ Cocoa Kernel ];
cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];

View File

@ -57,7 +57,7 @@ let
# FIXME: This fixes dylib references in the dylibs themselves, but
# not in the programs in $out/bin.
buildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
nativeBuildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
# remove dependency on bootstrap-tools in early stdenv build
postInstall = stdenv.lib.optionalString stdenv.isDarwin ''

View File

@ -14,8 +14,8 @@ in stdenv.mkDerivation rec {
};
propagatedBuildInputs = [ glib ];
nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection glib ];
buildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection glib ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
outputs = [ "out" "dev" ];

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
buildInputs = [ snappy ];
nativeBuildInputs = []
++ stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames ];
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildPhase = ''
make all

View File

@ -9,8 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "0xjfxb3ydvr2258ji3spzyf81g9caap19ql2pk91wiivqsc4mnws";
};
buildInputs = [ boost cmake gdal libgeotiff libtiff LASzip2 ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
nativeBuildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ boost cmake gdal libgeotiff libtiff LASzip2 ];
cmakeFlags = [
"-DGDAL_CONFIG=${gdal}/bin/gdal-config"

View File

@ -23,10 +23,13 @@ stdenv.mkDerivation rec {
++ stdenv.lib.optional sslSupport "openssl"
;
nativeBuildInputs = []
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
;
buildInputs = []
++ stdenv.lib.optional sslSupport openssl
++ stdenv.lib.optional stdenv.isCygwin findutils
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames
;
doCheck = false; # needs the net

View File

@ -19,10 +19,10 @@ in stdenv.mkDerivation rec {
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl ];
nativeBuildInputs = [ perl ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ zlib sqlite ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ zlib sqlite ];
propagatedBuildInputs = [ nspr ];

View File

@ -20,10 +20,9 @@ in stdenv.mkDerivation rec {
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl ninja (buildPackages.python3.withPackages (ps: with ps; [ gyp ])) ]
++ stdenv.lib.optional stdenv.isDarwin darwin.cctools;
++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ darwin.cctools fixDarwinDylibNames ];
buildInputs = [ zlib sqlite ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ zlib sqlite ];
propagatedBuildInputs = [ nspr ];

View File

@ -16,7 +16,7 @@ in stdenv.mkDerivation {
sha256 = "1g2wdchlwdihqj0ynx58nwyrpncxanghlnykgir97p0wimg3hnxl";
};
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames ];
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ oracle-instantclient ]
++ stdenv.lib.optionals stdenv.isLinux [ libaio ];

View File

@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
cmake
python
doxygen
];
] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
checkInputs = [
gtest
@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
openssl
boost
libpqxx
] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
];
# emulate the process of pulling catch down
postPatch = ''

View File

@ -18,9 +18,10 @@ stdenv.mkDerivation {
sha256 = "1c5axdngxaxj5vc6lr8sxb99mr5adsm1dnjckaxc23kq78pc8cn7";
};
nativeBuildInputs = [ cmake ];
nativeBuildInputs = [ cmake ]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [ boost llvmPackages.libclang ]
++ stdenv.lib.optional stdenv.isDarwin [ fixDarwinDylibNames Cocoa ];
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin Cocoa;
buildPhase = ''
export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped}

View File

@ -4,8 +4,8 @@ stdenv.mkDerivation rec {
pname = "sndio";
version = "1.7.0";
enableParallelBuilding = true;
buildInputs = stdenv.lib.optionals stdenv.isLinux [ alsaLib ]
++ stdenv.lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
nativeBuildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = stdenv.lib.optional stdenv.hostPlatform.isLinux alsaLib;
src = fetchurl {
url = "http://www.sndio.org/sndio-${version}.tar.gz";

View File

@ -34,12 +34,13 @@ common = rec { # attributes common to both builds
name = "mariadb-${version}.tar.gz";
};
nativeBuildInputs = [ cmake pkgconfig ];
nativeBuildInputs = [ cmake pkgconfig ]
++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
buildInputs = [
ncurses openssl zlib pcre libiconv curl
] ++ optionals stdenv.hostPlatform.isLinux [ libaio systemd libkrb5 ]
++ optionals stdenv.hostPlatform.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ]
++ optionals stdenv.hostPlatform.isDarwin [ perl cctools CoreServices ]
++ optional (!stdenv.hostPlatform.isDarwin && withStorageToku) [ jemalloc450 ]
++ optional (!stdenv.hostPlatform.isDarwin && !withStorageToku) [ jemalloc ];

View File

@ -1,5 +1,5 @@
# This file was generated by go2nix, then modified by hand for Darwin support.
{ stdenv, buildGoPackage, fetchFromGitHub, fixDarwinDylibNames, darwin }:
{ stdenv, buildGoPackage, fetchFromGitHub, darwin }:
buildGoPackage rec {
pname = "sudolikeaboss-unstable";
@ -17,9 +17,8 @@ buildGoPackage rec {
goDeps = ./deps.nix;
propagatedBuildInputs = with darwin.apple_sdk.frameworks; [
buildInputs = with darwin.apple_sdk.frameworks; [
Cocoa
fixDarwinDylibNames
];
meta = with stdenv.lib; {