Skip to content

Commit

Permalink
Drop stdenv.is{Glibc,Musl}, be clear about platform being checked
Browse files Browse the repository at this point in the history
  • Loading branch information
dtzWill committed Feb 6, 2018
1 parent 3ff3093 commit f3f5ce5
Show file tree
Hide file tree
Showing 68 changed files with 89 additions and 89 deletions.
2 changes: 1 addition & 1 deletion pkgs/applications/audio/cdparanoia/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
url = "https://trac.macports.org/export/70964/trunk/dports/audio/cdparanoia/files/patch-paranoia_paranoia.c.10.4.diff";
sha256 = "17l2qhn8sh4jy6ryy5si6ll6dndcm0r537rlmk4a6a8vkn852vad";
})
] ++ stdenv.lib.optional stdenv.isMusl ./utils.patch;
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./utils.patch;

buildInputs = stdenv.lib.optional stdenv.isAarch64 autoreconfHook;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/misc/xterm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stdenv.mkDerivation rec {

patches = [
./sixel-256.support.patch
] ++ stdenv.lib.optional stdenv.isMusl
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl
(fetchpatch {
name = "posix-ptys.patch";
url = "https://git.alpinelinux.org/cgit/aports/plain/community/xterm/posix-ptys.patch?id=3aa532e77875fa1db18c7fcb938b16647031bcc1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ in stdenv.mkDerivation {

patches = [ ./wireshark-lookup-dumpcap-in-path.patch ]
# https://code.wireshark.org/review/#/c/23728/
++ stdenv.lib.optional stdenv.isMusl (fetchpatch {
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
name = "fix-timeout.patch";
url = "https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commitdiff_plain;h=8b5b843fcbc3e03e0fc45f3caf8cf5fc477e8613;hp=94af9724d140fd132896b650d10c4d060788e4f0";
sha256 = "1g2dm7lwsnanwp68b9xr9swspx7hfj4v3z44sz3yrfmynygk8zlv";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ stdenv.mkDerivation {
+ (if stdenv.isDarwin then " NO_APPLE_COMMON_CRYPTO=1" else " sysconfdir=/etc/ ")
# XXX: USE_PCRE2 might be useful in general, look into it
# XXX other alpine options?
+ (if stdenv.isMusl then "NO_SYS_POLL_H=1 NO_GETTEXT=YesPlease" else "");
+ (if stdenv.hostPlatform.isMusl then "NO_SYS_POLL_H=1 NO_GETTEXT=YesPlease" else "");

# build git-credential-osxkeychain if darwin
postBuild = stdenv.lib.optionalString stdenv.isDarwin ''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let version = "5.5.0";
# This could be applied unconditionally but I don't want to cause a full
# Linux rebuild.
++ optional stdenv.cc.isClang ./libcxx38-and-above.patch
++ optional stdenv.isMusl (fetchpatch {
++ optional stdenv.hostPlatform.isMusl (fetchpatch {
url = "https://raw.githubusercontent.com/richfelker/musl-cross-make/master/patches/gcc-5.3.0/0001-musl.diff";
sha256 = "0pppbf8myi2kjhm3z3479ihn1cm60kycfv60gj8yy1bs0pl1qcfm";
});
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/gcc/7/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ stdenv.mkDerivation ({
-e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
done
''
+ stdenv.lib.optionalString stdenv.isMusl
+ stdenv.lib.optionalString stdenv.hostPlatform.isMusl
''
sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
''
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/go/1.8.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ perl which pkgconfig patch makeWrapper ]
++ optionals stdenv.isLinux [ procps ];
buildInputs = [ cacert pcre ]
++ optionals stdenv.isGlibc [ stdenv.glibc.out stdenv.glibc.static ];
++ optionals stdenv.hostPlatform.isGlibc [ stdenv.glibc.out stdenv.glibc.static ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];

hardeningDisable = [ "all" ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/go/1.9.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
++ optionals stdenv.isLinux [ procps ];
buildInputs = [ cacert pcre ]
++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
++ optionals stdenv.isGlibc [ stdenv.glibc.static ];
++ optionals stdenv.hostPlatform.isGlibc [ stdenv.glibc.static ];
propagatedBuildInputs = optionals stdenv.isDarwin [ Security Foundation ];

hardeningDisable = [ "all" ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/4/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ let
# Patch for standalone doc building
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
'' + stdenv.lib.optionalString stdenv.isMusl ''
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/Tools.cpp
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/4/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let
clang-tools-extra_src = fetch "clang-tools-extra" "1dhmp7ccfpr42bmvk3kp37ngjpf3a9m5d4kkpsn7d00hzi7fdl9m";

# Add man output without introducing extra dependencies.
buildManPages = stdenv.buildPlatform == stdenv.hostPlatform && !stdenv.isMusl;
buildManPages = stdenv.buildPlatform == stdenv.hostPlatform && !stdenv.hostPlatform.isMusl;
overrideManOutput = drv:
if (!buildManPages) then drv else
let drv-manpages = drv.override { enableManpages = true; }; in
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/compilers/llvm/4/libc++/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
./pthread_mach_thread_np.patch
# glibc 2.26 fix
./xlocale-glibc-2.26.patch
] ++ stdenv.lib.optionals stdenv.isMusl [
] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
./libcxx-0001-musl-hacks.patch
./max_align_t.patch
];
Expand All @@ -27,18 +27,18 @@ stdenv.mkDerivation rec {
preConfigure = ''
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
'' + lib.optionalString stdenv.isMusl ''
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.isMusl python;
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python;

buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;

cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
] ++ stdenv.lib.optional stdenv.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";

enableParallelBuilding = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/4/libc++abi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stdenv.mkDerivation {
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export TRIPLE=x86_64-apple-darwin
'' + stdenv.lib.optionalString stdenv.isMusl ''
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -d $(ls -d libcxx-*) -i ${./libc++/libcxx-0001-musl-hacks.patch}
patch -p1 -d $(ls -d libcxx-*) -i ${./libc++/max_align_t.patch}
'';
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/4/llvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ in stdenv.mkDerivation (rec {
)
'' + stdenv.lib.optionalString stdenv.isAarch64 ''
patch -p0 < ${../aarch64.patch}
'' + stdenv.lib.optionalString stdenv.isMusl ''
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -i ${../TLI-musl.patch}
patch -p1 -i ${./dynamiclibrary-musl.patch}
'' + ''
Expand Down Expand Up @@ -146,7 +146,7 @@ in stdenv.mkDerivation (rec {
"-DLLVM_TARGET_ARCH=${llvmArch}"
#"-DLLVM_TARGETS_TO_BUILD=${llvmArch}"
]
++ stdenv.lib.optionals stdenv.isMusl [
++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF"
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/5/clang/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let
# Patch for standalone doc building
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
'' + stdenv.lib.optionalString stdenv.isMusl ''
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let
clang-tools-extra_src = fetch "clang-tools-extra" "09fjii7w43kvxvsxxs6gig9vz95vnvx1779rqd36h8kksvws3bcs";

# Add man output without introducing extra dependencies.
buildManPages = stdenv.buildPlatform == stdenv.hostPlatform && !stdenv.isMusl;
buildManPages = stdenv.buildPlatform == stdenv.hostPlatform && !stdenv.hostPlatform.isMusl;
overrideManOutput = drv:
if (!buildManPages) then drv else
let drv-manpages = drv.override { enableManpages = true; }; in
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/compilers/llvm/5/libc++/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
unpackFile ${libcxxabi.src}
export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
'';
patches = stdenv.lib.optionals stdenv.isMusl [
patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [
./libcxx-0001-musl-hacks.patch
];
prePatch = ''
Expand All @@ -19,18 +19,18 @@ stdenv.mkDerivation rec {
preConfigure = ''
# Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
cmakeFlagsArray=($cmakeFlagsArray -DLIBCXX_CXX_ABI_INCLUDE_PATHS="$LIBCXXABI_INCLUDE_DIR")
'' + lib.optionalString stdenv.isMusl ''
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
patchShebangs utils/cat_files.py
'';
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.isMusl python;
nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python;

buildInputs = [ libcxxabi ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;

cmakeFlags = [
"-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
"-DLIBCXX_LIBCPPABI_VERSION=2"
"-DLIBCXX_CXX_ABI=libcxxabi"
] ++ stdenv.lib.optional stdenv.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";

enableParallelBuilding = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/llvm/5/libc++abi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stdenv.mkDerivation {
export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
export TRIPLE=x86_64-apple-darwin
'' + stdenv.lib.optionalString stdenv.isMusl ''
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -d $(ls -d libcxx-*) -i ${./libc++/libcxx-0001-musl-hacks.patch}
'';

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/compilers/llvm/5/llvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ in stdenv.mkDerivation (rec {
patch -p1 -i ${./compiler-rt-codesign.patch} -d projects/compiler-rt
'' + stdenv.lib.optionalString stdenv.isAarch64 ''
patch -p0 < ${../aarch64.patch}
'' + stdenv.lib.optionalString stdenv.isMusl ''
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
patch -p1 -i ${../TLI-musl.patch}
substituteInPlace unittests/Support/CMakeLists.txt \
--replace "add_subdirectory(DynamicLibrary)" ""
Expand Down Expand Up @@ -142,7 +142,7 @@ in stdenv.mkDerivation (rec {
"-DLLVM_TARGET_ARCH=${llvmArch}"
#"-DLLVM_TARGETS_TO_BUILD=${llvmArch}"
]
++ stdenv.lib.optionals stdenv.isMusl [
++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
"-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
"-DCOMPILER_RT_BUILD_XRAY=OFF"
];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/attr/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ stdenv.mkDerivation rec {

installTargets = "install install-lib install-dev";

patches = if stdenv.isMusl then [ ./fix-headers-musl.patch ] else null;
patches = if stdenv.hostPlatform.isMusl then [ ./fix-headers-musl.patch ] else null;

meta = {
homepage = http://savannah.nongnu.org/projects/attr/;
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/boehm-gc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "dev" "doc" ];
separateDebugInfo = stdenv.isLinux;

preConfigure = stdenv.lib.optionalString stdenv.isMusl ''
preConfigure = stdenv.lib.optionalString hostPlatform.isMusl ''
export NIX_CFLAGS_COMPILE+="-D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
'';

Expand All @@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
configureFlags =
[ "--enable-cplusplus" ]
++ lib.optional enableLargeConfig "--enable-large-config"
++ lib.optional stdenv.isMusl "--disable-static";
++ lib.optional hostPlatform.isMusl "--disable-static";

doCheck = true; # not cross;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/fftw/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
# all x86_64 have sse2
# however, not all float sizes fit
++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") ) "--enable-sse2"
++ optional (stdenv.cc.isGNU && !stdenv.isMusl) "--enable-openmp"
++ optional (stdenv.cc.isGNU && !stdenv.hostPlatform.isMusl) "--enable-openmp"
# doc generation causes Fortran wrapper generation which hard-codes gcc
++ optional (!withDoc) "--disable-doc";

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/gamin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ stdenv.mkDerivation (rec {
patches = [ ./deadlock.patch ]
++ map fetchurl (import ./debian-patches.nix)
++ stdenv.lib.optional stdenv.cc.isClang ./returnval.patch
++ stdenv.lib.optional stdenv.isMusl (fetchpatch {
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
name = "fix-pthread-mutex.patch";
url = "https://git.alpinelinux.org/cgit/aports/plain/main/gamin/fix-pthread-mutex.patch?h=3.4-stable&id=a1a836b089573752c1b0da7d144c0948b04e8ea8";
sha256 = "13igdbqsxb3sz0h417k6ifmq2n4siwqspj6slhc7fdl5wd1fxmdz";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/icu/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ stdenv.mkDerivation {
'';

# https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
postPatch = if stdenv.isGlibc || stdenv.isMusl
postPatch = if stdenv.hostPlatform.isGlibc || stdenv.hostPlatform.isMusl
then "substituteInPlace i18n/digitlst.cpp --replace '<xlocale.h>' '<locale.h>'"
else null; # won't find locale_t on darwin

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libdaemon/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ stdenv.mkDerivation (rec {
platforms = stdenv.lib.platforms.unix;
maintainers = [ ];
};
} // stdenv.lib.optionalAttrs stdenv.isMusl {
} // stdenv.lib.optionalAttrs stdenv.hostPlatform.isMusl {
# This patch should be applied unconditionally, but doing so will cause mass rebuild.
patches = ./fix-includes.patch;
})
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libffi/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
url = https://src.fedoraproject.org/rpms/libffi/raw/ccffc1700abfadb0969495a6e51b964117fc03f6/f/libffi-aarch64-rhbz1174037.patch;
sha256 = "1vpirrgny43hp0885rswgv3xski8hg7791vskpbg3wdjdpb20wbc";
})
++ stdenv.lib.optional stdenv.isMusl (fetchpatch {
++ stdenv.lib.optional hostPlatform.isMusl (fetchpatch {
name = "gnu-linux-define.patch";
url = "https://git.alpinelinux.org/cgit/aports/plain/main/libffi/gnu-linux-define.patch?id=bb024fd8ec6f27a76d88396c9f7c5c4b5800d580";
sha256 = "11pvy3xkhyvnjfyy293v51f1xjy3x0azrahv1nw9y9mw8bifa2j2";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libgpg-error/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ stdenv.mkDerivation rec {

postPatch = ''
sed '/BUILD_TIMESTAMP=/s/=.*/=1970-01-01T00:01+0000/' -i ./configure
'' + stdenv.lib.optionalString stdenv.isMusl ''
'' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
ln -s lock-obj-pub.x86_64-pc-linux-musl.h src/syscfg/lock-obj-pub.linux-musl.h
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libidn/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {

outputs = [ "bin" "dev" "out" "info" "devdoc" ];

doCheck = !stdenv.isDarwin && !stdenv.isMusl;
doCheck = !stdenv.isDarwin && !stdenv.hostPlatform.isMusl;

hardeningDisable = [ "format" ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libmemcached/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
url = "https://raw.githubusercontent.com/Homebrew/homebrew/bfd4a0a4626b61c2511fdf573bcbbc6bbe86340e/Library/Formula/libmemcached.rb";
sha256 = "1gjf3vd7hiyzxjvlg2zfc3y2j0lyr6nhbws4xb5dmin3csyp8qb8";
})
++ stdenv.lib.optional stdenv.isMusl ./musl-fixes.patch;
++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;

buildInputs = [ libevent ];
propagatedBuildInputs = [ cyrus_sasl ];
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libnsl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [ libtirpc ];

patches = stdenv.lib.optionals stdenv.isMusl [ ./cdefs.patch ./nis_h.patch ];
patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ ./cdefs.patch ./nis_h.patch ];

meta = with stdenv.lib; {
description = "Client interface library for NIS(YP) and NIS+";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libunistring/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
"--with-libiconv-prefix=${libiconv}"
];

doCheck = !stdenv.isMusl;
doCheck = !stdenv.hostPlatform.isMusl;

enableParallelBuilding = true;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libusb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ stdenv.mkDerivation {
sha256 = "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0";
};

patches = stdenv.lib.optional stdenv.isMusl ./fix-headers.patch;
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;

meta = {
platforms = stdenv.lib.platforms.unix;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/libxml2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ in stdenv.mkDerivation rec {
enableParallelBuilding = true;

doCheck = (stdenv.hostPlatform == stdenv.buildPlatform) &&
!stdenv.isDarwin && !stdenv.isMusl;
!stdenv.isDarwin && !stdenv.hostPlatform.isMusl;

crossAttrs = lib.optionalAttrs (hostPlatform.libc == "msvcrt") {
# creating the DLL is broken ATM
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/mesa/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ stdenv.mkDerivation {
patches = [
./glx_ro_text_segm.patch # fix for grsecurity/PaX
./symlink-drivers.patch
] ++ stdenv.lib.optional stdenv.isMusl ./musl-fixes.patch;
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;

outputs = [ "out" "dev" "drivers" "osmesa" ];

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/openssl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let
++ optional (versionOlder version "1.0.2" && hostPlatform.isDarwin)
./darwin-arch.patch;

postPatch = if (versionAtLeast version "1.1.0" && stdenv.isMusl) then ''
postPatch = if (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isMusl) then ''
substituteInPlace crypto/async/arch/async_posix.h \
--replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
'!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/polkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
]
# Could be applied uncondtionally but don't want to trigger rebuild
# https://bugs.freedesktop.org/show_bug.cgi?id=50145
++ stdenv.lib.optional stdenv.isMusl (fetchpatch {
++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
name = "netgroup-optional.patch";
url = "https://bugs.freedesktop.org/attachment.cgi?id=118753";
sha256 = "1zq51dhmqi9zi86bj9dq4i4pxlxm41k3k4a091j07bd78cjba038";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/qt-4.x/4.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ stdenv.mkDerivation rec {
url = "https://src.fedoraproject.org/rpms/qt/raw/ecf530486e0fb7fe31bad26805cde61115562b2b/f/qt-aarch64.patch";
sha256 = "1fbjh78nmafqmj7yk67qwjbhl3f6ylkp6x33b1dqxfw9gld8b3gl";
})
++ stdenv.lib.optionals stdenv.isMusl [
++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
./qt-musl.patch
./qt-musl-iconv-no-bom.patch
./patch-qthread-stacksize.diff
Expand Down
Loading

0 comments on commit f3f5ce5

Please sign in to comment.