diff --git a/pkgs/applications/audio/cdparanoia/default.nix b/pkgs/applications/audio/cdparanoia/default.nix index dd0dc8b78712675..d4d302f07d21a80 100644 --- a/pkgs/applications/audio/cdparanoia/default.nix +++ b/pkgs/applications/audio/cdparanoia/default.nix @@ -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; diff --git a/pkgs/applications/misc/xterm/default.nix b/pkgs/applications/misc/xterm/default.nix index ef4092bd8034556..d807e8eb9ed50ab 100644 --- a/pkgs/applications/misc/xterm/default.nix +++ b/pkgs/applications/misc/xterm/default.nix @@ -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"; diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 749d7449d71d313..84e10fb18bcac1d 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -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"; diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index 4ee3d3dcf738d13..afb3716f04ce1f1 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -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 '' diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index 5b724b2db78f53c..eb4aff92f692139 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -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"; }); diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 328cca37266249f..a615b62f6bba39c 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -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' '' diff --git a/pkgs/development/compilers/go/1.8.nix b/pkgs/development/compilers/go/1.8.nix index 0538d93c06bb4fb..93b4ffa0eb570a0 100644 --- a/pkgs/development/compilers/go/1.8.nix +++ b/pkgs/development/compilers/go/1.8.nix @@ -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" ]; diff --git a/pkgs/development/compilers/go/1.9.nix b/pkgs/development/compilers/go/1.9.nix index d2e3b6253fd8e50..a123a8c00cf9785 100644 --- a/pkgs/development/compilers/go/1.9.nix +++ b/pkgs/development/compilers/go/1.9.nix @@ -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" ]; diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix index 8b066147ac65075..7cbbda8b2dd69d0 100644 --- a/pkgs/development/compilers/llvm/4/clang/default.nix +++ b/pkgs/development/compilers/llvm/4/clang/default.nix @@ -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 ''; diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix index d133f2d929e72ae..9b55be842193612 100644 --- a/pkgs/development/compilers/llvm/4/default.nix +++ b/pkgs/development/compilers/llvm/4/default.nix @@ -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 diff --git a/pkgs/development/compilers/llvm/4/libc++/default.nix b/pkgs/development/compilers/llvm/4/libc++/default.nix index 2c6759cbbf0b9a2..107704a7a52da73 100644 --- a/pkgs/development/compilers/llvm/4/libc++/default.nix +++ b/pkgs/development/compilers/llvm/4/libc++/default.nix @@ -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 ]; @@ -27,10 +27,10 @@ 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; @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { "-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; diff --git a/pkgs/development/compilers/llvm/4/libc++abi.nix b/pkgs/development/compilers/llvm/4/libc++abi.nix index db32eebdd68d6da..d37d0a070b31d4c 100644 --- a/pkgs/development/compilers/llvm/4/libc++abi.nix +++ b/pkgs/development/compilers/llvm/4/libc++abi.nix @@ -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} ''; diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index f17d00100916df8..652e0d0104322ea 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -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} '' + '' @@ -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" ]; diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix index 7634a8475f3b008..c1b80448b370865 100644 --- a/pkgs/development/compilers/llvm/5/clang/default.nix +++ b/pkgs/development/compilers/llvm/5/clang/default.nix @@ -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 ''; diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index 820db76bd185162..30962061bb7e199 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -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 diff --git a/pkgs/development/compilers/llvm/5/libc++/default.nix b/pkgs/development/compilers/llvm/5/libc++/default.nix index 7beaac5814c0b54..58f366a02e9c01e 100644 --- a/pkgs/development/compilers/llvm/5/libc++/default.nix +++ b/pkgs/development/compilers/llvm/5/libc++/default.nix @@ -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 = '' @@ -19,10 +19,10 @@ 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; @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { "-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; diff --git a/pkgs/development/compilers/llvm/5/libc++abi.nix b/pkgs/development/compilers/llvm/5/libc++abi.nix index 12579403ec42afb..c0d183e0422bafb 100644 --- a/pkgs/development/compilers/llvm/5/libc++abi.nix +++ b/pkgs/development/compilers/llvm/5/libc++abi.nix @@ -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} ''; diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix index 9284f247cb1f7ab..bca199e15d7110f 100644 --- a/pkgs/development/compilers/llvm/5/llvm.nix +++ b/pkgs/development/compilers/llvm/5/llvm.nix @@ -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)" "" @@ -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" ]; diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix index c1b054c643af1d0..8ac5b3c6fb7a68f 100644 --- a/pkgs/development/libraries/attr/default.nix +++ b/pkgs/development/libraries/attr/default.nix @@ -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/; diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index 44d63e274fc46ce..d730bd82cb22331 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -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" ''; @@ -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; diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix index eac4542a70b6530..701209971074d0d 100644 --- a/pkgs/development/libraries/fftw/default.nix +++ b/pkgs/development/libraries/fftw/default.nix @@ -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"; diff --git a/pkgs/development/libraries/gamin/default.nix b/pkgs/development/libraries/gamin/default.nix index e50f3baade3a3ba..2dd32b6f110001f 100644 --- a/pkgs/development/libraries/gamin/default.nix +++ b/pkgs/development/libraries/gamin/default.nix @@ -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"; diff --git a/pkgs/development/libraries/icu/base.nix b/pkgs/development/libraries/icu/base.nix index 98df2bd088738d7..81e863f0eb03a37 100644 --- a/pkgs/development/libraries/icu/base.nix +++ b/pkgs/development/libraries/icu/base.nix @@ -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 '' ''" else null; # won't find locale_t on darwin diff --git a/pkgs/development/libraries/libdaemon/default.nix b/pkgs/development/libraries/libdaemon/default.nix index 7159a90d58d077d..59e576fd39231e8 100644 --- a/pkgs/development/libraries/libdaemon/default.nix +++ b/pkgs/development/libraries/libdaemon/default.nix @@ -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; }) diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix index c50e8b482d47657..1339be451c294e5 100644 --- a/pkgs/development/libraries/libffi/default.nix +++ b/pkgs/development/libraries/libffi/default.nix @@ -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"; diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix index 85069a666bc1c33..e6cb62330c4e73b 100644 --- a/pkgs/development/libraries/libgpg-error/default.nix +++ b/pkgs/development/libraries/libgpg-error/default.nix @@ -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 ''; diff --git a/pkgs/development/libraries/libidn/default.nix b/pkgs/development/libraries/libidn/default.nix index 39faac6abbe12e5..147d6bac2f993d8 100644 --- a/pkgs/development/libraries/libidn/default.nix +++ b/pkgs/development/libraries/libidn/default.nix @@ -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" ]; diff --git a/pkgs/development/libraries/libmemcached/default.nix b/pkgs/development/libraries/libmemcached/default.nix index b5d2015af1f2ce4..6d895290e2c23d2 100644 --- a/pkgs/development/libraries/libmemcached/default.nix +++ b/pkgs/development/libraries/libmemcached/default.nix @@ -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 ]; diff --git a/pkgs/development/libraries/libnsl/default.nix b/pkgs/development/libraries/libnsl/default.nix index 91baeef51b06355..9e8a46b2e6b3138 100644 --- a/pkgs/development/libraries/libnsl/default.nix +++ b/pkgs/development/libraries/libnsl/default.nix @@ -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+"; diff --git a/pkgs/development/libraries/libunistring/default.nix b/pkgs/development/libraries/libunistring/default.nix index 2ca9874638b8848..8d1f5115bdf01e6 100644 --- a/pkgs/development/libraries/libunistring/default.nix +++ b/pkgs/development/libraries/libunistring/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { "--with-libiconv-prefix=${libiconv}" ]; - doCheck = !stdenv.isMusl; + doCheck = !stdenv.hostPlatform.isMusl; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/libusb/default.nix b/pkgs/development/libraries/libusb/default.nix index 67c5eec22d2739c..4704a1e5c331f5b 100644 --- a/pkgs/development/libraries/libusb/default.nix +++ b/pkgs/development/libraries/libusb/default.nix @@ -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; diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index 5a2693239fb3271..3dd801df0b7fc0e 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -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 diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 4cd0857378f52ff..fa3336c4cea0008 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -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" ]; diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index e72efe4bb0cbdaa..af6a540b97c0fa2 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -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' diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix index 3e5a99562b6000c..67bb2d2ee8aef76 100644 --- a/pkgs/development/libraries/polkit/default.nix +++ b/pkgs/development/libraries/polkit/default.nix @@ -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"; diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index cd3c441f2e56f89..a9bd25ed28bc489 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -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 diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index ba9476b5e1a7ab7..65821be256eaaeb 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -115,10 +115,10 @@ stdenv.mkDerivation { "NUM_THREADS=64" "INTERFACE64=${if blas64 then "1" else "0"}" "NO_STATIC=1" - ] ++ stdenv.lib.optional stdenv.isMusl "NO_AFFINITY=1" + ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "NO_AFFINITY=1" ++ mapAttrsToList (var: val: var + "=" + val) config; - patches = stdenv.lib.optional (!stdenv.isGlibc) + patches = stdenv.lib.optional (!stdenv.hostPlatform.isGlibc) # https://github.com/xianyi/OpenBLAS/pull/1247 (fetchpatch { url = "https://github.com/xianyi/OpenBLAS/commit/88a35ff457f55e527e0e8a503a0dc61976c1846d.patch"; diff --git a/pkgs/development/libraries/stfl/default.nix b/pkgs/development/libraries/stfl/default.nix index dbc280bf4647d83..a664de1b453a8f2 100644 --- a/pkgs/development/libraries/stfl/default.nix +++ b/pkgs/development/libraries/stfl/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildPhase = '' sed -i s/gcc/cc/g Makefile sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h - '' + stdenv.lib.optionalString (!stdenv.isGlibc) '' + '' + stdenv.lib.optionalString (!stdenv.hostPlatform.isGlibc) '' sed -i 's/LDLIBS += -lncursesw/LDLIBS += -lncursesw -liconv/' Makefile '' + ( stdenv.lib.optionalString stdenv.isDarwin '' sed -i s/-soname/-install_name/ Makefile diff --git a/pkgs/development/libraries/tbb/default.nix b/pkgs/development/libraries/tbb/default.nix index 4a199e95325c41f..182fbb35d499ef9 100644 --- a/pkgs/development/libraries/tbb/default.nix +++ b/pkgs/development/libraries/tbb/default.nix @@ -16,7 +16,7 @@ with stdenv.lib; stdenv.mkDerivation rec { optional (stdver != null) "stdver=${stdver}" ); - patches = stdenv.lib.optional stdenv.isMusl ./glibc-struct-mallinfo.patch; + patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch; installPhase = '' mkdir -p $out/{lib,share/doc} diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix index b8e4bb4c489f58e..d34a6dca78329de 100644 --- a/pkgs/development/libraries/ti-rpc/default.nix +++ b/pkgs/development/libraries/ti-rpc/default.nix @@ -8,7 +8,7 @@ stdenv.mkDerivation rec { sha256 = "1xchbxy0xql7yl7z4n1icj8r7dmly46i22fvm00vdjq64zlmqg3j"; }; - patches = stdenv.lib.optional stdenv.isMusl + patches = stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch { url = "https://raw.githubusercontent.com/openembedded/openembedded-core/2be873301420ec6ca2c70d899b7c49a7e2b0954d/meta/recipes-extended/libtirpc/libtirpc/0001-replace-__bzero-with-memset-API.patch"; sha256 = "1jmbn0j2bnjp0j9z5vzz5xiwyv3kd28w5pixbqsy2lz6q8nii7cf"; diff --git a/pkgs/development/libraries/webkitgtk/2.4.nix b/pkgs/development/libraries/webkitgtk/2.4.nix index a19f35112a3032d..18d20bf9c780c16 100644 --- a/pkgs/development/libraries/webkitgtk/2.4.nix +++ b/pkgs/development/libraries/webkitgtk/2.4.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { ./quartz-webcore.patch ./libc++.patch ./plugin-none.patch - ] ++ optionals stdenv.isMusl [ + ] ++ optionals stdenv.hostPlatform.isMusl [ ./fix-execinfo.patch ]; diff --git a/pkgs/development/libraries/webrtc-audio-processing/default.nix b/pkgs/development/libraries/webrtc-audio-processing/default.nix index 839c017bf20c41c..b5a3aed91d900d9 100644 --- a/pkgs/development/libraries/webrtc-audio-processing/default.nix +++ b/pkgs/development/libraries/webrtc-audio-processing/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { # signal_processing/filter_ar_fast_q12_armv7.S:88: Error: selected processor does not support `sbfx r11,r6,#12,#16' in ARM mode patchPhase = stdenv.lib.optionalString stdenv.isArm '' substituteInPlace configure --replace 'armv7*|armv8*' 'disabled' - '' + stdenv.lib.optionalString stdenv.isMusl '' + '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' substituteInPlace webrtc/base/checks.cc --replace 'defined(__UCLIBC__)' 1 ''; diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix index 10e3d0895a7e63f..5e186a8f2f8d927 100644 --- a/pkgs/development/python-modules/cffi/default.nix +++ b/pkgs/development/python-modules/cffi/default.nix @@ -32,7 +32,7 @@ if isPyPy then null else buildPythonPackage rec { # The tests use -Werror but with python3.6 clang detects some unreachable code. NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-unused-command-line-argument" "-Wno-unreachable-code" ]; - doCheck = !stdenv.isMusl; # TODO: Investigate + doCheck = !stdenv.hostPlatform.isMusl; # TODO: Investigate checkPhase = '' py.test ''; diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix index 4395604b2b0e68b..224e0aba6ef72ef 100644 --- a/pkgs/development/tools/misc/lsof/default.nix +++ b/pkgs/development/tools/misc/lsof/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { patches = [ ./dfile.patch ]; - postPatch = stdenv.lib.optionalString stdenv.isMusl '' + postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1 ''; diff --git a/pkgs/development/tools/misc/patchelf/unstable.nix b/pkgs/development/tools/misc/patchelf/unstable.nix index 19af2660f8c9e19..de68a4066d7dd57 100644 --- a/pkgs/development/tools/misc/patchelf/unstable.nix +++ b/pkgs/development/tools/misc/patchelf/unstable.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { }; # Drop test that fails on musl (?) - postPatch = stdenv.lib.optionalString stdenv.isMusl '' + postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' substituteInPlace tests/Makefile.am \ --replace "set-rpath-library.sh" "" ''; diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 10cb1e3f9beb4f2..0f44cbfab1ed7fc 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -36,8 +36,8 @@ let ''; # use 'if c then x else null' to avoid rebuilding - # patches = stdenv.lib.optionals stdenv.isMusl [ - patches = if stdenv.isMusl then [ + # patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ + patches = if stdenv.hostPlatform.isMusl then [ ./0002-Provide-missing-secure_getenv-and-scandirat-function.patch ./0003-Added-missing-typedef-definitions-on-parser.patch ./0007-Do-not-build-install-vim-file-with-utils-package.patch diff --git a/pkgs/os-specific/linux/audit/default.nix b/pkgs/os-specific/linux/audit/default.nix index c9ea588eca16d6c..b3c1b97df3357eb 100644 --- a/pkgs/os-specific/linux/audit/default.nix +++ b/pkgs/os-specific/linux/audit/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - patches = stdenv.lib.optional stdenv.isMusl [ + patches = stdenv.lib.optional stdenv.hostPlatform.isMusl [ #./0001-auditctl-include-headers-to-make-build-work-with-mus.patch ./0002-auparse-remove-use-of-rawmemchr.patch ./0003-all-get-rid-of-strndupa.patch diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix index e4ce8f5cd53053d..a7fbcce317534d7 100644 --- a/pkgs/os-specific/linux/iputils/default.nix +++ b/pkgs/os-specific/linux/iputils/default.nix @@ -22,11 +22,11 @@ stdenv.mkDerivation rec { ''; # Disable idn usage w/musl: https://github.com/iputils/iputils/pull/111 - makeFlags = [ "USE_GNUTLS=no" ] ++ stdenv.lib.optional stdenv.isMusl "USE_IDN=no"; + makeFlags = [ "USE_GNUTLS=no" ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "USE_IDN=no"; buildInputs = [ libsysfs opensp openssl libcap docbook_sgml_dtd_31 SGMLSpm libgcrypt nettle - ] ++ stdenv.lib.optional (!stdenv.isMusl) libidn; + ] ++ stdenv.lib.optional (!stdenv.hostPlatform.isMusl) libidn; buildFlags = "man all ninfod"; diff --git a/pkgs/os-specific/linux/libnl/default.nix b/pkgs/os-specific/linux/libnl/default.nix index 49ce7653f6b0654..f66df8163ff17b7 100644 --- a/pkgs/os-specific/linux/libnl/default.nix +++ b/pkgs/os-specific/linux/libnl/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { outputs = [ "bin" "dev" "out" "man" ]; - patches = stdenv.lib.optional stdenv.isMusl + patches = stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch { url = "https://raw.githubusercontent.com/gentoo/musl/48d2a28710ae40877fd3e178ead1fb1bb0baa62c/dev-libs/libnl/files/libnl-3.3.0_rc1-musl.patch"; sha256 = "0dd7xxikib201i99k2if066hh7gwf2i4ffckrjplq6lr206jn00r"; diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix index b155dd0bcb89cdb..bd84e121a7d69fc 100644 --- a/pkgs/os-specific/linux/lvm2/default.nix +++ b/pkgs/os-specific/linux/lvm2/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation { enableParallelBuilding = true; #patches = [ ./purity.patch ]; - patches = stdenv.lib.optionals stdenv.isMusl [ + patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ (fetchpatch { name = "fix-stdio-usage.patch"; url = "https://git.alpinelinux.org/cgit/aports/plain/main/lvm2/fix-stdio-usage.patch?h=3.7-stable&id=31bd4a8c2dc00ae79a821f6fe0ad2f23e1534f50"; diff --git a/pkgs/os-specific/linux/numactl/default.nix b/pkgs/os-specific/linux/numactl/default.nix index a9706b21e4443c5..9928897ae4d4944 100644 --- a/pkgs/os-specific/linux/numactl/default.nix +++ b/pkgs/os-specific/linux/numactl/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { url = https://raw.githubusercontent.com/gentoo/gentoo/b64d15e731e3d6a7671f0ec6c34a20203cf2609d/sys-process/numactl/files/numactl-2.0.11-sysmacros.patch; sha256 = "05277kv3x12n2xlh3fgnmxclxfc384mkwb0v9pd91046khj6h843"; }) - ] ++ stdenv.lib.optional stdenv.isMusl (fetchpatch { + ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch { url = https://git.alpinelinux.org/cgit/aports/plain/testing/numactl/musl.patch?id=0592b128c71c3e70d493bc7a13caed0d7fae91dd; sha256 = "080b0sygmg7104qbbh1amh3b322yyiajwi2d3d0vayffgva0720v"; }); diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index a3dd6562b836af6..a392461ad9f382a 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { sha256 = "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"; }; - patches = stdenv.lib.optionals stdenv.isMusl [ + patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ (fetchpatch { url = "https://git.alpinelinux.org/cgit/aports/plain/main/linux-pam/fix-compat.patch?id=05a62bda8ec255d7049a2bd4cf0fdc4b32bdb2cc"; sha256 = "1h5yp5h2mqp1fcwiwwklyfpa69a3i03ya32pivs60fd7g5bqa7sf"; @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { preConfigure = '' configureFlags="$configureFlags --includedir=$out/include/security" - '' + stdenv.lib.optionalString stdenv.isMusl '' + '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' # export ac_cv_search_crypt=no # (taken from Alpine linux, apparently insecure but also doesn't build O:)) # disable insecure modules diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix index e79a43ca504bf3e..b23a529d708d3e2 100644 --- a/pkgs/os-specific/linux/shadow/default.nix +++ b/pkgs/os-specific/linux/shadow/default.nix @@ -9,7 +9,7 @@ let glibc = if hostPlatform != buildPlatform then glibcCross - else assert stdenv.isGlibc; stdenv.cc.libc; + else assert hostPlatform.isGlibc; stdenv.cc.libc; dots_in_usernames = fetchpatch { url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch; diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 2b0a0310ac22185..8cdf5a67ea64e4d 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -12,8 +12,8 @@ assert stdenv.isLinux; # XXX let getent-bin = - if stdenv.isGlibc then stdenv.cc.libc.bin - else if stdenv.isMusl then "${musl-getent}" + if stdenv.hostPlatform.isGlibc then stdenv.cc.libc.bin + else if stdenv.hostPlatform.isMusl then "${musl-getent}" else throw "unsupported abi for systemd"; getent = "${getent-bin}/bin/getent"; @@ -82,7 +82,7 @@ in stdenv.mkDerivation rec { "--with-sysvrcnd-path=" "--with-rc-local-script-path-stop=/etc/halt.local" ] - ++ stdenv.lib.optionals stdenv.isMusl [ + ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ "--disable-localed" "--disable-machined" "--disable-myhostname" @@ -104,7 +104,7 @@ in stdenv.mkDerivation rec { url = "https://github.com/systemd/systemd/commit/58a78ae77063eddfcd23ea272bd2e0ddc9ea3ff7.patch"; sha256 = "0g3pvqigs69mciw6lj3zg12dmxnhwxndwxdjg78af52xrp0djfg8"; }) - ] ++ stdenv.lib.optionals stdenv.isMusl (import ./musl-patches.nix { inherit fetchFromGitHub; inherit (stdenv) lib; }); + ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl (import ./musl-patches.nix { inherit fetchFromGitHub; inherit (stdenv) lib; }); preConfigure = '' diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index 4b7d3d400daf4e5..2f102b58f141955 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { }; patches = [ ./caps-fix.patch ] - ++ stdenv.lib.optional stdenv.isMusl (fetchpatch { + ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch { name = "padsp-fix.patch"; url = "https://git.alpinelinux.org/cgit/aports/plain/testing/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch?id=167be02bf4618a90328e2b234f6a63a5dc05f244"; sha256 = "0gf4w25zi123ghk0njapysvrlljkc3hyanacgiswfnnm1i8sab1q"; diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index fcb18e93d3c2b6b..b8ee85d65e748da 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -62,7 +62,7 @@ common = rec { # attributes common to both builds "-DPLUGIN_AUTH_GSSAPI_CLIENT=NO" ] ++ optional stdenv.isDarwin "-DCURSES_LIBRARY=${ncurses.out}/lib/libncurses.dylib" - ++ optional stdenv.isMusl "-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl + ++ optional stdenv.hostPlatform.isMusl "-DWITHOUT_TOKUDB=1" # mariadb docs say disable this for musl ; preConfigure = '' diff --git a/pkgs/servers/squid/4.nix b/pkgs/servers/squid/4.nix index 7bdd646d642d57b..f509db779a3cf96 100644 --- a/pkgs/servers/squid/4.nix +++ b/pkgs/servers/squid/4.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { "--enable-removal-policies=lru,heap" "--enable-delay-pools" "--enable-x-accelerator-vary" - ] ++ stdenv.lib.optional (stdenv.isLinux && !stdenv.isMusl) "--enable-linux-netfilter"; + ] ++ stdenv.lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isMusl) "--enable-linux-netfilter"; meta = with stdenv.lib; { description = "A caching proxy for the Web supporting HTTP, HTTPS, FTP, and more"; diff --git a/pkgs/servers/squid/default.nix b/pkgs/servers/squid/default.nix index 23c985ed3d6bcee..a6e4648ff17ff78 100644 --- a/pkgs/servers/squid/default.nix +++ b/pkgs/servers/squid/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { "--enable-removal-policies=lru,heap" "--enable-delay-pools" "--enable-x-accelerator-vary" - ] ++ stdenv.lib.optional (stdenv.isLinux && !stdenv.isMusl) "--enable-linux-netfilter"; + ] ++ stdenv.lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isMusl) "--enable-linux-netfilter"; meta = with stdenv.lib; { description = "A caching proxy for the Web supporting HTTP, HTTPS, FTP, and more"; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index bb66decd30bf9c9..c6466598195e154 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -493,7 +493,7 @@ in args.udev ]; patches = commonPatches; - prePatch = stdenv.lib.optionalString stdenv.isMusl '' + prePatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' export CFLAGS+=" -D__uid_t=uid_t -D__gid_t=gid_t" ''; configureFlags = [ diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix index c07f48c6ad520e6..3078dd2dcab3293 100644 --- a/pkgs/shells/fish/default.nix +++ b/pkgs/shells/fish/default.nix @@ -12,8 +12,9 @@ with stdenv.lib; let - getent = if stdenv.isMusl then "${musl-getent}/bin/getent" - else "${glibc.bin}/bin/getent"; + getent = if stdenv.hostPlatform.isMusl + then "${musl-getent}/bin/getent" + else "${glibc.bin}/bin/getent"; etcConfigAppendixText = '' ############### ↓ Nix hook for sourcing /etc/fish/config.fish ↓ ############### # # diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index e663a6ed0ca0b62..d5885193b9bc456 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -117,8 +117,7 @@ let # Utility flags to test the type of platform. inherit (hostPlatform) isDarwin isLinux isSunOS isHurd isCygwin isFreeBSD isOpenBSD - isi686 isx86_64 is64bit isArm isAarch64 isMips isBigEndian - isMusl isGlibc; + isi686 isx86_64 is64bit isArm isAarch64 isMips isBigEndian; # Whether we should run paxctl to pax-mark binaries. needsPax = isLinux; diff --git a/pkgs/tools/misc/screen/default.nix b/pkgs/tools/misc/screen/default.nix index 8fecd3fffceac5a..1753f52ab1b6c16 100644 --- a/pkgs/tools/misc/screen/default.nix +++ b/pkgs/tools/misc/screen/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { "--enable-colors256" ]; - patches = stdenv.lib.optional stdenv.isMusl + patches = stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch { url = https://gist.githubusercontent.com/yujinakayama/4608863/raw/76b9f89af5e5a2e97d9a0f36aac989fb56cf1447/gistfile1.diff; sha256 = "0f9bf83p8zdxaa1pr75jyf5g8xr3r8kv7cyzzbpraa1q4j15ss1p"; diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix index 28e234941458809..c5ecb5eb6dade21 100644 --- a/pkgs/tools/networking/inetutils/default.nix +++ b/pkgs/tools/networking/inetutils/default.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses /* for `talk' */ perl /* for `whois' */ help2man ]; configureFlags = [ "--with-ncurses-include-dir=${ncurses.dev}/include" ] - ++ stdenv.lib.optionals stdenv.isMusl [ # Musl doesn't define rcmd + ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ # Musl doesn't define rcmd "--disable-rcp" "--disable-rsh" "--disable-rlogin" @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { postInstall = '' # XXX: These programs are normally installed setuid but since it # fails, they end up being non-executable, hence this hack. - chmod +x $out/bin/{ping,ping6,${stdenv.lib.optionalString (!stdenv.isMusl) ''rcp,rlogin,rsh,''}traceroute} + chmod +x $out/bin/{ping,ping6,${stdenv.lib.optionalString (!stdenv.hostPlatform.isMusl) ''rcp,rlogin,rsh,''}traceroute} ''; meta = { diff --git a/pkgs/tools/networking/iperf/3.nix b/pkgs/tools/networking/iperf/3.nix index bf66803e827ce5e..b9e47ecd7f90445 100644 --- a/pkgs/tools/networking/iperf/3.nix +++ b/pkgs/tools/networking/iperf/3.nix @@ -10,11 +10,11 @@ stdenv.mkDerivation rec { buildInputs = [ openssl ]; - preConfigure = stdenv.lib.optionalString (stdenv.isMusl) '' + preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE" ''; - patches = stdenv.lib.optionals (stdenv.isMusl) [ + patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ (fetchpatch { url = "http://git.alpinelinux.org/cgit/aports/plain/main/iperf3/build-fixes.patch"; name = "fix-musl-build.patch"; diff --git a/pkgs/tools/networking/unbound/default.nix b/pkgs/tools/networking/unbound/default.nix index c96914fd2af8f06..cc2f994d0d54dd2 100644 --- a/pkgs/tools/networking/unbound/default.nix +++ b/pkgs/tools/networking/unbound/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { installFlags = [ "configfile=\${out}/etc/unbound/unbound.conf" ]; - preFixup = stdenv.lib.optionalString (stdenv.isLinux && !stdenv.isMusl) # XXX: revisit + preFixup = stdenv.lib.optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) # XXX: revisit # Build libunbound again, but only against nettle instead of openssl. # This avoids gnutls.out -> unbound.lib -> openssl.out. # There was some problem with this on Darwin; let's not complicate non-Linux. diff --git a/pkgs/tools/system/smartmontools/default.nix b/pkgs/tools/system/smartmontools/default.nix index a34208242f3b79c..e5b2d54e585d1c2 100644 --- a/pkgs/tools/system/smartmontools/default.nix +++ b/pkgs/tools/system/smartmontools/default.nix @@ -22,7 +22,7 @@ in stdenv.mkDerivation rec { patches = [ ./smartmontools.patch ] # https://www.smartmontools.org/changeset/4603 - ++ stdenv.lib.optional stdenv.isMusl (fetchpatch { + ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch { name = "musl-canonicalize_file_name.patch"; url = "https://www.smartmontools.org/changeset/4603?format=diff&new=4603"; sha256 = "06s9pcd95snjkrbfrsjby2lln3lnwjd21bgabmvr4p7fx19b75zp"; diff --git a/pkgs/tools/text/agrep/default.nix b/pkgs/tools/text/agrep/default.nix index c125cdb52fc6260..10d3a47cc85eb8c 100644 --- a/pkgs/tools/text/agrep/default.nix +++ b/pkgs/tools/text/agrep/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { }; # Related: https://github.com/Wikinaut/agrep/pull/11 - prePatch = stdenv.lib.optionalString (stdenv.isMusl || stdenv.isDarwin) '' + prePatch = stdenv.lib.optionalString (stdenv.hostPlatform.isMusl || stdenv.isDarwin) '' sed -i '1i#include ' checkfil.c newmgrep.c recursiv.c ''; installPhase = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 20358c07e959a17..73ce185acb5003b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8696,7 +8696,7 @@ with pkgs; libcCross = assert targetPlatform != buildPlatform; libcCrossChooser targetPlatform.libc; # Only supported on Linux, using glibc - glibcLocales = if stdenv.isGlibc then callPackage ../development/libraries/glibc/locales.nix { } else null; + glibcLocales = if hostPlatform.isGlibc then callPackage ../development/libraries/glibc/locales.nix { } else null; glibcInfo = callPackage ../development/libraries/glibc/info.nix { }; @@ -12853,7 +12853,7 @@ with pkgs; inherit (callPackages ../os-specific/linux/kernel-headers { }) linuxHeaders_4_4 linuxHeaders_4_15; - linuxHeaders = if stdenv.isMusl then linuxHeaders_4_15 else linuxHeaders_4_4; + linuxHeaders = if hostPlatform.isMusl then linuxHeaders_4_15 else linuxHeaders_4_4; kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { };