From 4935422d5ec4801486af075dc5798f767c9f02c5 Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Thu, 13 Jun 2024 14:40:34 +0300 Subject: [PATCH] treewide: use lib.systems.equals when comparing elaborated systems --- pkgs/applications/audio/csound/default.nix | 2 +- pkgs/applications/audio/vcv-rack/default.nix | 2 +- pkgs/applications/editors/mg/default.nix | 2 +- pkgs/applications/editors/oed/default.nix | 2 +- pkgs/applications/editors/poke/default.nix | 2 +- pkgs/applications/editors/vim/default.nix | 2 +- pkgs/applications/editors/vim/full.nix | 2 +- pkgs/applications/editors/zile/default.nix | 2 +- .../graphics/sane/backends/default.nix | 2 +- pkgs/applications/misc/comodoro/default.nix | 4 +- pkgs/applications/misc/mangal/default.nix | 2 +- pkgs/applications/misc/visidata/default.nix | 2 +- .../networking/browsers/chromium/common.nix | 2 +- .../networking/browsers/elinks/default.nix | 2 +- .../networking/browsers/firefox/common.nix | 2 +- .../networking/browsers/w3m/default.nix | 4 +- .../networking/cluster/argo/default.nix | 2 +- .../networking/cluster/fluxcd/default.nix | 2 +- .../networking/cluster/kaniko/default.nix | 2 +- .../networking/cluster/kubeshark/default.nix | 2 +- .../networking/cluster/kubevela/default.nix | 2 +- .../networking/cluster/velero/default.nix | 2 +- .../element/keytar/default.nix | 2 +- .../instant-messengers/pidgin/default.nix | 2 +- .../instant-messengers/utox/default.nix | 2 +- .../networking/offrss/default.nix | 4 +- .../networking/sniffers/wireshark/default.nix | 4 +- pkgs/applications/office/kmymoney/default.nix | 2 +- .../misc/openmodelica/omcompiler/default.nix | 2 +- .../terminal-emulators/foot/default.nix | 2 +- .../version-management/fossil/default.nix | 2 +- .../version-management/git/default.nix | 10 +-- .../version-management/glab/default.nix | 2 +- .../version-management/mercurial/default.nix | 2 +- .../version-management/rcs/default.nix | 2 +- pkgs/applications/video/kodi/unwrapped.nix | 2 +- pkgs/applications/video/mplayer/default.nix | 2 +- pkgs/applications/video/omxplayer/default.nix | 2 +- .../virtualization/kvmtool/default.nix | 2 +- pkgs/build-support/go/module.nix | 2 +- pkgs/build-support/go/package.nix | 2 +- pkgs/build-support/lib/cmake.nix | 2 +- pkgs/build-support/lib/meson.nix | 2 +- .../rust/build-rust-crate/build-crate.nix | 2 +- .../rust/build-rust-crate/test/default.nix | 10 +-- .../rust/build-rust-package/default.nix | 2 +- pkgs/by-name/at/attic-client/package.nix | 2 +- pkgs/by-name/cm/cmake/package.nix | 2 +- pkgs/by-name/cz/czkawka/package.nix | 2 +- pkgs/by-name/ei/eiwd/package.nix | 2 +- pkgs/by-name/hi/himalaya/package.nix | 4 +- pkgs/by-name/ja/jasper/package.nix | 2 +- pkgs/by-name/ne/neverest/package.nix | 4 +- .../by-name/op/openai-triton-llvm/package.nix | 2 +- pkgs/by-name/re/redict/package.nix | 2 +- pkgs/by-name/ti/tilemaker/package.nix | 2 +- pkgs/by-name/uc/uclibc-ng/package.nix | 2 +- pkgs/by-name/va/valkey/package.nix | 2 +- pkgs/by-name/wl/wlogout/package.nix | 2 +- pkgs/data/misc/shared-mime-info/default.nix | 2 +- pkgs/data/misc/tzdata/default.nix | 2 +- .../gnome-2/platform/ORBit2/default.nix | 2 +- .../gnome-2/platform/libIDL/default.nix | 2 +- .../lomiri/development/geonames/default.nix | 2 +- .../androidndk-pkgs/androidndk-pkgs.nix | 2 +- .../compilers/chicken/5/chicken.nix | 2 +- pkgs/development/compilers/fbc/default.nix | 8 +-- pkgs/development/compilers/gcc/all.nix | 6 +- .../compilers/gcc/common/configure-flags.nix | 4 +- pkgs/development/compilers/gcc/default.nix | 2 +- .../compilers/ghc/8.10.7-binary.nix | 2 +- pkgs/development/compilers/ghc/8.10.7.nix | 8 +-- .../compilers/ghc/8.6.5-binary.nix | 2 +- .../compilers/ghc/9.2.4-binary.nix | 2 +- .../compilers/ghc/9.6.3-binary.nix | 2 +- .../compilers/ghc/common-hadrian.nix | 4 +- .../ghc/common-make-native-bignum.nix | 8 +-- pkgs/development/compilers/go/1.21.nix | 2 +- pkgs/development/compilers/go/1.22.nix | 2 +- .../compilers/llvm/common/bintools.nix | 2 +- .../compilers/llvm/common/clang/default.nix | 4 +- .../compilers/llvm/common/libclc.nix | 2 +- .../compilers/llvm/common/lld/default.nix | 4 +- .../compilers/llvm/common/llvm/default.nix | 8 +-- .../compilers/llvm/common/mlir/default.nix | 2 +- .../compilers/llvm/common/openmp/default.nix | 2 +- .../compilers/rust/cargo-auditable.nix | 2 +- pkgs/development/compilers/rust/cargo.nix | 2 +- pkgs/development/compilers/rust/default.nix | 4 +- pkgs/development/compilers/vala/default.nix | 4 +- .../haskell-modules/generic-builder.nix | 2 +- pkgs/development/interpreters/guile/1.8.nix | 4 +- pkgs/development/interpreters/guile/2.0.nix | 2 +- pkgs/development/interpreters/guile/2.2.nix | 2 +- pkgs/development/interpreters/guile/3.0.nix | 4 +- .../interpreters/lua-5/interpreter.nix | 2 +- .../interpreters/ngn-k/default.nix | 2 +- .../development/interpreters/perl/default.nix | 4 +- .../interpreters/perl/interpreter.nix | 4 +- .../python/cpython/2.7/default.nix | 10 +-- .../interpreters/python/cpython/default.nix | 10 +-- .../python/mk-python-derivation.nix | 2 +- .../python/python2/mk-python-derivation.nix | 2 +- .../development/interpreters/python/tests.nix | 2 +- .../development/interpreters/ruby/default.nix | 2 +- .../interpreters/s9fes/default.nix | 2 +- .../libraries/apr-util/default.nix | 2 +- pkgs/development/libraries/apr/default.nix | 2 +- pkgs/development/libraries/aubio/default.nix | 2 +- .../audio/vamp-plugin-sdk/default.nix | 2 +- .../libraries/aws-sdk-cpp/default.nix | 2 +- .../libraries/bencodetools/default.nix | 2 +- pkgs/development/libraries/boost/generic.nix | 6 +- .../libraries/boringssl/default.nix | 2 +- pkgs/development/libraries/check/default.nix | 2 +- .../libraries/clucene-core/2.x.nix | 2 +- .../libraries/cracklib/default.nix | 4 +- .../libraries/dbus-glib/default.nix | 2 +- pkgs/development/libraries/drogon/default.nix | 2 +- pkgs/development/libraries/ffmpeg/generic.nix | 10 +-- .../libraries/flatbuffers/default.nix | 2 +- pkgs/development/libraries/fltk/common.nix | 2 +- .../libraries/fontconfig/default.nix | 2 +- pkgs/development/libraries/gamin/default.nix | 2 +- .../libraries/gdk-pixbuf/default.nix | 2 +- pkgs/development/libraries/geoip/default.nix | 2 +- .../development/libraries/gettext/default.nix | 2 +- pkgs/development/libraries/glew/1.10.nix | 2 +- pkgs/development/libraries/glibc/common.nix | 6 +- pkgs/development/libraries/glibc/default.nix | 2 +- pkgs/development/libraries/gmime/2.nix | 4 +- pkgs/development/libraries/gmime/3.nix | 4 +- pkgs/development/libraries/gnutls/default.nix | 2 +- .../gobject-introspection/default.nix | 8 +-- .../libraries/graphene/default.nix | 2 +- pkgs/development/libraries/grpc/default.nix | 6 +- pkgs/development/libraries/gssdp/default.nix | 6 +- .../libraries/gstreamer/bad/default.nix | 2 +- .../libraries/gstreamer/base/default.nix | 4 +- .../libraries/gstreamer/core/default.nix | 2 +- .../libraries/gstreamer/devtools/default.nix | 2 +- .../libraries/gstreamer/ges/default.nix | 2 +- .../libraries/gstreamer/good/default.nix | 2 +- .../libraries/gstreamer/libav/default.nix | 2 +- .../libraries/gstreamer/rs/default.nix | 2 +- .../gstreamer/rtsp-server/default.nix | 2 +- .../libraries/gstreamer/ugly/default.nix | 2 +- .../libraries/gstreamer/vaapi/default.nix | 2 +- pkgs/development/libraries/gtk/2.x.nix | 2 +- pkgs/development/libraries/gtk/3.x.nix | 4 +- pkgs/development/libraries/gts/default.nix | 2 +- .../libraries/gupnp-igd/default.nix | 6 +- pkgs/development/libraries/gupnp/default.nix | 4 +- pkgs/development/libraries/hamlib/default.nix | 2 +- pkgs/development/libraries/hspell/default.nix | 2 +- pkgs/development/libraries/icu/make-icu.nix | 2 +- .../development/libraries/jsoncpp/default.nix | 2 +- pkgs/development/libraries/kerberos/krb5.nix | 2 +- pkgs/development/libraries/ldb/default.nix | 2 +- pkgs/development/libraries/ldns/default.nix | 2 +- pkgs/development/libraries/libaom/default.nix | 2 +- .../libraries/libasyncns/default.nix | 2 +- pkgs/development/libraries/libav/default.nix | 2 +- .../development/libraries/libavif/default.nix | 2 +- pkgs/development/libraries/libb64/default.nix | 2 +- .../development/libraries/libcbor/default.nix | 2 +- .../development/libraries/libcddb/default.nix | 2 +- .../libraries/libchamplain/default.nix | 6 +- .../libraries/libdaemon/default.nix | 2 +- pkgs/development/libraries/libelf/default.nix | 2 +- pkgs/development/libraries/libffi/3.3.nix | 2 +- pkgs/development/libraries/libffi/default.nix | 2 +- .../libraries/libgphoto2/default.nix | 2 +- .../development/libraries/libgrss/default.nix | 2 +- .../libraries/libgweather/default.nix | 2 +- .../development/libraries/libgxps/default.nix | 2 +- .../development/libraries/libical/default.nix | 4 +- .../libraries/libiconv/default.nix | 2 +- .../libraries/libinput/default.nix | 2 +- .../libraries/liblouis/default.nix | 2 +- .../development/libraries/libmbim/default.nix | 2 +- .../libraries/libmcrypt/default.nix | 2 +- pkgs/development/libraries/libndp/default.nix | 2 +- .../development/libraries/libnice/default.nix | 6 +- .../libraries/libomxil-bellagio/default.nix | 2 +- .../libraries/libosinfo/default.nix | 2 +- .../development/libraries/libpcap/default.nix | 2 +- pkgs/development/libraries/libpng/12.nix | 2 +- .../development/libraries/librest/default.nix | 4 +- .../development/libraries/librsvg/default.nix | 4 +- .../libraries/librsync/default.nix | 2 +- .../libraries/libvirt-glib/default.nix | 2 +- .../libraries/libvisual/default.nix | 2 +- pkgs/development/libraries/libvpx/1_8.nix | 2 +- pkgs/development/libraries/libvpx/default.nix | 2 +- .../libraries/libwacom/default.nix | 2 +- .../libraries/libwebsockets/default.nix | 2 +- .../libraries/libxklavier/default.nix | 2 +- .../development/libraries/libxml2/default.nix | 2 +- .../libraries/minizip-ng/default.nix | 2 +- .../development/libraries/msgpack/generic.nix | 2 +- .../development/libraries/ncurses/default.nix | 4 +- pkgs/development/libraries/newt/default.nix | 2 +- .../libraries/nlohmann_json/default.nix | 2 +- pkgs/development/libraries/nss/generic.nix | 4 +- .../libraries/openldap/default.nix | 2 +- .../development/libraries/openssl/default.nix | 2 +- pkgs/development/libraries/pcre/default.nix | 2 +- .../libraries/protobuf/generic-v3.nix | 2 +- .../libraries/protobuf/generic.nix | 2 +- .../libraries/qt-5/5.15/default.nix | 4 +- .../libraries/qt-5/modules/qtbase.nix | 14 ++-- .../libraries/qt-5/modules/qtwebchannel.nix | 2 +- .../libraries/qt-5/modules/qtwebengine.nix | 14 ++-- pkgs/development/libraries/qt-5/qtModule.nix | 4 +- .../development/libraries/quictls/default.nix | 2 +- .../science/math/openblas/default.nix | 6 +- .../science/math/p4est-sc/default.nix | 2 +- .../libraries/science/math/petsc/default.nix | 2 +- .../libraries/spice-gtk/default.nix | 2 +- .../startup-notification/default.nix | 2 +- pkgs/development/libraries/talloc/default.nix | 2 +- pkgs/development/libraries/tbb/2020_3.nix | 2 +- pkgs/development/libraries/tdb/default.nix | 2 +- pkgs/development/libraries/tevent/default.nix | 2 +- .../development/libraries/tinycdb/default.nix | 2 +- .../libraries/totem-pl-parser/default.nix | 2 +- .../libraries/tpm2-tss/default.nix | 2 +- .../libraries/uriparser/default.nix | 2 +- .../libraries/vulkan-loader/default.nix | 2 +- .../development/libraries/wayland/default.nix | 4 +- .../libraries/wayland/protocols.nix | 2 +- .../libraries/waylandpp/default.nix | 2 +- .../libraries/webkitgtk/default.nix | 2 +- .../libraries/webp-pixbuf-loader/default.nix | 2 +- pkgs/development/libraries/x264/default.nix | 2 +- pkgs/development/libraries/x265/default.nix | 2 +- pkgs/development/libraries/zlib/default.nix | 4 +- .../perl-modules/generic/default.nix | 2 +- .../python-modules/m2crypto/default.nix | 2 +- .../python-modules/psycopg2/default.nix | 2 +- pkgs/development/python-modules/pyqt/5.x.nix | 6 +- .../python-modules/pyqtwebengine/default.nix | 10 +-- .../python-modules/sigrok/default.nix | 2 +- .../python-modules/tpm2-pytss/default.nix | 2 +- .../s6-linux-init/default.nix | 2 +- .../skaware-packages/s6-rc/default.nix | 2 +- pkgs/development/tools/bpf-linker/default.nix | 2 +- .../tools/build-managers/jam/default.nix | 2 +- pkgs/development/tools/k6/default.nix | 2 +- .../tools/knightos/scas/default.nix | 2 +- .../tools/misc/autogen/default.nix | 4 +- .../tools/misc/babeltrace/default.nix | 2 +- .../tools/misc/binutils/2.38/default.nix | 2 +- .../tools/misc/binutils/default.nix | 2 +- .../tools/misc/elfutils/default.nix | 4 +- pkgs/development/tools/misc/gdb/default.nix | 4 +- .../tools/misc/intltool/default.nix | 2 +- .../tools/misc/luarocks/default.nix | 2 +- .../tools/misc/pkg-config/default.nix | 2 +- .../tools/misc/texi2html/default.nix | 2 +- .../development/tools/misc/texinfo/common.nix | 2 +- .../development/tools/misc/texlab/default.nix | 2 +- pkgs/development/tools/pandoc/default.nix | 2 +- .../tools/parsing/bison/default.nix | 2 +- .../development/tools/parsing/flex/2.5.35.nix | 2 +- .../tools/parsing/flex/default.nix | 6 +- pkgs/development/web/nodejs/nodejs.nix | 2 +- pkgs/games/nethack/default.nix | 2 +- pkgs/os-specific/bsd/freebsd/pkgs/install.nix | 4 +- .../bsd/freebsd/pkgs/libnetbsd/package.nix | 4 +- .../apple-source-releases/ICU/default.nix | 6 +- pkgs/os-specific/darwin/cctools/llvm.nix | 2 +- pkgs/os-specific/darwin/cctools/port.nix | 4 +- pkgs/os-specific/darwin/libtapi/default.nix | 4 +- pkgs/os-specific/linux/apparmor/default.nix | 4 +- pkgs/os-specific/linux/audit/default.nix | 2 +- pkgs/os-specific/linux/busybox/default.nix | 2 +- pkgs/os-specific/linux/cifs-utils/default.nix | 2 +- pkgs/os-specific/linux/criu/default.nix | 2 +- pkgs/os-specific/linux/exfat/default.nix | 2 +- pkgs/os-specific/linux/iproute/default.nix | 2 +- pkgs/os-specific/linux/iwd/default.nix | 6 +- .../linux/kernel/manual-config.nix | 2 +- pkgs/os-specific/linux/klibc/default.nix | 2 +- pkgs/os-specific/linux/kmod/default.nix | 2 +- pkgs/os-specific/linux/lvm2/common.nix | 2 +- pkgs/os-specific/linux/mdadm/default.nix | 2 +- pkgs/os-specific/linux/pam/default.nix | 2 +- pkgs/os-specific/linux/procps-ng/default.nix | 2 +- pkgs/os-specific/linux/psmisc/default.nix | 2 +- pkgs/os-specific/linux/rtl8723ds/default.nix | 2 +- pkgs/os-specific/linux/rtl8812au/default.nix | 2 +- pkgs/os-specific/linux/rtl8821au/default.nix | 2 +- pkgs/os-specific/linux/rtl8852au/default.nix | 2 +- pkgs/os-specific/linux/rtl8852bu/default.nix | 2 +- pkgs/os-specific/linux/shadow/default.nix | 4 +- pkgs/os-specific/linux/systemd/default.nix | 2 +- pkgs/os-specific/linux/udisks/2-default.nix | 4 +- pkgs/os-specific/linux/util-linux/default.nix | 2 +- pkgs/os-specific/linux/wireguard/default.nix | 2 +- pkgs/servers/clickhouse/default.nix | 2 +- pkgs/servers/dns/bind/default.nix | 2 +- pkgs/servers/http/nginx/generic.nix | 2 +- pkgs/servers/mail/dovecot/default.nix | 2 +- pkgs/servers/mail/mlmmj/default.nix | 2 +- pkgs/servers/mail/postfix/default.nix | 2 +- pkgs/servers/monitoring/zabbix/proxy.nix | 2 +- pkgs/servers/nosql/redis/default.nix | 2 +- pkgs/servers/pulseaudio/default.nix | 4 +- pkgs/servers/samba/4.x.nix | 6 +- pkgs/servers/sql/mariadb/default.nix | 2 +- pkgs/servers/sql/postgresql/generic.nix | 2 +- pkgs/servers/x11/xorg/overrides.nix | 6 +- pkgs/shells/bash/5.nix | 2 +- pkgs/shells/fish/default.nix | 2 +- pkgs/shells/oksh/default.nix | 2 +- pkgs/shells/zsh/default.nix | 2 +- pkgs/stdenv/generic/make-derivation.nix | 2 +- pkgs/test/cc-wrapper/default.nix | 2 +- pkgs/tools/admin/colmena/default.nix | 2 +- pkgs/tools/archivers/cabextract/default.nix | 2 +- pkgs/tools/archivers/p7zip/default.nix | 2 +- pkgs/tools/backup/bacula/default.nix | 2 +- pkgs/tools/backup/restic/default.nix | 2 +- pkgs/tools/cd-dvd/cdrkit/default.nix | 2 +- pkgs/tools/compression/zstd/default.nix | 4 +- pkgs/tools/filesystems/mtdutils/default.nix | 2 +- pkgs/tools/filesystems/squashfs/default.nix | 2 +- pkgs/tools/graphics/argyllcms/default.nix | 2 +- pkgs/tools/graphics/optipng/default.nix | 4 +- pkgs/tools/graphics/scanbd/default.nix | 2 +- pkgs/tools/misc/coreutils/default.nix | 2 +- pkgs/tools/misc/file/default.nix | 2 +- pkgs/tools/misc/findutils/default.nix | 2 +- pkgs/tools/misc/grub/default.nix | 2 +- pkgs/tools/misc/man-db/default.nix | 2 +- pkgs/tools/misc/toybox/default.nix | 2 +- .../networking/curl-impersonate/default.nix | 2 +- pkgs/tools/networking/curl/default.nix | 4 +- pkgs/tools/networking/hping/default.nix | 2 +- pkgs/tools/networking/inetutils/default.nix | 2 +- .../networking/networkmanager/default.nix | 4 +- pkgs/tools/networking/openconnect/common.nix | 2 +- pkgs/tools/networking/openssh/common.nix | 2 +- pkgs/tools/networking/rp-pppoe/default.nix | 2 +- pkgs/tools/networking/tcpdump/default.nix | 2 +- pkgs/tools/networking/zerotierone/default.nix | 2 +- .../package-management/apk-tools/default.nix | 2 +- pkgs/tools/package-management/lix/common.nix | 2 +- pkgs/tools/package-management/nix/common.nix | 4 +- pkgs/tools/security/hashcat/default.nix | 2 +- pkgs/tools/security/nmap/default.nix | 2 +- pkgs/tools/security/opensc/default.nix | 2 +- pkgs/tools/security/tor/default.nix | 2 +- pkgs/tools/system/collectd/default.nix | 2 +- pkgs/tools/system/freeipmi/default.nix | 2 +- pkgs/tools/system/monit/default.nix | 2 +- pkgs/tools/system/netdata/default.nix | 2 +- pkgs/tools/text/diffutils/default.nix | 2 +- pkgs/tools/text/gnupatch/default.nix | 2 +- pkgs/tools/text/gnused/default.nix | 2 +- pkgs/tools/text/groff/default.nix | 4 +- pkgs/tools/text/html-tidy/default.nix | 4 +- pkgs/tools/text/source-highlight/default.nix | 2 +- pkgs/tools/typesetting/asciidoc/default.nix | 2 +- pkgs/tools/typesetting/tex/texlive/bin.nix | 2 +- pkgs/top-level/all-packages.nix | 70 +++++++++---------- pkgs/top-level/darwin-packages.nix | 6 +- pkgs/top-level/perl-packages.nix | 14 ++-- pkgs/top-level/stage.nix | 4 +- 371 files changed, 544 insertions(+), 544 deletions(-) diff --git a/pkgs/applications/audio/csound/default.nix b/pkgs/applications/audio/csound/default.nix index ccaacf189faea..26bcd285b3551 100644 --- a/pkgs/applications/audio/csound/default.nix +++ b/pkgs/applications/audio/csound/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_CSOUND_AC=0" ] # fails to find Score.hpp ++ lib.optional stdenv.isDarwin "-DCS_FRAMEWORK_DEST=${placeholder "out"}/lib" # Ignore gettext in CMAKE_PREFIX_PATH on cross to prevent find_program picking up the wrong gettext - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DCMAKE_IGNORE_PATH=${lib.getBin gettext}/bin"; + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "-DCMAKE_IGNORE_PATH=${lib.getBin gettext}/bin"; nativeBuildInputs = [ cmake flex bison gettext ]; buildInputs = [ libsndfile libsamplerate boost ] diff --git a/pkgs/applications/audio/vcv-rack/default.nix b/pkgs/applications/audio/vcv-rack/default.nix index 7a1ded3e2f82a..4832b7f5f4bda 100644 --- a/pkgs/applications/audio/vcv-rack/default.nix +++ b/pkgs/applications/audio/vcv-rack/default.nix @@ -204,7 +204,7 @@ stdenv.mkDerivation rec { zstd ]; - makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + makeFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ] ++ [ "all" diff --git a/pkgs/applications/editors/mg/default.nix b/pkgs/applications/editors/mg/default.nix index c54cd01dbf281..93eac7a3c4048 100644 --- a/pkgs/applications/editors/mg/default.nix +++ b/pkgs/applications/editors/mg/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-88FrXN7h5uRLY8YMKSzUjBF4n18DEiiiDyoYr+7qXdQ="; }; - postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace configure --replace "./conftest" "echo" ''; diff --git a/pkgs/applications/editors/oed/default.nix b/pkgs/applications/editors/oed/default.nix index 189dfe345c0dd..fd5405895c16d 100644 --- a/pkgs/applications/editors/oed/default.nix +++ b/pkgs/applications/editors/oed/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { hash = "sha256-bbV89YhrmL7tOgKly5OfQDRz4QE0UzZrVsmoXiJ7ZZw="; }; - postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace configure --replace "./conftest" "echo" ''; diff --git a/pkgs/applications/editors/poke/default.nix b/pkgs/applications/editors/poke/default.nix index 604758d0df5ae..6b4a832dc02a7 100644 --- a/pkgs/applications/editors/poke/default.nix +++ b/pkgs/applications/editors/poke/default.nix @@ -15,7 +15,7 @@ }: let - isCross = stdenv.hostPlatform != stdenv.buildPlatform; + isCross = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in stdenv.mkDerivation (finalAttrs: { pname = "poke"; diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix index b9c5f4ff7bbcc..1a430bf7b08a4 100644 --- a/pkgs/applications/editors/vim/default.nix +++ b/pkgs/applications/editors/vim/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { configureFlags = [ "--enable-multibyte" "--enable-nls" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) ([ "vim_cv_toupper_broken=no" "--with-tlib=ncurses" "vim_cv_terminfo=yes" diff --git a/pkgs/applications/editors/vim/full.nix b/pkgs/applications/editors/vim/full.nix index 0f3652a8a7ded..8d207751b6439 100644 --- a/pkgs/applications/editors/vim/full.nix +++ b/pkgs/applications/editors/vim/full.nix @@ -93,7 +93,7 @@ in stdenv.mkDerivation { "--disable-nextaf_check" "--disable-carbon_check" "--disable-gtktest" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "vim_cv_toupper_broken=no" "--with-tlib=ncurses" "vim_cv_terminfo=yes" diff --git a/pkgs/applications/editors/zile/default.nix b/pkgs/applications/editors/zile/default.nix index bafb1aa303853..2f3feea56cc06 100644 --- a/pkgs/applications/editors/zile/default.nix +++ b/pkgs/applications/editors/zile/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { ] # `help2man' wants to run Zile, which won't work when the # newly-produced binary can't be run at build-time. - ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) help2man; + ++ lib.optional (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) help2man; # Tests can't be run because most of them rely on the ability to # fiddle with the terminal. diff --git a/pkgs/applications/graphics/sane/backends/default.nix b/pkgs/applications/graphics/sane/backends/default.nix index 3038d2be21232..e976d8555f043 100644 --- a/pkgs/applications/graphics/sane/backends/default.nix +++ b/pkgs/applications/graphics/sane/backends/default.nix @@ -83,7 +83,7 @@ stdenv.mkDerivation { # autoconf check for HAVE_MMAP is never set on cross compilation. # The pieusb backend fails compilation if HAVE_MMAP is not set. - buildFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "CFLAGS=-DHAVE_MMAP=${if stdenv.hostPlatform.isLinux then "1" else "0"}" ]; + buildFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CFLAGS=-DHAVE_MMAP=${if stdenv.hostPlatform.isLinux then "1" else "0"}" ]; postInstall = let diff --git a/pkgs/applications/misc/comodoro/default.nix b/pkgs/applications/misc/comodoro/default.nix index b9fd5ea28ba9a..997896c758996 100644 --- a/pkgs/applications/misc/comodoro/default.nix +++ b/pkgs/applications/misc/comodoro/default.nix @@ -3,8 +3,8 @@ , fetchFromGitHub , stdenv , installShellFiles -, installShellCompletions ? stdenv.hostPlatform == stdenv.buildPlatform -, installManPages ? stdenv.hostPlatform == stdenv.buildPlatform +, installShellCompletions ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) +, installManPages ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , withTcp ? true }: diff --git a/pkgs/applications/misc/mangal/default.nix b/pkgs/applications/misc/mangal/default.nix index cc485d84e8e08..19225bbf901fa 100644 --- a/pkgs/applications/misc/mangal/default.nix +++ b/pkgs/applications/misc/mangal/default.nix @@ -18,7 +18,7 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # Mangal creates a config file in the folder ~/.config/mangal and fails if not possible export MANGAL_CONFIG_PATH=`mktemp -d` installShellCompletion --cmd mangal \ diff --git a/pkgs/applications/misc/visidata/default.nix b/pkgs/applications/misc/visidata/default.nix index 2e7189dc484b3..298d554ee5a47 100644 --- a/pkgs/applications/misc/visidata/default.nix +++ b/pkgs/applications/misc/visidata/default.nix @@ -111,7 +111,7 @@ buildPythonApplication rec { ]; # check phase uses the output bin, which is not possible when cross-compiling - doCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doCheck = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); checkPhase = '' runHook preCheck diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 3616189374d30..2ee0b4385930b 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -415,7 +415,7 @@ let host_toolchain = "//build/toolchain/linux/unbundle:default"; # We only build those specific toolchains when we cross-compile, as native non-cross-compilations would otherwise # end up building much more things than they need to (roughtly double the build steps and time/compute): - } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + } // lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) { host_toolchain = "//build/toolchain/linux/unbundle:host"; v8_snapshot_toolchain = "//build/toolchain/linux/unbundle:host"; } // { diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix index 8a129f2fdab8f..757695ebe4df8 100644 --- a/pkgs/applications/networking/browsers/elinks/default.nix +++ b/pkgs/applications/networking/browsers/elinks/default.nix @@ -4,7 +4,7 @@ , # Incompatible licenses, LGPLv3 - GPLv2 enableGuile ? false, guile ? null , enablePython ? false, python ? null -, enablePerl ? (!stdenv.isDarwin) && (stdenv.hostPlatform == stdenv.buildPlatform), perl ? null +, enablePerl ? (!stdenv.isDarwin) && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), perl ? null # re-add javascript support when upstream supports modern spidermonkey }: diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 81ab6cd1fa17e..6c3a2eb0ee9b3 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -104,7 +104,7 @@ in , jackSupport ? stdenv.isLinux, libjack2 , jemallocSupport ? !stdenv.hostPlatform.isMusl, jemalloc , ltoSupport ? (stdenv.isLinux && stdenv.is64bit && !stdenv.hostPlatform.isRiscV), overrideCC, buildPackages -, pgoSupport ? (stdenv.isLinux && stdenv.hostPlatform == stdenv.buildPlatform), xvfb-run +, pgoSupport ? (stdenv.isLinux && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)), xvfb-run , pipewireSupport ? waylandSupport && webrtcSupport , pulseaudioSupport ? stdenv.isLinux, libpulseaudio , sndioSupport ? stdenv.isLinux, sndio diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix index acfd83f560867..b9bdd26207175 100644 --- a/pkgs/applications/networking/browsers/w3m/default.nix +++ b/pkgs/applications/networking/browsers/w3m/default.nix @@ -47,7 +47,7 @@ in stdenv.mkDerivation rec { }) ]; - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' ln -s ${mktable}/bin/mktable mktable # stop make from recompiling mktable sed -ie 's!mktable.*:.*!mktable:!' Makefile.in @@ -68,7 +68,7 @@ in stdenv.mkDerivation rec { configureFlags = [ "--with-ssl=${openssl.dev}" "--with-gc=${boehmgc.dev}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ac_cv_func_setpgrp_void=yes" ] ++ lib.optional graphicsSupport "--enable-image=${lib.optionalString x11Support "x11,"}fb" diff --git a/pkgs/applications/networking/cluster/argo/default.nix b/pkgs/applications/networking/cluster/argo/default.nix index e66bfb0a9a10b..660d9453e9174 100644 --- a/pkgs/applications/networking/cluster/argo/default.nix +++ b/pkgs/applications/networking/cluster/argo/default.nix @@ -74,7 +74,7 @@ buildGoModule rec { postInstall = '' for shell in bash zsh; do - ${if (stdenv.buildPlatform == stdenv.hostPlatform) + ${if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then "$out/bin/argo" else "${pkgsBuildBuild.argo}/bin/argo" } completion $shell > argo.$shell diff --git a/pkgs/applications/networking/cluster/fluxcd/default.nix b/pkgs/applications/networking/cluster/fluxcd/default.nix index 75689b47710fb..d1aa800e32ef7 100644 --- a/pkgs/applications/networking/cluster/fluxcd/default.nix +++ b/pkgs/applications/networking/cluster/fluxcd/default.nix @@ -53,7 +53,7 @@ in buildGoModule rec { $out/bin/flux --version | grep ${version} > /dev/null ''; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' for shell in bash fish zsh; do $out/bin/flux completion $shell > flux.$shell installShellCompletion flux.$shell diff --git a/pkgs/applications/networking/cluster/kaniko/default.nix b/pkgs/applications/networking/cluster/kaniko/default.nix index 22875f86c161c..6ae1b2c732b64 100644 --- a/pkgs/applications/networking/cluster/kaniko/default.nix +++ b/pkgs/applications/networking/cluster/kaniko/default.nix @@ -29,7 +29,7 @@ buildGoModule rec { doCheck = false; # requires docker, container-diff (unpackaged yet) - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' for shell in bash fish zsh; do $out/bin/executor completion $shell > executor.$shell installShellCompletion executor.$shell diff --git a/pkgs/applications/networking/cluster/kubeshark/default.nix b/pkgs/applications/networking/cluster/kubeshark/default.nix index 1d4c38bdff30c..46f0c48bcd8c5 100644 --- a/pkgs/applications/networking/cluster/kubeshark/default.nix +++ b/pkgs/applications/networking/cluster/kubeshark/default.nix @@ -29,7 +29,7 @@ buildGoModule rec { ''; doCheck = true; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' installShellCompletion --cmd kubeshark \ --bash <($out/bin/kubeshark completion bash) \ --fish <($out/bin/kubeshark completion fish) \ diff --git a/pkgs/applications/networking/cluster/kubevela/default.nix b/pkgs/applications/networking/cluster/kubevela/default.nix index caa2519af57aa..e9b3ee56c1772 100644 --- a/pkgs/applications/networking/cluster/kubevela/default.nix +++ b/pkgs/applications/networking/cluster/kubevela/default.nix @@ -40,7 +40,7 @@ buildGoModule rec { ''; nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' installShellCompletion --cmd vela \ --bash <($out/bin/vela completion bash) \ --zsh <($out/bin/vela completion zsh) diff --git a/pkgs/applications/networking/cluster/velero/default.nix b/pkgs/applications/networking/cluster/velero/default.nix index 8a39c31f11d9e..06e9a786f1d1d 100644 --- a/pkgs/applications/networking/cluster/velero/default.nix +++ b/pkgs/applications/networking/cluster/velero/default.nix @@ -31,7 +31,7 @@ buildGoModule rec { ''; nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' $out/bin/velero completion bash > velero.bash $out/bin/velero completion zsh > velero.zsh installShellCompletion velero.{bash,zsh} diff --git a/pkgs/applications/networking/instant-messengers/element/keytar/default.nix b/pkgs/applications/networking/instant-messengers/element/keytar/default.nix index d43894e08239a..5ef379ce80f17 100644 --- a/pkgs/applications/networking/instant-messengers/element/keytar/default.nix +++ b/pkgs/applications/networking/instant-messengers/element/keytar/default.nix @@ -31,7 +31,7 @@ in stdenv.mkDerivation rec { doCheck = false; - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' pkg-config() { "''${PKG_CONFIG}" "$@"; } export -f pkg-config ''; diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix index 9300a73b175db..dc7e8f85face0 100644 --- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix +++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix @@ -117,7 +117,7 @@ let --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" ''; - doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doInstallCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # In particular, this detects missing python imports in some of the tools. postFixup = let # TODO: python is a script, so it doesn't work as interpreter on darwin diff --git a/pkgs/applications/networking/instant-messengers/utox/default.nix b/pkgs/applications/networking/instant-messengers/utox/default.nix index c5aa13da0d33d..ee1e7805098b4 100644 --- a/pkgs/applications/networking/instant-messengers/utox/default.nix +++ b/pkgs/applications/networking/instant-messengers/utox/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { "-DENABLE_TESTS=${if doCheck then "ON" else "OFF"}" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); nativeCheckInputs = [ check ]; meta = with lib; { diff --git a/pkgs/applications/networking/offrss/default.nix b/pkgs/applications/networking/offrss/default.nix index 8d7889663fff7..f5af7e0b94a58 100644 --- a/pkgs/applications/networking/offrss/default.nix +++ b/pkgs/applications/networking/offrss/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { ''; buildInputs = [ curl libmrss ] - ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) podofo + ++ lib.optional (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) podofo ++ lib.optional (!stdenv.isLinux) libiconv; # Workaround build failure on -fno-common toolchains: @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { --replace '$(CC) $(CFLAGS) $(LDFLAGS)' '$(CXX) $(CFLAGS) $(LDFLAGS)' '' + lib.optionalString (!stdenv.isLinux) '' sed 's/#EXTRA/EXTRA/' -i Makefile - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' sed 's/^PDF/#PDF/' -i Makefile ''; diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 81dd459f5cb06..97f8383928296 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -69,7 +69,7 @@ stdenv.mkDerivation rec { ./patches/lookup-dumpcap-in-path.patch ]; - depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + depsBuildBuild = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ buildPackages.stdenv.cc ]; @@ -141,7 +141,7 @@ stdenv.mkDerivation rec { "-DCMAKE_INSTALL_LIBDIR=lib" "-DENABLE_APPLICATION_BUNDLE=${if withQt && stdenv.isDarwin then "ON" else "OFF"}" "-DLEMON_C_COMPILER=cc" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT=" "-DHAVE_C99_VSNPRINTF_EXITCODE=0" ]; diff --git a/pkgs/applications/office/kmymoney/default.nix b/pkgs/applications/office/kmymoney/default.nix index a910d76b29c95..c16aa77053f42 100644 --- a/pkgs/applications/office/kmymoney/default.nix +++ b/pkgs/applications/office/kmymoney/default.nix @@ -59,7 +59,7 @@ stdenv.mkDerivation rec { "kmymoney/plugins/woob/interface/kmymoneywoob.py" ''; - doInstallCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doInstallCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); nativeInstallCheckInputs = [ xvfb-run ]; installCheckPhase = lib.optionalString doInstallCheck '' diff --git a/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix b/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix index 82b9f8e36fe1d..cc8cd942bc860 100644 --- a/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix +++ b/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix @@ -17,7 +17,7 @@ , mkOpenModelicaDerivation }: let - isCross = stdenv.buildPlatform != stdenv.hostPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); nativeOMCompiler = buildPackages.openmodelica.omcompiler; in mkOpenModelicaDerivation ({ diff --git a/pkgs/applications/terminal-emulators/foot/default.nix b/pkgs/applications/terminal-emulators/foot/default.nix index 0af07518001a3..0b112aad79244 100644 --- a/pkgs/applications/terminal-emulators/foot/default.nix +++ b/pkgs/applications/terminal-emulators/foot/default.nix @@ -84,7 +84,7 @@ let # PGO only makes sense if we are not cross compiling and # using a compiler which foot's PGO build supports (clang or gcc) - doPgo = allowPgo && (stdenv.hostPlatform == stdenv.buildPlatform) + doPgo = allowPgo && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && compilerName != "unknown"; terminfoDir = "${placeholder "terminfo"}/share/terminfo"; diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix index 15d6bc84caa59..de05b0567ae20 100644 --- a/pkgs/applications/version-management/fossil/default.nix +++ b/pkgs/applications/version-management/fossil/default.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); configureFlags = lib.optional (!withInternalSqlite) "--disable-internal-sqlite" diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index d7e008d656fde..76434e959551b 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -5,7 +5,7 @@ , asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45 , libxslt, tcl, tk, makeWrapper, libiconv , svnSupport ? false, subversionClient, perlLibs, smtpPerlLibs -, perlSupport ? stdenv.buildPlatform == stdenv.hostPlatform +, perlSupport ? (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) , nlsSupport ? true , osxkeychainSupport ? stdenv.isDarwin , guiSupport ? false @@ -91,7 +91,7 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "ac_cv_prog_CURL_CONFIG=${lib.getDev curl}/bin/curl-config" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ac_cv_fread_reads_directories=yes" "ac_cv_snprintf_returns_bogus=no" "ac_cv_iconv_omits_bom=no" @@ -106,7 +106,7 @@ stdenv.mkDerivation (finalAttrs: { ] # Git does not allow setting a shell separately for building and run-time. # Therefore lets leave it at the default /bin/sh when cross-compiling - ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "SHELL_PATH=${stdenv.shell}" + ++ lib.optional (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "SHELL_PATH=${stdenv.shell}" ++ (if perlSupport then ["PERL_PATH=${perlPackages.perl}/bin/perl"] else ["NO_PERL=1"]) ++ (if pythonSupport then ["PYTHON_PATH=${python3}/bin/python"] else ["NO_PYTHON=1"]) ++ lib.optionals stdenv.isSunOS ["INSTALL=install" "NO_INET_NTOP=" "NO_INET_PTON="] @@ -122,9 +122,9 @@ stdenv.mkDerivation (finalAttrs: { # # See https://github.com/Homebrew/homebrew-core/commit/dfa3ccf1e7d3901e371b5140b935839ba9d8b706 ++ lib.optional stdenv.isDarwin "TKFRAMEWORK=/nonexistent" - ++ lib.optional (stdenv.hostPlatform.isFreeBSD && stdenv.hostPlatform != stdenv.buildPlatform) "uname_S=FreeBSD"; + ++ lib.optional (stdenv.hostPlatform.isFreeBSD && (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)) "uname_S=FreeBSD"; - disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + disallowedReferences = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ stdenv.shellPackage ]; diff --git a/pkgs/applications/version-management/glab/default.nix b/pkgs/applications/version-management/glab/default.nix index 9f3e08464dd30..d33cc963f9798 100644 --- a/pkgs/applications/version-management/glab/default.nix +++ b/pkgs/applications/version-management/glab/default.nix @@ -28,7 +28,7 @@ buildGoModule rec { nativeBuildInputs = [ installShellFiles ]; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' make manpage installManPage share/man/man1/* installShellCompletion --cmd glab \ diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 25c2df1ad71be..dd8ebed641b2f 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -133,7 +133,7 @@ let requiredSystemFeatures = [ "big-parallel" ]; # Don't run tests if not-Linux or if cross-compiling. - meta.broken = !stdenv.hostPlatform.isLinux || stdenv.buildPlatform != stdenv.hostPlatform; + meta.broken = !stdenv.hostPlatform.isLinux || (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); } '' addToSearchPathWithCustomDelimiter : PYTHONPATH "${mercurial}/${python.sitePackages}" diff --git a/pkgs/applications/version-management/rcs/default.nix b/pkgs/applications/version-management/rcs/default.nix index 40d909c8e0282..bf17362b55bd7 100644 --- a/pkgs/applications/version-management/rcs/default.nix +++ b/pkgs/applications/version-management/rcs/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { DIFF3 = "${diffutils}/bin/diff3"; disallowedReferences = - lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) + lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ buildPackages.diffutils buildPackages.ed ]; env.NIX_CFLAGS_COMPILE = "-std=c99"; diff --git a/pkgs/applications/video/kodi/unwrapped.nix b/pkgs/applications/video/kodi/unwrapped.nix index e8e5b5844f1f4..36b82b6c52150 100644 --- a/pkgs/applications/video/kodi/unwrapped.nix +++ b/pkgs/applications/video/kodi/unwrapped.nix @@ -205,7 +205,7 @@ in stdenv.mkDerivation (finalAttrs: { preConfigure = '' cmakeFlagsArray+=("-DCORE_PLATFORM_NAME=${lib.concatStringsSep " " kodi_platforms}") - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # Need these tools on the build system when cross compiling, # hacky, but have found no other way. CXX=$CXX_FOR_BUILD LD=ld make -C tools/depends/native/JsonSchemaBuilder diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 97d1baf9c3e3f..a2d8952707f7c 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -64,7 +64,7 @@ let meta.license = lib.licenses.unfree; } else null; - crossBuild = stdenv.hostPlatform != stdenv.buildPlatform; + crossBuild = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in diff --git a/pkgs/applications/video/omxplayer/default.nix b/pkgs/applications/video/omxplayer/default.nix index c9c77c1bbcb95..3a600121963f2 100644 --- a/pkgs/applications/video/omxplayer/default.nix +++ b/pkgs/applications/video/omxplayer/default.nix @@ -55,7 +55,7 @@ let "--disable-debug" "--arch=${stdenv.hostPlatform.parsed.cpu.name}" "--target_os=${stdenv.hostPlatform.parsed.kernel.name}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--cross-prefix=${stdenv.cc.targetPrefix}" "--enable-cross-compile" ]; diff --git a/pkgs/applications/virtualization/kvmtool/default.nix b/pkgs/applications/virtualization/kvmtool/default.nix index ddcc24f3557dc..d604b3b5755ed 100644 --- a/pkgs/applications/virtualization/kvmtool/default.nix +++ b/pkgs/applications/virtualization/kvmtool/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { "prefix=${placeholder "out"}" ] ++ lib.optionals stdenv.hostPlatform.isAarch64 ([ "LIBFDT_DIR=${dtc}/lib" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "CROSS_COMPILE=aarch64-unknown-linux-gnu-" "ARCH=arm64" ]); diff --git a/pkgs/build-support/go/module.nix b/pkgs/build-support/go/module.nix index bc28fbf6fc420..1484f22b09665 100644 --- a/pkgs/build-support/go/module.nix +++ b/pkgs/build-support/go/module.nix @@ -270,7 +270,7 @@ let echo "Building subPackage $pkg" buildGoDir install "$pkg" done - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # normalize cross-compiled builds w.r.t. native builds ( dir=$GOPATH/bin/${go.GOOS}_${go.GOARCH} diff --git a/pkgs/build-support/go/package.nix b/pkgs/build-support/go/package.nix index 58a242a2535c2..05dc46ce9f60b 100644 --- a/pkgs/build-support/go/package.nix +++ b/pkgs/build-support/go/package.nix @@ -221,7 +221,7 @@ let echo "Building subPackage $pkg" buildGoDir install "$pkg" done - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # normalize cross-compiled builds w.r.t. native builds ( dir=$NIX_BUILD_TOP/go/bin/${go.GOOS}_${go.GOARCH} diff --git a/pkgs/build-support/lib/cmake.nix b/pkgs/build-support/lib/cmake.nix index 57fa586d34555..3c57ccf8f72cb 100644 --- a/pkgs/build-support/lib/cmake.nix +++ b/pkgs/build-support/lib/cmake.nix @@ -4,7 +4,7 @@ let inherit (lib) findFirst isString optional optionals; cmakeFlags' = - optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ + optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) ([ "-DCMAKE_SYSTEM_NAME=${findFirst isString "Generic" (optional (!stdenv.hostPlatform.isRedox) stdenv.hostPlatform.uname.system)}" ] ++ optionals (stdenv.hostPlatform.uname.processor != null) [ "-DCMAKE_SYSTEM_PROCESSOR=${stdenv.hostPlatform.uname.processor}" diff --git a/pkgs/build-support/lib/meson.nix b/pkgs/build-support/lib/meson.nix index 9ffc5b8c1710f..006b085562054 100644 --- a/pkgs/build-support/lib/meson.nix +++ b/pkgs/build-support/lib/meson.nix @@ -29,7 +29,7 @@ let cmake = 'cmake' ''; - crossFlags = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-file=${crossFile}" ]; + crossFlags = optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--cross-file=${crossFile}" ]; makeMesonFlags = { mesonFlags ? [], ... }: crossFlags ++ mesonFlags; diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix index 7484b3ad0290e..be80bc5199b6c 100644 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/build-crate.nix @@ -19,7 +19,7 @@ "--remap-path-prefix=$NIX_BUILD_TOP=/" (mkRustcDepArgs dependencies crateRenames) (mkRustcFeatureArgs crateFeatures) - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--target" stdenv.hostPlatform.rust.rustcTargetSpec ] ++ lib.optionals (needUnstableCLI dependencies) [ "-Z" "unstable-options" diff --git a/pkgs/build-support/rust/build-rust-crate/test/default.nix b/pkgs/build-support/rust/build-rust-crate/test/default.nix index 522eedfede7f2..ec4ad23832ff7 100644 --- a/pkgs/build-support/rust/build-rust-crate/test/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/test/default.nix @@ -93,15 +93,15 @@ let } (if !hasTests then '' ${lib.concatMapStringsSep "\n" (binary: # Can't actually run the binary when cross-compiling - (lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "type ") + binary + (lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "type ") + binary ) binaries} ${lib.optionalString isLib '' test -e ${crate}/lib/*.rlib || exit 1 - ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "test -x "} \ + ${lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "test -x "} \ ${libTestBinary}/bin/run-test-${crateName} ''} touch $out - '' else if stdenv.hostPlatform == stdenv.buildPlatform then '' + '' else if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then '' for file in ${crate}/tests/*; do $file 2>&1 >> $out done @@ -630,7 +630,7 @@ let pkg = brotliCrates.brotli_2_5_0 {}; in runCommand "run-brotli-test-cmd" { nativeBuildInputs = [ pkg ]; - } (if stdenv.hostPlatform == stdenv.buildPlatform then '' + } (if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then '' ${pkg}/bin/brotli -c ${pkg}/bin/brotli > /dev/null && touch $out '' else '' test -x '${pkg}/bin/brotli' && touch $out @@ -654,7 +654,7 @@ let pkg = rcgenCrates.rootCrate.build; in runCommand "run-rcgen-test-cmd" { nativeBuildInputs = [ pkg ]; - } (if stdenv.hostPlatform == stdenv.buildPlatform then '' + } (if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then '' ${pkg}/bin/rcgen && touch $out '' else '' test -x '${pkg}/bin/rcgen' && touch $out diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 36e0408cc198a..b204ba405522e 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -133,7 +133,7 @@ stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoUpdateHook" "carg patches = cargoPatches ++ patches; PKG_CONFIG_ALLOW_CROSS = - if stdenv.buildPlatform != stdenv.hostPlatform then 1 else 0; + if (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then 1 else 0; postUnpack = '' eval "$cargoDepsHook" diff --git a/pkgs/by-name/at/attic-client/package.nix b/pkgs/by-name/at/attic-client/package.nix index e369f4e8dd6aa..b682ae73615b4 100644 --- a/pkgs/by-name/at/attic-client/package.nix +++ b/pkgs/by-name/at/attic-client/package.nix @@ -46,7 +46,7 @@ rustPlatform.buildRustPackage { # to nix-daemon to import NARs, which is not possible in the build sandbox. doCheck = false; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' if [[ -f $out/bin/attic ]]; then installShellCompletion --cmd attic \ --bash <($out/bin/attic gen-completions bash) \ diff --git a/pkgs/by-name/cm/cmake/package.nix b/pkgs/by-name/cm/cmake/package.nix index 5c2a9983d6270..370fceadfb2ca 100644 --- a/pkgs/by-name/cm/cmake/package.nix +++ b/pkgs/by-name/cm/cmake/package.nix @@ -174,7 +174,7 @@ stdenv.mkDerivation (finalAttrs: { env.NIX_CFLAGS_COMPILE = "-Wno-unused-command-line-argument"; # make install attempts to use the just-built cmake - preInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preInstall = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' sed -i 's|bin/cmake|${buildPackages.cmakeMinimal}/bin/cmake|g' Makefile ''; diff --git a/pkgs/by-name/cz/czkawka/package.nix b/pkgs/by-name/cz/czkawka/package.nix index fdf03e4592914..ec0a38df829a0 100644 --- a/pkgs/by-name/cz/czkawka/package.nix +++ b/pkgs/by-name/cz/czkawka/package.nix @@ -63,7 +63,7 @@ rustPlatform.buildRustPackage { ''; doCheck = stdenv.hostPlatform.isLinux - && (stdenv.hostPlatform == stdenv.buildPlatform); + && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); passthru.tests.version = testers.testVersion { package = czkawka; diff --git a/pkgs/by-name/ei/eiwd/package.nix b/pkgs/by-name/ei/eiwd/package.nix index 738ba347cf9c5..432a8888d1b57 100644 --- a/pkgs/by-name/ei/eiwd/package.nix +++ b/pkgs/by-name/ei/eiwd/package.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; # override this to false if you don't want to build python3 - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # prevent the `install-data-local` Makefile rule from running; # all it does is attempt to `mkdir` the `localstatedir`. diff --git a/pkgs/by-name/hi/himalaya/package.nix b/pkgs/by-name/hi/himalaya/package.nix index 607bb775f8fff..5e95206e30e27 100644 --- a/pkgs/by-name/hi/himalaya/package.nix +++ b/pkgs/by-name/hi/himalaya/package.nix @@ -5,8 +5,8 @@ , pkg-config , darwin , installShellFiles -, installShellCompletions ? stdenv.hostPlatform == stdenv.buildPlatform -, installManPages ? stdenv.hostPlatform == stdenv.buildPlatform +, installShellCompletions ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) +, installManPages ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , notmuch , gpgme , buildNoDefaultFeatures ? false diff --git a/pkgs/by-name/ja/jasper/package.nix b/pkgs/by-name/ja/jasper/package.nix index 11a298208f567..eef954559a07c 100644 --- a/pkgs/by-name/ja/jasper/package.nix +++ b/pkgs/by-name/ja/jasper/package.nix @@ -81,7 +81,7 @@ stdenv.mkDerivation (finalAttrs: { platforms = lib.platforms.unix; # The value of __STDC_VERSION__ cannot be automatically determined when # cross-compiling. - broken = stdenv.buildPlatform != stdenv.hostPlatform; + broken = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); }; }) # TODO: investigate opengl support diff --git a/pkgs/by-name/ne/neverest/package.nix b/pkgs/by-name/ne/neverest/package.nix index 04e68b52841f6..e591266b88425 100644 --- a/pkgs/by-name/ne/neverest/package.nix +++ b/pkgs/by-name/ne/neverest/package.nix @@ -5,8 +5,8 @@ , pkg-config , darwin , installShellFiles -, installShellCompletions ? stdenv.hostPlatform == stdenv.buildPlatform -, installManPages ? stdenv.hostPlatform == stdenv.buildPlatform +, installShellCompletions ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) +, installManPages ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , notmuch , buildNoDefaultFeatures ? false , buildFeatures ? [] diff --git a/pkgs/by-name/op/openai-triton-llvm/package.nix b/pkgs/by-name/op/openai-triton-llvm/package.nix index 7b6f40662a75e..e8c1e94b8a131 100644 --- a/pkgs/by-name/op/openai-triton-llvm/package.nix +++ b/pkgs/by-name/op/openai-triton-llvm/package.nix @@ -42,7 +42,7 @@ let then python3Packages.python.withPackages (p: with p; [ psutil pygments pyyaml ]) else python3Packages.python; - isNative = stdenv.hostPlatform == stdenv.buildPlatform; + isNative = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in stdenv.mkDerivation (finalAttrs: { pname = "openai-triton-llvm"; version = "17.0.0-c5dede880d17"; diff --git a/pkgs/by-name/re/redict/package.nix b/pkgs/by-name/re/redict/package.nix index 7d045cdc6fcb6..3f27e8ba0f4c4 100644 --- a/pkgs/by-name/re/redict/package.nix +++ b/pkgs/by-name/re/redict/package.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: { # More cross-compiling fixes. makeFlags = [ "PREFIX=${placeholder "out"}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ] ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; diff --git a/pkgs/by-name/ti/tilemaker/package.nix b/pkgs/by-name/ti/tilemaker/package.nix index 7e7714635c891..4abfa36d71fee 100644 --- a/pkgs/by-name/ti/tilemaker/package.nix +++ b/pkgs/by-name/ti/tilemaker/package.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ boost lua protobuf_21 rapidjson shapelib sqlite zlib ]; - cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + cmakeFlags = lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) (lib.cmakeFeature "PROTOBUF_PROTOC_EXECUTABLE" "${buildPackages.protobuf}/bin/protoc"); env.NIX_CFLAGS_COMPILE = toString [ "-DTM_VERSION=${finalAttrs.version}" ]; diff --git a/pkgs/by-name/uc/uclibc-ng/package.nix b/pkgs/by-name/uc/uclibc-ng/package.nix index aee6f6f015f18..290e2e734a82b 100644 --- a/pkgs/by-name/uc/uclibc-ng/package.nix +++ b/pkgs/by-name/uc/uclibc-ng/package.nix @@ -9,7 +9,7 @@ }: let - isCross = (stdenv.buildPlatform != stdenv.hostPlatform); + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); configParser = '' function parseconfig { set -x diff --git a/pkgs/by-name/va/valkey/package.nix b/pkgs/by-name/va/valkey/package.nix index 4a8b427ece982..a866378a3a24a 100644 --- a/pkgs/by-name/va/valkey/package.nix +++ b/pkgs/by-name/va/valkey/package.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: { # More cross-compiling fixes. makeFlags = [ "PREFIX=${placeholder "out"}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ] ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; diff --git a/pkgs/by-name/wl/wlogout/package.nix b/pkgs/by-name/wl/wlogout/package.nix index 63a537f6e3e2d..8ed512b9d982d 100644 --- a/pkgs/by-name/wl/wlogout/package.nix +++ b/pkgs/by-name/wl/wlogout/package.nix @@ -15,7 +15,7 @@ # on gobject-introspection. # Disable it when cross-compiling since it's an optional dependency. # This disables transparency support. -, withGtkLayerShell ? (stdenv.buildPlatform == stdenv.hostPlatform) +, withGtkLayerShell ? (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) }: stdenv.mkDerivation (finalAttrs: { diff --git a/pkgs/data/misc/shared-mime-info/default.nix b/pkgs/data/misc/shared-mime-info/default.nix index 9e034d68241df..aed38bf33db02 100644 --- a/pkgs/data/misc/shared-mime-info/default.nix +++ b/pkgs/data/misc/shared-mime-info/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { pkg-config gettext libxml2 - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) shared-mime-info; + ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) shared-mime-info; buildInputs = [ libxml2 diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix index 522b2da68ca5c..2b84b55da73df 100644 --- a/pkgs/data/misc/tzdata/default.nix +++ b/pkgs/data/misc/tzdata/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: { # - check_now, because that depends on the current time checkTarget = "check_back check_character_set check_white_space check_links check_name_lengths check_slashed_abbrs check_sorted check_tables check_ziguard check_zishrink check_tzs"; - installFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + installFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "zic=${buildPackages.tzdata.bin}/bin/zic" ]; diff --git a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix index 67208b6d2cdef..b036c8565329e 100644 --- a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix +++ b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "--with-idl-compiler=${lib.getExe' buildPackages.gnome2.ORBit2 "orbit-idl-2"}" # https://github.com/void-linux/void-packages/blob/e5856e02aa6ef7e4f2725afbff2915f89d39024b/srcpkgs/ORBit2/template#L17-L35 "ac_cv_alignof_CORBA_boolean=1" diff --git a/pkgs/desktops/gnome-2/platform/libIDL/default.nix b/pkgs/desktops/gnome-2/platform/libIDL/default.nix index 81f8e6d08e170..9f1fcd7b1d60f 100644 --- a/pkgs/desktops/gnome-2/platform/libIDL/default.nix +++ b/pkgs/desktops/gnome-2/platform/libIDL/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ flex bison pkg-config ]; - configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ # before openembedded removed libIDL # the result was always ll https://lists.openembedded.org/g/openembedded-core/topic/85775262?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3A%2C%2C%2C0%2C0%2C0%2C85775262 "libIDL_cv_long_long_format=ll" diff --git a/pkgs/desktops/lomiri/development/geonames/default.nix b/pkgs/desktops/lomiri/development/geonames/default.nix index ce77bca6bc41c..4613e9da4aeec 100644 --- a/pkgs/desktops/lomiri/development/geonames/default.nix +++ b/pkgs/desktops/lomiri/development/geonames/default.nix @@ -107,7 +107,7 @@ stdenv.mkDerivation (finalAttrs: { platforms = platforms.all; # Cross requires hostPlatform emulation during build # https://gitlab.com/ubports/development/core/geonames/-/issues/1 - broken = stdenv.buildPlatform != stdenv.hostPlatform && !stdenv.hostPlatform.emulatorAvailable buildPackages; + broken = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && !stdenv.hostPlatform.emulatorAvailable buildPackages; pkgConfigModules = [ "geonames" ]; diff --git a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix index a8b172f4eb5d2..e06f4f367cf49 100644 --- a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix +++ b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix @@ -50,7 +50,7 @@ let # targetInfo.triple is what Google thinks the toolchain should be, this is a little # different from what we use. We make it four parts to conform with the existing # standard more properly. - targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) (stdenv.targetPlatform.config + "-"); + targetPrefix = lib.optionalString (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) (stdenv.targetPlatform.config + "-"); in rec { diff --git a/pkgs/development/compilers/chicken/5/chicken.nix b/pkgs/development/compilers/chicken/5/chicken.nix index dd15b5394bc9c..8fb8f6987c5ae 100644 --- a/pkgs/development/compilers/chicken/5/chicken.nix +++ b/pkgs/development/compilers/chicken/5/chicken.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: { "XCODE_TOOL_PATH=${darwin.binutils.bintools}/bin" "LINKER_OPTIONS=-headerpad_max_install_names" "POSTINSTALL_PROGRAM=install_name_tool" - ]) ++ (lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ]) ++ (lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "HOSTSYSTEM=${stdenv.hostPlatform.config}" "TARGET_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" "TARGET_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" diff --git a/pkgs/development/compilers/fbc/default.nix b/pkgs/development/compilers/fbc/default.nix index 7f9c519703923..74ae6cb13a72b 100644 --- a/pkgs/development/compilers/fbc/default.nix +++ b/pkgs/development/compilers/fbc/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { "format" ]; - makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + makeFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "TARGET=${stdenv.hostPlatform.config}" ]; @@ -72,7 +72,7 @@ stdenv.mkDerivation rec { BUILD_PREFIX=${buildPackages.stdenv.cc.targetPrefix} LD=${buildPackages.stdenv.cc.targetPrefix}ld make rtlib -j$buildJobs \ "FBC=$PWD/bin/fbc${stdenv.buildPlatform.extensions.executable} -i $PWD/inc" \ - ${if (stdenv.buildPlatform == stdenv.hostPlatform) then + ${if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then "BUILD_PREFIX=${buildPackages.stdenv.cc.targetPrefix} LD=${buildPackages.stdenv.cc.targetPrefix}ld" else "TARGET=${stdenv.hostPlatform.config}" @@ -80,7 +80,7 @@ stdenv.mkDerivation rec { echo Install patched build compiler and host rtlib to local directory make install-compiler prefix=$PWD/patched-fbc - make install-rtlib prefix=$PWD/patched-fbc ${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) "TARGET=${stdenv.hostPlatform.config}"} + make install-rtlib prefix=$PWD/patched-fbc ${lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "TARGET=${stdenv.hostPlatform.config}"} make clean echo Compile patched host everything with previous patched stage @@ -93,7 +93,7 @@ stdenv.mkDerivation rec { # Tests do not work when cross-compiling even if build platform can execute # host binaries, compiler struggles to find the cross compiler's libgcc_s - doCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doCheck = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); checkTarget = "unit-tests warning-tests log-tests"; diff --git a/pkgs/development/compilers/gcc/all.nix b/pkgs/development/compilers/gcc/all.nix index ba7d53b435838..7e02ea1b003a9 100644 --- a/pkgs/development/compilers/gcc/all.nix +++ b/pkgs/development/compilers/gcc/all.nix @@ -24,8 +24,8 @@ let inherit majorMinorVersion; reproducibleBuild = true; profiledCompiler = false; - libcCross = if stdenv.targetPlatform != stdenv.buildPlatform then args.libcCross else null; - threadsCross = if stdenv.targetPlatform != stdenv.buildPlatform then threadsCross else { }; + libcCross = if (!lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform) then args.libcCross else null; + threadsCross = if (!lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform) then threadsCross else { }; isl = if stdenv.isDarwin then null else if atLeast "9" then isl_0_20 else if atLeast "7" then isl_0_17 @@ -41,7 +41,7 @@ let else /* 4.8 */ cloog; } // lib.optionalAttrs (atLeast "6" && !(atLeast "9")) { # gcc 10 is too strict to cross compile gcc <= 8 - stdenv = if (stdenv.targetPlatform != stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; + stdenv = if (!lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform) && stdenv.cc.isGNU then gcc7Stdenv else stdenv; }))); in lib.nameValuePair attrName pkg; diff --git a/pkgs/development/compilers/gcc/common/configure-flags.nix b/pkgs/development/compilers/gcc/common/configure-flags.nix index b8dccf9fcc575..17286c6923a3c 100644 --- a/pkgs/development/compilers/gcc/common/configure-flags.nix +++ b/pkgs/development/compilers/gcc/common/configure-flags.nix @@ -24,7 +24,7 @@ , langObjC , langObjCpp , langJit -, disableBootstrap ? stdenv.targetPlatform != stdenv.hostPlatform +, disableBootstrap ? (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) }: assert !enablePlugin -> disableGdbPlugin; @@ -50,7 +50,7 @@ let crossMingw = targetPlatform != hostPlatform && targetPlatform.isMinGW; crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem"; - targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + targetPrefix = lib.optionalString (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) "${stdenv.targetPlatform.config}-"; crossConfigureFlags = diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc/default.nix index 5e017a21fa1f5..81258ccf379dc 100644 --- a/pkgs/development/compilers/gcc/default.nix +++ b/pkgs/development/compilers/gcc/default.nix @@ -19,7 +19,7 @@ , libucontext ? null , gnat-bootstrap ? null , enableMultilib ? false -, enablePlugin ? stdenv.hostPlatform == stdenv.buildPlatform # Whether to support user-supplied plug-ins +, enablePlugin ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) # Whether to support user-supplied plug-ins , name ? "gcc" , libcCross ? null , threadsCross ? null # for MinGW diff --git a/pkgs/development/compilers/ghc/8.10.7-binary.nix b/pkgs/development/compilers/ghc/8.10.7-binary.nix index c29b3c89f4b87..68684d092c477 100644 --- a/pkgs/development/compilers/ghc/8.10.7-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.7-binary.nix @@ -14,7 +14,7 @@ }: # Prebuilt only does native -assert stdenv.targetPlatform == stdenv.hostPlatform; +assert (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform); let downloadsUrl = "https://downloads.haskell.org/ghc"; diff --git a/pkgs/development/compilers/ghc/8.10.7.nix b/pkgs/development/compilers/ghc/8.10.7.nix index cf867408dd315..710ec76ad682e 100644 --- a/pkgs/development/compilers/ghc/8.10.7.nix +++ b/pkgs/development/compilers/ghc/8.10.7.nix @@ -26,7 +26,7 @@ , gmp , # If enabled, use -fPIC when compiling static libs. - enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform + enableRelocatedStaticLibs ? (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) , enableProfiledLibs ? true @@ -39,7 +39,7 @@ , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. - ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + ghcFlavour ? lib.optionalString (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) (if useLLVM then "perf-cross" else "perf-cross-ncg") , # Whether to build sphinx documentation. @@ -51,7 +51,7 @@ , enableHaddockProgram ? # Disabled for cross; see note [HADDOCK_DOCS]. - (stdenv.targetPlatform == stdenv.hostPlatform) + (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ @@ -62,7 +62,7 @@ assert !enableIntegerSimple -> gmp != null; # Cross cannot currently build the `haddock` program for silly reasons, # see note [HADDOCK_DOCS]. -assert (stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram; +assert (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) -> !enableHaddockProgram; let inherit (stdenv) buildPlatform hostPlatform targetPlatform; diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index d66f47b661a5d..50853ab4d1514 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -7,7 +7,7 @@ }: # Prebuilt only does native -assert stdenv.targetPlatform == stdenv.hostPlatform; +assert (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform); let useLLVM = !(stdenv.targetPlatform.isx86 diff --git a/pkgs/development/compilers/ghc/9.2.4-binary.nix b/pkgs/development/compilers/ghc/9.2.4-binary.nix index 920b63ce4eab0..322cf70051a96 100644 --- a/pkgs/development/compilers/ghc/9.2.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.2.4-binary.nix @@ -14,7 +14,7 @@ }: # Prebuilt only does native -assert stdenv.targetPlatform == stdenv.hostPlatform; +assert (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform); let downloadsUrl = "https://downloads.haskell.org/ghc"; diff --git a/pkgs/development/compilers/ghc/9.6.3-binary.nix b/pkgs/development/compilers/ghc/9.6.3-binary.nix index 65ed655e57974..92d63fd1995c1 100644 --- a/pkgs/development/compilers/ghc/9.6.3-binary.nix +++ b/pkgs/development/compilers/ghc/9.6.3-binary.nix @@ -14,7 +14,7 @@ }: # Prebuilt only does native -assert stdenv.targetPlatform == stdenv.hostPlatform; +assert (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform); let downloadsUrl = "https://downloads.haskell.org/ghc"; diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix index fcb5d43de7c0d..d51dfec53483a 100644 --- a/pkgs/development/compilers/ghc/common-hadrian.nix +++ b/pkgs/development/compilers/ghc/common-hadrian.nix @@ -55,7 +55,7 @@ , gmp , # If enabled, use -fPIC when compiling static libs. - enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform + enableRelocatedStaticLibs ? (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) , enableProfiledLibs ? true @@ -544,7 +544,7 @@ stdenv.mkDerivation ({ # TODO(@sternenseemann): there's no stage0:exe:haddock target by default, # so haddock isn't available for GHC cross-compilers. Can we fix that? - hasHaddock = stdenv.hostPlatform == stdenv.targetPlatform; + hasHaddock = (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform); }; meta = { diff --git a/pkgs/development/compilers/ghc/common-make-native-bignum.nix b/pkgs/development/compilers/ghc/common-make-native-bignum.nix index 6142c76f64078..09287fa2f9f7f 100644 --- a/pkgs/development/compilers/ghc/common-make-native-bignum.nix +++ b/pkgs/development/compilers/ghc/common-make-native-bignum.nix @@ -33,7 +33,7 @@ , gmp , # If enabled, use -fPIC when compiling static libs. - enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform + enableRelocatedStaticLibs ? (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) , enableProfiledLibs ? true @@ -46,7 +46,7 @@ , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. - ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + ghcFlavour ? lib.optionalString (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) (if useLLVM then "perf-cross" else "perf-cross-ncg") , # Whether to build sphinx documentation. @@ -58,7 +58,7 @@ , enableHaddockProgram ? # Disabled for cross; see note [HADDOCK_DOCS]. - (stdenv.targetPlatform == stdenv.hostPlatform) + (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) , # Whether to disable the large address space allocator # necessary fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ @@ -69,7 +69,7 @@ assert !enableNativeBignum -> gmp != null; # Cross cannot currently build the `haddock` program for silly reasons, # see note [HADDOCK_DOCS]. -assert (stdenv.targetPlatform != stdenv.hostPlatform) -> !enableHaddockProgram; +assert (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) -> !enableHaddockProgram; let inherit (stdenv) buildPlatform hostPlatform targetPlatform; diff --git a/pkgs/development/compilers/go/1.21.nix b/pkgs/development/compilers/go/1.21.nix index 312106f6388c3..7439626b99336 100644 --- a/pkgs/development/compilers/go/1.21.nix +++ b/pkgs/development/compilers/go/1.21.nix @@ -43,7 +43,7 @@ let # to handle the cross-building case where build != host == target targetCC = pkgsBuildTarget.targetPackages.stdenv.cc; - isCross = stdenv.buildPlatform != stdenv.targetPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.targetPlatform); in stdenv.mkDerivation (finalAttrs: { pname = "go"; diff --git a/pkgs/development/compilers/go/1.22.nix b/pkgs/development/compilers/go/1.22.nix index d3b8982118aeb..ef72ec6f60285 100644 --- a/pkgs/development/compilers/go/1.22.nix +++ b/pkgs/development/compilers/go/1.22.nix @@ -44,7 +44,7 @@ let # to handle the cross-building case where build != host == target targetCC = pkgsBuildTarget.targetPackages.stdenv.cc; - isCross = stdenv.buildPlatform != stdenv.targetPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.targetPlatform); in stdenv.mkDerivation (finalAttrs: { pname = "go"; diff --git a/pkgs/development/compilers/llvm/common/bintools.nix b/pkgs/development/compilers/llvm/common/bintools.nix index 85b570d976ae8..66e4362dd379d 100644 --- a/pkgs/development/compilers/llvm/common/bintools.nix +++ b/pkgs/development/compilers/llvm/common/bintools.nix @@ -1,7 +1,7 @@ { lib, runCommand, stdenv, llvm, lld, version, release_version }: let - targetPrefix = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) "${stdenv.targetPlatform.config}-"; + targetPrefix = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) "${stdenv.targetPlatform.config}-"; in runCommand "llvm-binutils-${version}" { diff --git a/pkgs/development/compilers/llvm/common/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix index 87234dfe7f172..f2be523578ec8 100644 --- a/pkgs/development/compilers/llvm/common/clang/default.nix +++ b/pkgs/development/compilers/llvm/common/clang/default.nix @@ -60,7 +60,7 @@ let "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) ([ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ @@ -196,7 +196,7 @@ let ''; }) // (lib.optionalAttrs (lib.versionAtLeast release_version "15") { - env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + env = lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) { # The following warning is triggered with (at least) gcc >= # 12, but appears to occur only for cross compiles. NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized"; diff --git a/pkgs/development/compilers/llvm/common/libclc.nix b/pkgs/development/compilers/llvm/common/libclc.nix index 4c2081e693c16..81ae3258b288e 100644 --- a/pkgs/development/compilers/llvm/common/libclc.nix +++ b/pkgs/development/compilers/llvm/common/libclc.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { 'find_program( LLVM_OPT opt PATHS "${buildLlvmTools.llvm}/bin" NO_DEFAULT_PATH )' \ --replace 'find_program( LLVM_SPIRV llvm-spirv PATHS ''${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )' \ 'find_program( LLVM_SPIRV llvm-spirv PATHS "${buildPackages.spirv-llvm-translator.override { inherit (buildLlvmTools) llvm; }}/bin" NO_DEFAULT_PATH )' - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' substituteInPlace CMakeLists.txt \ --replace 'COMMAND prepare_builtins' 'COMMAND ${buildLlvmTools.libclc.dev}/bin/prepare_builtins' ''; diff --git a/pkgs/development/compilers/llvm/common/lld/default.nix b/pkgs/development/compilers/llvm/common/lld/default.nix index 99bb150a817dc..f578146244a87 100644 --- a/pkgs/development/compilers/llvm/common/lld/default.nix +++ b/pkgs/development/compilers/llvm/common/lld/default.nix @@ -50,10 +50,10 @@ stdenv.mkDerivation (rec { buildInputs = [ libllvm libxml2 ]; cmakeFlags = lib.optionals (lib.versionOlder release_version "14") [ - "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-native"}" + "-DLLVM_CONFIG_PATH=${libllvm.dev}/bin/llvm-config${lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "-native"}" ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ "-DLLD_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/lld" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" ]; diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index 3decc70bb69ac..49d87d4ec5c93 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -31,7 +31,7 @@ , doCheck ? !stdenv.isAarch32 && (if lib.versionOlder release_version "15" then stdenv.isLinux else true) && (!stdenv.isx86_32 /* TODO: why */) && (!stdenv.hostPlatform.isMusl) && !(stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isBigEndian) - && (stdenv.hostPlatform == stdenv.buildPlatform) + && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? stdenv.isLinux /* PFM only supports Linux */ @@ -118,7 +118,7 @@ stdenv.mkDerivation (rec { buildInputs = [ libxml2 libffi ] ++ optional enablePFM libpfm; # exegesis - propagatedBuildInputs = (lib.optional (lib.versionAtLeast release_version "14" || stdenv.buildPlatform == stdenv.hostPlatform) ncurses) + propagatedBuildInputs = (lib.optional (lib.versionAtLeast release_version "14" || (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)) ncurses) ++ [ zlib ]; postPatch = optionalString stdenv.isDarwin ('' @@ -365,7 +365,7 @@ stdenv.mkDerivation (rec { ] ++ optionals isDarwin [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" - ] ++ optionals ((stdenv.hostPlatform != stdenv.buildPlatform) && !(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) [ + ] ++ optionals ((!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && !(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) [ "-DCMAKE_CROSSCOMPILING=True" "-DLLVM_TABLEGEN=${buildLlvmTools.llvm}/bin/llvm-tblgen" ( @@ -417,7 +417,7 @@ stdenv.mkDerivation (rec { + optionalString (stdenv.isDarwin && enableSharedLibraries) '' ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib '' - + optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + + optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; diff --git a/pkgs/development/compilers/llvm/common/mlir/default.nix b/pkgs/development/compilers/llvm/common/mlir/default.nix index 891e66b1d57c5..00f257a6933bc 100644 --- a/pkgs/development/compilers/llvm/common/mlir/default.nix +++ b/pkgs/development/compilers/llvm/common/mlir/default.nix @@ -60,7 +60,7 @@ stdenv.mkDerivation rec { "-DLLVM_ENABLE_PIC=OFF" "-DLLVM_BUILD_STATIC=ON" "-DLLVM_LINK_LLVM_DYLIB=OFF" - ] ++ lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) && !(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) [ + ] ++ lib.optionals ((!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && !(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) [ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" "-DMLIR_TABLEGEN_EXE=${buildLlvmTools.mlir}/bin/mlir-tblgen" ]; diff --git a/pkgs/development/compilers/llvm/common/openmp/default.nix b/pkgs/development/compilers/llvm/common/openmp/default.nix index 7d9d813f024c7..74ec7d9d3ff93 100644 --- a/pkgs/development/compilers/llvm/common/openmp/default.nix +++ b/pkgs/development/compilers/llvm/common/openmp/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation (rec { ]; buildInputs = [ - (if stdenv.buildPlatform == stdenv.hostPlatform then llvm else targetLlvm) + (if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then llvm else targetLlvm) ]; cmakeFlags = lib.optionals (lib.versions.major release_version == "13") [ diff --git a/pkgs/development/compilers/rust/cargo-auditable.nix b/pkgs/development/compilers/rust/cargo-auditable.nix index 0fa6098934c15..d17b8ab812c29 100644 --- a/pkgs/development/compilers/rust/cargo-auditable.nix +++ b/pkgs/development/compilers/rust/cargo-auditable.nix @@ -29,7 +29,7 @@ let changelog = "https://github.com/rust-secure-code/cargo-auditable/blob/v${version}/cargo-auditable/CHANGELOG.md"; license = with licenses; [ mit /* or */ asl20 ]; maintainers = with maintainers; [ figsoda ]; - broken = stdenv.hostPlatform != stdenv.buildPlatform; + broken = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); }; }; diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index b0c40c5760cb4..57e30ae9f8991 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -77,7 +77,7 @@ rustPlatform.buildRustPackage.override { license = [ licenses.mit licenses.asl20 ]; platforms = platforms.unix; # https://github.com/alexcrichton/nghttp2-rs/issues/2 - broken = stdenv.hostPlatform.isx86 && stdenv.buildPlatform != stdenv.hostPlatform; + broken = stdenv.hostPlatform.isx86 && (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); }; } // lib.optionalAttrs (stdenv.buildPlatform.rust.rustcTarget != stdenv.hostPlatform.rust.rustcTarget) { diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index 31501e668c893..eaabbaf4d3ac5 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -28,7 +28,7 @@ let inherit lib stdenv pkgsBuildHost pkgsBuildTarget pkgsTargetTarget; }; # Allow faster cross compiler generation by reusing Build artifacts - fastCross = (stdenv.buildPlatform == stdenv.hostPlatform) && (stdenv.hostPlatform != stdenv.targetPlatform); + fastCross = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && (!lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform); in { lib = lib'; @@ -60,7 +60,7 @@ in then pkgsBuildBuild.rustPackages else self.buildRustPackages.overrideScope (_: _: - lib.optionalAttrs (stdenv.buildPlatform == stdenv.hostPlatform) + lib.optionalAttrs (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) (selectRustPackage pkgsBuildHost).packages.prebuilt); bootRustPlatform = makeRustPlatform bootstrapRustPackages; in { diff --git a/pkgs/development/compilers/vala/default.nix b/pkgs/development/compilers/vala/default.nix index 1b880b61a05a1..d775144d9a332 100644 --- a/pkgs/development/compilers/vala/default.nix +++ b/pkgs/development/compilers/vala/default.nix @@ -44,7 +44,7 @@ let configureFlags = lib.optional disableGraphviz "--disable-graphviz"; # when cross-compiling ./compiler/valac is valac for host # so add the build vala in nativeBuildInputs - preBuild = lib.optionalString (disableGraphviz && (stdenv.buildPlatform == stdenv.hostPlatform)) "buildFlagsArray+=(\"VALAC=$(pwd)/compiler/valac\")"; + preBuild = lib.optionalString (disableGraphviz && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)) "buildFlagsArray+=(\"VALAC=$(pwd)/compiler/valac\")"; outputs = [ "out" "devdoc" ]; @@ -52,7 +52,7 @@ let pkg-config flex bison libxslt gobject-introspection ] ++ lib.optional (stdenv.isDarwin) expat ++ lib.optional disableGraphviz autoreconfHook # if we changed our ./configure script, need to reconfigure - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ vala ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ vala ] ++ extraNativeBuildInputs; buildInputs = [ diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 785ba249099bf..c049d68a075a5 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -5,7 +5,7 @@ }: let - isCross = stdenv.buildPlatform != stdenv.hostPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); # Pass the "wrong" C compiler rather than none at all so packages that just # use the C preproccessor still work, see diff --git a/pkgs/development/interpreters/guile/1.8.nix b/pkgs/development/interpreters/guile/1.8.nix index 51ac9ba3ed58f..84d1668cc544d 100644 --- a/pkgs/development/interpreters/guile/1.8.nix +++ b/pkgs/development/interpreters/guile/1.8.nix @@ -29,13 +29,13 @@ stdenv.mkDerivation rec { ] # Guile needs patching to preset results for the configure tests about # pthreads, which work only in native builds. - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "--with-threads=no"; depsBuildBuild = [ buildPackages.stdenv.cc ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) pkgsBuildBuild.guile_1_8; nativeBuildInputs = [ makeWrapper diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix index 18daad8005686..3e329a81cdedd 100644 --- a/pkgs/development/interpreters/guile/2.0.nix +++ b/pkgs/development/interpreters/guile/2.0.nix @@ -37,7 +37,7 @@ builder rec { depsBuildBuild = [ buildPackages.stdenv.cc ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) pkgsBuildBuild.guile_2_0; nativeBuildInputs = [ diff --git a/pkgs/development/interpreters/guile/2.2.nix b/pkgs/development/interpreters/guile/2.2.nix index 918735517ea34..551c10fcfe6b3 100644 --- a/pkgs/development/interpreters/guile/2.2.nix +++ b/pkgs/development/interpreters/guile/2.2.nix @@ -37,7 +37,7 @@ builder rec { depsBuildBuild = [ buildPackages.stdenv.cc ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) pkgsBuildBuild.guile_2_2; nativeBuildInputs = [ makeWrapper diff --git a/pkgs/development/interpreters/guile/3.0.nix b/pkgs/development/interpreters/guile/3.0.nix index fb788377107e1..89e5ac99c930d 100644 --- a/pkgs/development/interpreters/guile/3.0.nix +++ b/pkgs/development/interpreters/guile/3.0.nix @@ -38,7 +38,7 @@ builder rec { depsBuildBuild = [ buildPackages.stdenv.cc - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) pkgsBuildBuild.guile_3_0; nativeBuildInputs = [ makeWrapper @@ -70,7 +70,7 @@ builder rec { # https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/guile.scm?h=a39207f7afd977e4e4299c6f0bb34bcb6d153818#n405 # starting with Guile 3.0.8, parallel builds can be done # bit-reproducibly as long as we're not cross-compiling - enableParallelBuilding = stdenv.buildPlatform == stdenv.hostPlatform; + enableParallelBuilding = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); patches = [ ./eai_system.patch diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 7775fa5c84939..7c55d08724c86 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -96,7 +96,7 @@ stdenv.mkDerivation (finalAttrs: makeFlagsArray+=(CFLAGS='-O2 -fPIC${lib.optionalString compat compatFlags} $(${ if lib.versionAtLeast luaversion "5.2" then "SYSCFLAGS" else "MYCFLAGS"})' ) - makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"}) + makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"}) installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \ TO_LIB="${if stdenv.isDarwin then "liblua.${finalAttrs.version}.dylib" diff --git a/pkgs/development/interpreters/ngn-k/default.nix b/pkgs/development/interpreters/ngn-k/default.nix index 76ff50b64b9ea..cba8622a60ab3 100644 --- a/pkgs/development/interpreters/ngn-k/default.nix +++ b/pkgs/development/interpreters/ngn-k/default.nix @@ -3,7 +3,7 @@ , stdenvNoLibs , fetchFromGitea , runtimeShell -, doCheck ? withLibc && stdenv.hostPlatform == stdenv.buildPlatform +, doCheck ? withLibc && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , withLibc ? true }: diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index 76a51dc8cb3ee..7b1097d1db014 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -1,4 +1,4 @@ -{ callPackage }: +{ callPackage, lib }: let # Common passthru for all perl interpreters. @@ -22,7 +22,7 @@ let # allow 'perlPackages.override { pkgs = pkgs // { imagemagick = imagemagickBig; }; }' like in python3Packages # most perl packages aren't called with callPackage so it's not possible to override their arguments individually # the conditional is because the // above won't be applied to __splicedPackages and hopefully no one is doing that when cross-compiling - pkgs = if stdenv.buildPlatform != stdenv.hostPlatform then pkgs.__splicedPackages else pkgs; + pkgs = if (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then pkgs.__splicedPackages else pkgs; inherit stdenv; perl = self; }; diff --git a/pkgs/development/interpreters/perl/interpreter.nix b/pkgs/development/interpreters/perl/interpreter.nix index fb835b22f1de9..bf334949e1208 100644 --- a/pkgs/development/interpreters/perl/interpreter.nix +++ b/pkgs/development/interpreters/perl/interpreter.nix @@ -28,7 +28,7 @@ assert (enableCrypt -> (libxcrypt != null)); let - crossCompiling = stdenv.buildPlatform != stdenv.hostPlatform; + crossCompiling = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); libc = if stdenv.cc.libc or null != null then stdenv.cc.libc else "/usr"; libcInc = lib.getDev libc; libcLib = lib.getLib libc; @@ -235,7 +235,7 @@ stdenv.mkDerivation (rec { priority = 6; # in `buildEnv' (including the one inside `perl.withPackages') the library files will have priority over files in `perl` mainProgram = "perl"; }; -} // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) rec { +} // lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) rec { crossVersion = "84db4c71ae3d3b01fb2966cd15a060a7be334710"; # Nov 29, 2023 perl-cross-src = fetchFromGitHub { diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index af9bbc47475b9..8b873d24267ee 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -58,7 +58,7 @@ let buildPackages = pkgsBuildHost; inherit (passthru) pythonOnBuildForHost; - pythonOnBuildForHostInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then + pythonOnBuildForHostInterpreter = if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then "$out/bin/python" else pythonOnBuildForHost.interpreter; @@ -175,7 +175,7 @@ let # only works for GCC and Apple Clang. This makes distutils to call C++ # compiler when needed. ./python-2.7-distutils-C++.patch - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ ./cross-compile.patch ]; @@ -207,7 +207,7 @@ let "ac_cv_func_bind_textdomain_codeset=yes" ] ++ lib.optionals stdenv.isDarwin [ "--disable-toolbox-glue" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "PYTHON_FOR_BUILD=${lib.getBin buildPackages.python}/bin/python" "ac_cv_buggy_getaddrinfo=no" # Assume little-endian IEEE 754 floating point when cross compiling @@ -243,7 +243,7 @@ let ++ lib.optional (stdenv.isDarwin && configd != null) configd; nativeBuildInputs = [ autoreconfHook ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ buildPackages.stdenv.cc buildPackages.python ]; mkPaths = paths: { @@ -252,7 +252,7 @@ let }; # Python 2.7 needs this - crossCompileEnv = lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) + crossCompileEnv = lib.optionalAttrs (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) { _PYTHON_HOST_PLATFORM = stdenv.hostPlatform.config; }; # Build the basic Python interpreter without modules that have diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index ba97b030524ad..637e8b78def99 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -156,7 +156,7 @@ let autoconf-archive # needed for AX_CHECK_COMPILE_FLAG autoreconfHook pkg-config - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ buildPackages.stdenv.cc pythonOnBuildForHost ] ++ optionals (stdenv.cc.isClang && (!stdenv.hostPlatform.useAndroidPrebuilt or false) && (enableLTO || enableOptimizations)) [ @@ -198,7 +198,7 @@ let hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false); - pythonOnBuildForHostInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then + pythonOnBuildForHostInterpreter = if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then "$out/bin/python" else pythonOnBuildForHost.interpreter; @@ -422,7 +422,7 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { ] ++ optionals (libxcrypt != null) [ "CFLAGS=-I${libxcrypt}/include" "LIBS=-L${libxcrypt}/lib" - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_buggy_getaddrinfo=no" # Assume little-endian IEEE 754 floating point when cross compiling "ac_cv_little_endian_double=yes" @@ -596,7 +596,7 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { linkDLLsInfolder $out/lib/python*/lib-dynload/ ''; - preFixup = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preFixup = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # Ensure patch-shebangs uses shebangs of host interpreter. export PATH=${lib.makeBinPath [ "$out" ]}:$PATH ''; @@ -613,7 +613,7 @@ in with passthru; stdenv.mkDerivation (finalAttrs: { # explicitly specify in our configure flags above. disallowedReferences = lib.optionals (openssl != null && !static && !enableFramework) [ openssl.dev - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # Ensure we don't have references to build-time packages. # These typically end up in shebangs. pythonOnBuildForHost buildPackages.bash diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index 4c45d9603be82..3a48b2dd1c248 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -284,7 +284,7 @@ let } else pypaInstallHook - )] ++ optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + )] ++ optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ # This is a test, however, it should be ran independent of the checkPhase and checkInputs pythonImportsCheckHook ] ++ optionals (python.pythonAtLeast "3.3") [ diff --git a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix index 1a6f9c784cf67..cc1a538d58f08 100644 --- a/pkgs/development/interpreters/python/python2/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/python2/mk-python-derivation.nix @@ -187,7 +187,7 @@ let eggUnpackHook eggBuildHook eggInstallHook ] ++ lib.optionals (format != "other") [( pipInstallHook - )] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + )] ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ # This is a test, however, it should be ran independent of the checkPhase and checkInputs pythonImportsCheckHook ] ++ lib.optionals withDistOutput [ diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index 2cd29ca990321..d7fea86915bf8 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -192,4 +192,4 @@ let ''; }; -in lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests // overrideTests // condaTests) +in lib.optionalAttrs (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) (environmentTests // integrationTests // overrideTests // condaTests) diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix index a9e5e5a048429..9c88fe486e16e 100644 --- a/pkgs/development/interpreters/ruby/default.nix +++ b/pkgs/development/interpreters/ruby/default.nix @@ -56,7 +56,7 @@ let docSupport = false; rubygemsSupport = false; } - , useBaseRuby ? stdenv.hostPlatform != stdenv.buildPlatform + , useBaseRuby ? (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) }: stdenv.mkDerivation ( finalAttrs: { pname = "ruby"; diff --git a/pkgs/development/interpreters/s9fes/default.nix b/pkgs/development/interpreters/s9fes/default.nix index 4107b28e1cf9f..18802e9bce9f2 100644 --- a/pkgs/development/interpreters/s9fes/default.nix +++ b/pkgs/development/interpreters/s9fes/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, fetchurl, ncurses, buildPackages }: let - isCrossCompiling = stdenv.hostPlatform != stdenv.buildPlatform; + isCrossCompiling = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/apr-util/default.nix b/pkgs/development/libraries/apr-util/default.nix index 68205d83a42d1..41c73baae3a60 100644 --- a/pkgs/development/libraries/apr-util/default.nix +++ b/pkgs/development/libraries/apr-util/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation rec { # For some reason, db version 6.9 is selected when cross-compiling. # It's unclear as to why, it requires someone with more autotools / configure knowledge to go deeper into that. # Always replacing the link flag with a generic link flag seems to help though, so let's do that for now. - lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace Makefile \ --replace "-ldb-6.9" "-ldb" substituteInPlace apu-1-config \ diff --git a/pkgs/development/libraries/apr/default.nix b/pkgs/development/libraries/apr/default.nix index 11bdd53945d06..33b1c7ff19dd9 100644 --- a/pkgs/development/libraries/apr/default.nix +++ b/pkgs/development/libraries/apr/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { configureFlagsArray+=("--with-installbuilddir=$dev/share/build") ''; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # For cross builds, provide answers to the configure time tests. # These answers are valid on x86_64-linux and aarch64-linux. "ac_cv_file__dev_zero=yes" diff --git a/pkgs/development/libraries/aubio/default.nix b/pkgs/development/libraries/aubio/default.nix index 6702eb91c9b17..39d7488bf5977 100644 --- a/pkgs/development/libraries/aubio/default.nix +++ b/pkgs/development/libraries/aubio/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ alsa-lib fftw libjack2 libsamplerate libsndfile ]; strictDeps = true; - wafFlags = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--disable-tests"; + wafFlags = lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "--disable-tests"; postPatch = '' # U was removed in python 3.11 because it had no effect diff --git a/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix b/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix index 198d94dbee7eb..d3a772729b88a 100644 --- a/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix +++ b/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { makeFlags = [ "AR:=$(AR)" "RANLIB:=$(RANLIB)" - ] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-o test"; + ] ++ lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "-o test"; meta = with lib; { description = "Audio processing plugin system for plugins that extract descriptive information from audio data"; diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix index 368bdeef9fcb0..aa578e3d02919 100644 --- a/pkgs/development/libraries/aws-sdk-cpp/default.nix +++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix @@ -82,7 +82,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_DEPS=OFF" ] ++ lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0" - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-DENABLE_TESTING=OFF" "-DCURL_HAS_H2=1" "-DCURL_HAS_TLS_PROXY=1" diff --git a/pkgs/development/libraries/bencodetools/default.nix b/pkgs/development/libraries/bencodetools/default.nix index 0a9694367340d..ca132bc042269 100644 --- a/pkgs/development/libraries/bencodetools/default.nix +++ b/pkgs/development/libraries/bencodetools/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { ]; # installCheck instead of check due to -install_name'd library on Darwin - doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doInstallCheck = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); installCheckTarget = "check"; meta = with lib; { diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index 3db9b77bf05d5..61133beacc41e 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -13,7 +13,7 @@ , enableStatic ? !enableShared , enablePython ? false , enableNumpy ? false -, enableIcu ? stdenv.hostPlatform == stdenv.buildPlatform +, enableIcu ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic)) , patches ? [] , boostBuildPatches ? [] @@ -50,7 +50,7 @@ let # To avoid library name collisions layout = if taggedLayout then "tagged" else "system"; - needUserConfig = stdenv.hostPlatform != stdenv.buildPlatform || useMpi || (stdenv.isDarwin && enableShared); + needUserConfig = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) || useMpi || (stdenv.isDarwin && enableShared); b2Args = lib.concatStringsSep " " ([ "--includedir=$dev/include" @@ -187,7 +187,7 @@ stdenv.mkDerivation { # uniform way for clang and gcc (which works thanks to our cc-wrapper). # We pass toolset later which will make b2 invoke everything in the right # way -- the other toolset in user-config.jam will be ignored. - + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' cat << EOF >> user-config.jam using gcc : cross : ${stdenv.cc.targetPrefix}c++ : $AR diff --git a/pkgs/development/libraries/boringssl/default.nix b/pkgs/development/libraries/boringssl/default.nix index 9bb0967bd5c6e..920e1ab772f60 100644 --- a/pkgs/development/libraries/boringssl/default.nix +++ b/pkgs/development/libraries/boringssl/default.nix @@ -27,7 +27,7 @@ buildGoModule { # (if we use postConfigure then cmake will loop runHook postConfigure) preBuild = '' cmakeConfigurePhase - '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' export GOARCH=$(go env GOHOSTARCH) ''; diff --git a/pkgs/development/libraries/check/default.nix b/pkgs/development/libraries/check/default.nix index 14b4e549264b0..fd62cb0743238 100644 --- a/pkgs/development/libraries/check/default.nix +++ b/pkgs/development/libraries/check/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { }; # fortify breaks the libcompat vsnprintf implementation - hardeningDisable = lib.optionals (stdenv.hostPlatform.isMusl && (stdenv.hostPlatform != stdenv.buildPlatform)) [ "fortify" ]; + hardeningDisable = lib.optionals (stdenv.hostPlatform.isMusl && (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)) [ "fortify" ]; # Test can randomly fail: https://hydra.nixos.org/build/7243912 doCheck = false; diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix index d6049d2845137..2f0c0954ac0d9 100644 --- a/pkgs/development/libraries/clucene-core/2.x.nix +++ b/pkgs/development/libraries/clucene-core/2.x.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { "-DBUILD_CONTRIBS=ON" "-DBUILD_CONTRIBS_LIB=ON" "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "-D_CL_HAVE_GCC_ATOMIC_FUNCTIONS=0" "-D_CL_HAVE_NAMESPACES_EXITCODE=0" "-D_CL_HAVE_NAMESPACES_EXITCODE__TRYRUN_OUTPUT=" diff --git a/pkgs/development/libraries/cracklib/default.nix b/pkgs/development/libraries/cracklib/default.nix index 44c615b38abcf..98c2d081e8173 100644 --- a/pkgs/development/libraries/cracklib/default.nix +++ b/pkgs/development/libraries/cracklib/default.nix @@ -15,10 +15,10 @@ stdenv.mkDerivation rec { hash = "sha256-yosEmjwtOyIloejRXWE3mOvHSOOVA4jtomlN5Qe6YCA="; }; - nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib; + nativeBuildInputs = lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) buildPackages.cracklib; buildInputs = [ zlib gettext ]; - postPatch = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postPatch = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' chmod +x util/cracklib-format patchShebangs util diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix index b2946872fbbd6..3143d8975b932 100644 --- a/pkgs/development/libraries/dbus-glib/default.nix +++ b/pkgs/development/libraries/dbus-glib/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ dbus glib ]; configureFlags = [ "--exec-prefix=${placeholder "dev"}" ] ++ - lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) + lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "--with-dbus-binding-tool=${buildPackages.dbus-glib.dev}/bin/dbus-binding-tool"; doCheck = false; diff --git a/pkgs/development/libraries/drogon/default.nix b/pkgs/development/libraries/drogon/default.nix index 1710d6046e338..8c7c836128c0c 100644 --- a/pkgs/development/libraries/drogon/default.nix +++ b/pkgs/development/libraries/drogon/default.nix @@ -55,7 +55,7 @@ stdenv.mkDerivation (finalAttrs: { # this excludes you, pkgsStatic (cmake wants to run built binaries # in the buildPhase) - doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doInstallCheck = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); meta = with lib; { homepage = "https://github.com/drogonframework/drogon"; diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 7496cb4de0e76..998e5f1107324 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -37,7 +37,7 @@ , withAom ? withFullDeps # AV1 reference encoder , withAppKit ? withHeadlessDeps && stdenv.isDarwin # Apple AppKit framework , withAribcaption ? withFullDeps && lib.versionAtLeast version "6.1" # ARIB STD-B24 Caption Decoder/Renderer -, withAss ? withHeadlessDeps && stdenv.hostPlatform == stdenv.buildPlatform # (Advanced) SubStation Alpha subtitle rendering +, withAss ? withHeadlessDeps && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) # (Advanced) SubStation Alpha subtitle rendering , withAudioToolbox ? withHeadlessDeps && stdenv.isDarwin # Apple AudioToolbox , withAvFoundation ? withHeadlessDeps && stdenv.isDarwin # Apple AVFoundation framework , withAvisynth ? withFullDeps # AviSynth script files reading @@ -116,7 +116,7 @@ , withVoAmrwbenc ? withFullDeps && withVersion3 # AMR-WB encoder , withVorbis ? withHeadlessDeps # Vorbis de/encoding, native encoder exists , withVpl ? false # Hardware acceleration via intel libvpl -, withVpx ? withHeadlessDeps && stdenv.buildPlatform == stdenv.hostPlatform # VP8 & VP9 de/encoding +, withVpx ? withHeadlessDeps && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) # VP8 & VP9 de/encoding , withVulkan ? withSmallDeps && !stdenv.isDarwin , withWebp ? withFullDeps # WebP encoder , withX264 ? withHeadlessDeps && withGPL # H.264/AVC encoder @@ -682,7 +682,7 @@ stdenv.mkDerivation (finalAttrs: { (enableFeature withOptimisations "optimizations") (enableFeature withExtraWarnings "extra-warnings") (enableFeature withStripping "stripping") - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--cross-prefix=${stdenv.cc.targetPrefix}" "--enable-cross-compile" "--host-cc=${buildPackages.stdenv.cc}/bin/cc" @@ -697,7 +697,7 @@ stdenv.mkDerivation (finalAttrs: { # such references except for data. postConfigure = let toStrip = map placeholder (lib.remove "data" finalAttrs.outputs) # We want to keep references to the data dir. - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.stdenv.cc; + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) buildPackages.stdenv.cc; in "remove-references-to ${lib.concatStringsSep " " (map (o: "-t ${o}") toStrip)} config.h"; @@ -803,7 +803,7 @@ stdenv.mkDerivation (finalAttrs: { buildFlags = [ "all" ] ++ optional buildQtFaststart "tools/qt-faststart"; # Build qt-faststart executable - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # Fails with SIGABRT otherwise FIXME: Why? checkPhase = let diff --git a/pkgs/development/libraries/flatbuffers/default.nix b/pkgs/development/libraries/flatbuffers/default.nix index 747a976f4c9e3..b7f5e9d9eb4ee 100644 --- a/pkgs/development/libraries/flatbuffers/default.nix +++ b/pkgs/development/libraries/flatbuffers/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { "-DFLATBUFFERS_OSX_BUILD_UNIVERSAL=OFF" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); checkTarget = "test"; meta = with lib; { diff --git a/pkgs/development/libraries/fltk/common.nix b/pkgs/development/libraries/fltk/common.nix index d17cc9bd2ae5d..8c09710cd13af 100644 --- a/pkgs/development/libraries/fltk/common.nix +++ b/pkgs/development/libraries/fltk/common.nix @@ -37,7 +37,7 @@ , doxygen , graphviz -, withExamples ? (stdenv.buildPlatform == stdenv.hostPlatform) +, withExamples ? (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) , withShared ? true }: diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix index 569c2716f0e53..4545cb7c5422a 100644 --- a/pkgs/development/libraries/fontconfig/default.nix +++ b/pkgs/development/libraries/fontconfig/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: { "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/ # just <1MB; this is what you get when loading config fails for some reason "--with-default-fonts=${dejavu_fonts.minimal}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}" ]; diff --git a/pkgs/development/libraries/gamin/default.nix b/pkgs/development/libraries/gamin/default.nix index e2d32fd645278..1f482b68c2609 100644 --- a/pkgs/development/libraries/gamin/default.nix +++ b/pkgs/development/libraries/gamin/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { name = "fix-pthread-mutex.patch"; url = "https://git.alpinelinux.org/aports/plain/main/gamin/fix-pthread-mutex.patch?h=3.4-stable&id=a1a836b089573752c1b0da7d144c0948b04e8ea8"; sha256 = "13igdbqsxb3sz0h417k6ifmq2n4siwqspj6slhc7fdl5wd1fxmdz"; - }) ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./abstract-socket-namespace.patch; + }) ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) ./abstract-socket-namespace.patch; meta = with lib; { diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index 9260f8fc1e2c3..0be336ec20eda 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" "man" ] ++ lib.optional withIntrospection "devdoc" - ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests"; + ++ lib.optional (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "installedTests"; src = let inherit (finalAttrs) pname version; diff --git a/pkgs/development/libraries/geoip/default.nix b/pkgs/development/libraries/geoip/default.nix index cdb1a0a43e81b..7d3990d3b1ce3 100644 --- a/pkgs/development/libraries/geoip/default.nix +++ b/pkgs/development/libraries/geoip/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; # Cross compilation shenanigans - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" ]; diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 7a0d7a3ee667b..9c9c2b1863dcb 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--disable-csharp" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # On cross building, gettext supposes that the wchar.h from libc # does not fulfill gettext needs, so it tries to work with its # own wchar.h file, which does not cope well with the system's diff --git a/pkgs/development/libraries/glew/1.10.nix b/pkgs/development/libraries/glew/1.10.nix index 7d8e0689c95ec..671c1345b5556 100644 --- a/pkgs/development/libraries/glew/1.10.nix +++ b/pkgs/development/libraries/glew/1.10.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation (finalAttrs: { patchPhase = '' sed -i 's|lib64|lib|' config/Makefile.linux - ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + ${lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile ''} ''; diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 25a83b1dc6d21..8687dd4efc0aa 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -132,7 +132,7 @@ stdenv.mkDerivation ({ '' # FIXME: find a solution for infinite recursion in cross builds. # For now it's hopefully acceptable that IDN from libc doesn't reliably work. - + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + + lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # Ensure that libidn2 is found. patch -p 1 < config.cache << "EOF" diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 96a08178637df..4d7547d8f7837 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -58,7 +58,7 @@ in # Fix -Werror build failure when building glibc with musl with GCC >= 8, see: # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798 (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias") - (lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [ + (lib.optionals ((!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [ # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'" # New warning as of GCC 9 # Same for musl: https://github.com/NixOS/nixpkgs/issues/78805 diff --git a/pkgs/development/libraries/gmime/2.nix b/pkgs/development/libraries/gmime/2.nix index 6f48f6ed3af44..03d2f2dc0a541 100644 --- a/pkgs/development/libraries/gmime/2.nix +++ b/pkgs/development/libraries/gmime/2.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ glib zlib libgpg-error ]; configureFlags = [ "--enable-introspection=yes" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; postPatch = '' substituteInPlace tests/testsuite.c \ @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { --replace /bin/mkdir mkdir ''; - preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + preConfigure = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' cp ${if stdenv.hostPlatform.isMusl then ./musl-iconv-detect.h else ./iconv-detect.h} ./iconv-detect.h ''; diff --git a/pkgs/development/libraries/gmime/3.nix b/pkgs/development/libraries/gmime/3.nix index 25d6c85aa328d..622c00add7b2f 100644 --- a/pkgs/development/libraries/gmime/3.nix +++ b/pkgs/development/libraries/gmime/3.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { "--enable-introspection=yes" "--enable-vala=yes" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ac_cv_have_iconv_detect_h=yes" ]; postPatch = '' @@ -64,7 +64,7 @@ stdenv.mkDerivation rec { PKG_CONFIG_VAPIGEN_VAPIGEN="$(type -p vapigen)" export PKG_CONFIG_VAPIGEN_VAPIGEN '' - + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' cp ${ if stdenv.hostPlatform.isMusl then ./musl-iconv-detect.h else ./iconv-detect.h } ./iconv-detect.h diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix index 48e027f5246bb..389eb9a6b60c3 100644 --- a/pkgs/development/libraries/gnutls/default.nix +++ b/pkgs/development/libraries/gnutls/default.nix @@ -53,7 +53,7 @@ let # XXX: Gnulib's `test-select' fails on FreeBSD: # https://hydra.nixos.org/build/2962084/nixlog/1/raw . doCheck = !stdenv.isFreeBSD && !stdenv.isDarwin - && stdenv.buildPlatform == stdenv.hostPlatform; + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); inherit (stdenv.hostPlatform) isDarwin; in diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix index 9aba5156bef28..fe56f51787d65 100644 --- a/pkgs/development/libraries/gobject-introspection/default.nix +++ b/pkgs/development/libraries/gobject-introspection/default.nix @@ -84,7 +84,7 @@ stdenv.mkDerivation (finalAttrs: { (buildPackages.python3.withPackages pythonModules) finalAttrs.setupHook # move .gir files # can't use canExecute, we need prebuilt when cross - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ gobject-introspection-unwrapped ]; + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ gobject-introspection-unwrapped ]; buildInputs = [ (python3.withPackages pythonModules) @@ -102,7 +102,7 @@ stdenv.mkDerivation (finalAttrs: { mesonFlags = [ "--datadir=${placeholder "dev"}/share" "-Dcairo=disabled" - "-Dgtk_doc=${lib.boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}" + "-Dgtk_doc=${lib.boolToString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)}" ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ "-Dgi_cross_ldd_wrapper=${substituteAll { name = "g-ir-scanner-lddwrapper"; @@ -113,7 +113,7 @@ stdenv.mkDerivation (finalAttrs: { }}" "-Dgi_cross_binary_wrapper=${stdenv.hostPlatform.emulator buildPackages}" # can't use canExecute, we need prebuilt when cross - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-Dgi_cross_use_prebuilt_gi=true" ]; @@ -125,7 +125,7 @@ stdenv.mkDerivation (finalAttrs: { patchShebangs tools/* ''; - postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postInstall = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' cp -r ${buildPackages.gobject-introspection-unwrapped.devdoc} $devdoc # these are uncompiled c and header files which aren't installed when cross-compiling because # code that installs them is in tests/meson.build which is only run when not cross-compiling diff --git a/pkgs/development/libraries/graphene/default.nix b/pkgs/development/libraries/graphene/default.nix index 3e81f031a851c..c5ae0a64bb2d8 100644 --- a/pkgs/development/libraries/graphene/default.nix +++ b/pkgs/development/libraries/graphene/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" ] ++ lib.optionals withDocumentation [ "devdoc" ] - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "installedTests" ]; + ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "installedTests" ]; src = fetchFromGitHub { owner = "ebassi"; diff --git a/pkgs/development/libraries/grpc/default.nix b/pkgs/development/libraries/grpc/default.nix index 2110755a17197..6f338c8306a76 100644 --- a/pkgs/development/libraries/grpc/default.nix +++ b/pkgs/development/libraries/grpc/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ cmake pkg-config ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) grpc; + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) grpc; propagatedBuildInputs = [ c-ares re2 zlib abseil-cpp ]; buildInputs = [ openssl protobuf ] ++ lib.optionals stdenv.isLinux [ libnsl ]; @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { "-DgRPC_PROTOBUF_PROVIDER=package" "-DgRPC_ABSL_PROVIDER=package" "-DBUILD_SHARED_LIBS=ON" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" "-D_gRPC_CPP_PLUGIN=${buildPackages.grpc}/bin/grpc_cpp_plugin" ] @@ -85,7 +85,7 @@ stdenv.mkDerivation rec { # LD_LIBRARY_PATH to enable this. When cross compiling we need to avoid this, # since it can cause the grpc_cpp_plugin executable from buildPackages to # crash if build and host architecture are compatible (e. g. pkgsLLVM). - preBuild = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + preBuild = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH ''; diff --git a/pkgs/development/libraries/gssdp/default.nix b/pkgs/development/libraries/gssdp/default.nix index 939fb0e7b4266..1d32961149c88 100644 --- a/pkgs/development/libraries/gssdp/default.nix +++ b/pkgs/development/libraries/gssdp/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { version = "1.4.1"; outputs = [ "out" "dev" ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/gssdp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -51,14 +51,14 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" + "-Dgtk_doc=${lib.boolToString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)}" "-Dsniffer=false" ]; # Bail out! GLib-GIO-FATAL-CRITICAL: g_inet_address_to_string: assertion 'G_IS_INET_ADDRESS (address)' failed doCheck = !stdenv.isDarwin; - postFixup = lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) '' + postFixup = lib.optionalString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' # Move developer documentation to devdoc output. # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. find -L "$out/share/doc" -type f -regex '.*\.devhelp2?' -print0 \ diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index 91639c441b481..002ef38ebc3fc 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -106,7 +106,7 @@ # Causes every application using GstDeviceMonitor to send mDNS queries every 2 seconds , microdnsSupport ? false # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc , guiSupport ? true, directfb }: diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index f48fe22f50001..8f62f2f437620 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -40,7 +40,7 @@ , glib , testers # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , hotdoc }: @@ -117,7 +117,7 @@ stdenv.mkDerivation (finalAttrs: { # See https://github.com/GStreamer/gst-plugins-base/blob/d64a4b7a69c3462851ff4dcfa97cc6f94cd64aef/meson_options.txt#L15 for a list of choices "-Dgl_winsys=${lib.concatStringsSep "," (lib.optional enableX11 "x11" ++ lib.optional enableWayland "wayland" ++ lib.optional enableCocoa "cocoa")}" (lib.mesonEnable "doc" enableDocumentation) - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-Dtests=disabled" ] ++ lib.optional (!enableX11) "-Dx11=disabled" diff --git a/pkgs/development/libraries/gstreamer/core/default.nix b/pkgs/development/libraries/gstreamer/core/default.nix index 3136b6f886755..590c55e0f0335 100644 --- a/pkgs/development/libraries/gstreamer/core/default.nix +++ b/pkgs/development/libraries/gstreamer/core/default.nix @@ -20,7 +20,7 @@ , rustc , testers # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: stdenv.mkDerivation (finalAttrs: { diff --git a/pkgs/development/libraries/gstreamer/devtools/default.nix b/pkgs/development/libraries/gstreamer/devtools/default.nix index 44a79bb2c998d..8dc246cc85dc2 100644 --- a/pkgs/development/libraries/gstreamer/devtools/default.nix +++ b/pkgs/development/libraries/gstreamer/devtools/default.nix @@ -12,7 +12,7 @@ , gobject-introspection , json-glib # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/gstreamer/ges/default.nix b/pkgs/development/libraries/gstreamer/ges/default.nix index 79ece373b57d0..24d82aebab2d2 100644 --- a/pkgs/development/libraries/gstreamer/ges/default.nix +++ b/pkgs/development/libraries/gstreamer/ges/default.nix @@ -13,7 +13,7 @@ , gettext , gobject-introspection # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix index bd301e7b45c22..060a54ef97b0a 100644 --- a/pkgs/development/libraries/gstreamer/good/default.nix +++ b/pkgs/development/libraries/gstreamer/good/default.nix @@ -49,7 +49,7 @@ , glib , openssl # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: # MMAL is not supported on aarch64, see: diff --git a/pkgs/development/libraries/gstreamer/libav/default.nix b/pkgs/development/libraries/gstreamer/libav/default.nix index 872627009e215..d939f6641b12a 100644 --- a/pkgs/development/libraries/gstreamer/libav/default.nix +++ b/pkgs/development/libraries/gstreamer/libav/default.nix @@ -10,7 +10,7 @@ , gettext , libav # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: # Note that since gst-libav-1.6, libav is actually ffmpeg. See diff --git a/pkgs/development/libraries/gstreamer/rs/default.nix b/pkgs/development/libraries/gstreamer/rs/default.nix index d4afb8ce7618a..224b071905a29 100644 --- a/pkgs/development/libraries/gstreamer/rs/default.nix +++ b/pkgs/development/libraries/gstreamer/rs/default.nix @@ -31,7 +31,7 @@ , plugins ? null , withGtkPlugins ? true # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform && plugins == null +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && plugins == null , hotdoc }: diff --git a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix index db56d895f7876..3c158ec51506c 100644 --- a/pkgs/development/libraries/gstreamer/rtsp-server/default.nix +++ b/pkgs/development/libraries/gstreamer/rtsp-server/default.nix @@ -10,7 +10,7 @@ , gst-plugins-base , gst-plugins-bad # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/gstreamer/ugly/default.nix b/pkgs/development/libraries/gstreamer/ugly/default.nix index 0b39bad01020b..68d6edac3449b 100644 --- a/pkgs/development/libraries/gstreamer/ugly/default.nix +++ b/pkgs/development/libraries/gstreamer/ugly/default.nix @@ -20,7 +20,7 @@ , DiskArbitration , enableGplPlugins ? true # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/gstreamer/vaapi/default.nix b/pkgs/development/libraries/gstreamer/vaapi/default.nix index cdad2eaf232d9..1f46e751cb2bc 100644 --- a/pkgs/development/libraries/gstreamer/vaapi/default.nix +++ b/pkgs/development/libraries/gstreamer/vaapi/default.nix @@ -19,7 +19,7 @@ , libvpx , python3 # Checks meson.is_cross_build(), so even canExecute isn't enough. -, enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, hotdoc +, enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), hotdoc }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/gtk/2.x.nix b/pkgs/development/libraries/gtk/2.x.nix index 9d9b855c9da89..e465df6d2894f 100644 --- a/pkgs/development/libraries/gtk/2.x.nix +++ b/pkgs/development/libraries/gtk/2.x.nix @@ -104,7 +104,7 @@ stdenv.mkDerivation (finalAttrs: { "--disable-glibtest" "--disable-introspection" "--disable-visibility" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ac_cv_path_GTK_UPDATE_ICON_CACHE=${buildPackages.gtk2}/bin/gtk-update-icon-cache" "ac_cv_path_GDK_PIXBUF_CSOURCE=${buildPackages.gdk-pixbuf.dev}/bin/gdk-pixbuf-csource" ]; diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix index f194dee9c9ec8..26492f849b188 100644 --- a/pkgs/development/libraries/gtk/3.x.nix +++ b/pkgs/development/libraries/gtk/3.x.nix @@ -34,7 +34,7 @@ , gnome , gsettings-desktop-schemas , sassc -, trackerSupport ? stdenv.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform) +, trackerSupport ? stdenv.isLinux && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) , tracker , x11Support ? stdenv.isLinux , waylandSupport ? stdenv.isLinux @@ -215,7 +215,7 @@ stdenv.mkDerivation (finalAttrs: { for f in $dev/bin/gtk-encode-symbolic-svg; do wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" done - '' + lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) '' + '' + lib.optionalString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' GTK_PATH="''${out:?}/lib/gtk-3.0/3.0.0/immodules/" ''${dev:?}/bin/gtk-query-immodules-3.0 > "''${out:?}/lib/gtk-3.0/3.0.0/immodules.cache" ''; diff --git a/pkgs/development/libraries/gts/default.nix b/pkgs/development/libraries/gts/default.nix index 5aa8aca6ffb3d..7fb3f3ea81c78 100644 --- a/pkgs/development/libraries/gts/default.nix +++ b/pkgs/development/libraries/gts/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { doCheck = false; # fails with "permission denied" - preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preBuild = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' pushd src make CC=${buildPackages.stdenv.cc}/bin/cc predicates_init mv predicates_init predicates_init_build diff --git a/pkgs/development/libraries/gupnp-igd/default.nix b/pkgs/development/libraries/gupnp-igd/default.nix index 60a3bfe911170..72ed20a5f62b4 100644 --- a/pkgs/development/libraries/gupnp-igd/default.nix +++ b/pkgs/development/libraries/gupnp-igd/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { version = "1.2.0"; outputs = [ "out" "dev" ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -46,8 +46,8 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" - "-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" + "-Dgtk_doc=${lib.boolToString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)}" + "-Dintrospection=${lib.boolToString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)}" ]; # Seems to get stuck sometimes. diff --git a/pkgs/development/libraries/gupnp/default.nix b/pkgs/development/libraries/gupnp/default.nix index 08b2925b0ea3b..bd28c5d03b2ad 100644 --- a/pkgs/development/libraries/gupnp/default.nix +++ b/pkgs/development/libraries/gupnp/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { version = "1.4.4"; outputs = [ "out" "dev" ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/gupnp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -80,7 +80,7 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" + "-Dgtk_doc=${lib.boolToString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)}" ]; # Bail out! ERROR:../tests/test-bugs.c:168:test_on_timeout: code should not be reached diff --git a/pkgs/development/libraries/hamlib/default.nix b/pkgs/development/libraries/hamlib/default.nix index 9250a66c219e2..bf082e50e5e3c 100644 --- a/pkgs/development/libraries/hamlib/default.nix +++ b/pkgs/development/libraries/hamlib/default.nix @@ -15,7 +15,7 @@ , perlPackages , pythonBindings ? true , tclBindings ? true -, perlBindings ? stdenv.buildPlatform == stdenv.hostPlatform +, perlBindings ? (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) , buildPackages }: diff --git a/pkgs/development/libraries/hspell/default.nix b/pkgs/development/libraries/hspell/default.nix index 4d35bb34b91dc..fe05dfd4adaf3 100644 --- a/pkgs/development/libraries/hspell/default.nix +++ b/pkgs/development/libraries/hspell/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { patches = [./remove-shared-library-checks.patch]; postPatch = "patchShebangs ."; - preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preBuild = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' make CC=${buildPackages.stdenv.cc}/bin/cc find_sizes mv find_sizes find_sizes_build make clean diff --git a/pkgs/development/libraries/icu/make-icu.nix b/pkgs/development/libraries/icu/make-icu.nix index 3e65e80ef7c4d..d3e6dfc877e16 100644 --- a/pkgs/development/libraries/icu/make-icu.nix +++ b/pkgs/development/libraries/icu/make-icu.nix @@ -40,7 +40,7 @@ let configureFlags = [ "--disable-debug" ] ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath" - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}" + ++ lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}" ++ lib.optional withStatic "--enable-static"; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/jsoncpp/default.nix b/pkgs/development/libraries/jsoncpp/default.nix index ea530a955f75d..99b9d37c3db42 100644 --- a/pkgs/development/libraries/jsoncpp/default.nix +++ b/pkgs/development/libraries/jsoncpp/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { # comparison operators and conversion functions between # std::basic_string<..., Json::SecureAllocator> vs. # std::basic_string<..., [default allocator]> - ++ lib.optional ((stdenv.buildPlatform != stdenv.hostPlatform) || secureMemory) "-DJSONCPP_WITH_TESTS=OFF"; + ++ lib.optional ((!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) || secureMemory) "-DJSONCPP_WITH_TESTS=OFF"; meta = with lib; { homepage = "https://github.com/open-source-parsers/jsoncpp"; diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index 8dd68af4fd1d5..13d22048d9fc1 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { ++ lib.optional withLdap "--with-ldap" ++ lib.optional withVerto "--with-system-verto" ++ lib.optional stdenv.isFreeBSD ''WARN_CFLAGS='' - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "krb5_cv_attr_constructor_destructor=yes,yes" "ac_cv_func_regcomp=yes" "ac_cv_printf_positional=yes" diff --git a/pkgs/development/libraries/ldb/default.nix b/pkgs/development/libraries/ldb/default.nix index 6c5fa48affc1a..2025ad91ce65c 100644 --- a/pkgs/development/libraries/ldb/default.nix +++ b/pkgs/development/libraries/ldb/default.nix @@ -63,7 +63,7 @@ stdenv.mkDerivation (finalAttrs: { "--bundled-libraries=NONE" "--builtin-libraries=replace" "--without-ldb-lmdb" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--cross-compile" "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" ]; diff --git a/pkgs/development/libraries/ldns/default.nix b/pkgs/development/libraries/ldns/default.nix index 1e696b1175a4f..6f617b2950e1e 100644 --- a/pkgs/development/libraries/ldns/default.nix +++ b/pkgs/development/libraries/ldns/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { "--with-drill" "--disable-gost" "--with-examples" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" ]; diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix index 16a9e872aae8f..065836f7c1385 100644 --- a/pkgs/development/libraries/libaom/default.nix +++ b/pkgs/development/libraries/libaom/default.nix @@ -9,7 +9,7 @@ }: let - isCross = stdenv.buildPlatform != stdenv.hostPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); in stdenv.mkDerivation rec { pname = "libaom"; diff --git a/pkgs/development/libraries/libasyncns/default.nix b/pkgs/development/libraries/libasyncns/default.nix index 09e056373d27e..253c31cd88a98 100644 --- a/pkgs/development/libraries/libasyncns/default.nix +++ b/pkgs/development/libraries/libasyncns/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { --replace '' '' ''; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" ]; diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix index 8cc098d81087a..6b110897cb740 100644 --- a/pkgs/development/libraries/libav/default.nix +++ b/pkgs/development/libraries/libav/default.nix @@ -77,7 +77,7 @@ let (enableFeature vaapiSupport "vaapi") (enableFeature vdpauSupport "vdpau") (enableFeature freetypeSupport "libfreetype") - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--cross-prefix=${stdenv.cc.targetPrefix}" "--enable-cross-compile" ]; diff --git a/pkgs/development/libraries/libavif/default.nix b/pkgs/development/libraries/libavif/default.nix index 6df341d68eb84..da3d02686079e 100644 --- a/pkgs/development/libraries/libavif/default.nix +++ b/pkgs/development/libraries/libavif/default.nix @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { '' # Cross-compiled gdk-pixbuf doesn't support thumbnailers - + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + + lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' mkdir -p "$out/bin" makeWrapper ${gdk-pixbuf}/bin/gdk-pixbuf-thumbnailer "$out/libexec/gdk-pixbuf-thumbnailer-avif" \ --set GDK_PIXBUF_MODULE_FILE ${gdkPixbufModuleFile} diff --git a/pkgs/development/libraries/libb64/default.nix b/pkgs/development/libraries/libb64/default.nix index 3b24089e53c63..6fca62572111a 100644 --- a/pkgs/development/libraries/libb64/default.nix +++ b/pkgs/development/libraries/libb64/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { url = "https://github.com/libb64/libb64/commit/98eaf510f40e384b32c01ad4bd5c3a697fdd8560.patch"; hash = "sha256-CGslJUw0og/bBBirLm0J5Q7cf2WW/vniVAkXHlb6lbQ="; }) - ] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) (fetchpatch { + ] ++ lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) (fetchpatch { name = "0001-example-Do-not-run-the-tests.patch"; url = "https://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-support/libb64/libb64/0001-example-Do-not-run-the-tests.patch?id=484e0de1e4ee107f21ae2a5c5f976ed987978baf"; sha256 = "sha256-KTsiIWJe66BKlu/A43FWfW0XAu4E7lWX/RY4NITRrm4="; diff --git a/pkgs/development/libraries/libcbor/default.nix b/pkgs/development/libraries/libcbor/default.nix index 349f4589172a8..b11ae64b6c026 100644 --- a/pkgs/development/libraries/libcbor/default.nix +++ b/pkgs/development/libraries/libcbor/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation (finalAttrs: { # Tests are restricted while pkgsStatic.cmocka is broken. Tracked at: # https://github.com/NixOS/nixpkgs/issues/213623 doCheck = !stdenv.hostPlatform.isStatic - && stdenv.hostPlatform == stdenv.buildPlatform; + && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); nativeCheckInputs = [ cmocka ]; diff --git a/pkgs/development/libraries/libcddb/default.nix b/pkgs/development/libraries/libcddb/default.nix index 11a0c259dfdb1..cf2965c34a1de 100644 --- a/pkgs/development/libraries/libcddb/default.nix +++ b/pkgs/development/libraries/libcddb/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ libiconv ]; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" ]; diff --git a/pkgs/development/libraries/libchamplain/default.nix b/pkgs/development/libraries/libchamplain/default.nix index f49d12e639db3..cfbc365d86626 100644 --- a/pkgs/development/libraries/libchamplain/default.nix +++ b/pkgs/development/libraries/libchamplain/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { version = "0.12.21"; outputs = [ "out" "dev" ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { pkg-config gobject-introspection vala - ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + ] ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ gtk-doc docbook_xsl docbook_xml_dtd_412 @@ -57,7 +57,7 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - (lib.mesonBool "gtk_doc" (stdenv.buildPlatform == stdenv.hostPlatform)) + (lib.mesonBool "gtk_doc" (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)) "-Dvapi=true" (lib.mesonBool "libsoup3" withLibsoup3) ]; diff --git a/pkgs/development/libraries/libdaemon/default.nix b/pkgs/development/libraries/libdaemon/default.nix index 112792454c43c..d0df67295b7c8 100644 --- a/pkgs/development/libraries/libdaemon/default.nix +++ b/pkgs/development/libraries/libdaemon/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { patches = [ ./fix-includes.patch ]; configureFlags = [ "--disable-lynx" ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # Can't run this test while cross-compiling "ac_cv_func_setpgrp_void=yes" ]; diff --git a/pkgs/development/libraries/libelf/default.nix b/pkgs/development/libraries/libelf/default.nix index fdfa4fda0def4..78d9305d856fb 100644 --- a/pkgs/development/libraries/libelf/default.nix +++ b/pkgs/development/libraries/libelf/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { configureFlags = [] # Configure check for dynamic lib support is broken, see # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "mr_cv_target_elf=yes" + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "mr_cv_target_elf=yes" # Libelf's custom NLS macros fail to determine the catalog file extension # on Darwin, so disable NLS for now. ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-nls"; diff --git a/pkgs/development/libraries/libffi/3.3.nix b/pkgs/development/libraries/libffi/3.3.nix index 50bec9edd0503..d5ce614917ca4 100644 --- a/pkgs/development/libraries/libffi/3.3.nix +++ b/pkgs/development/libraries/libffi/3.3.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/} ''; - dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling. + dontStrip = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # Don't run the native `strip' when cross-compiling. inherit doCheck; diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix index 9293077b1aa73..af31543db5944 100644 --- a/pkgs/development/libraries/libffi/default.nix +++ b/pkgs/development/libraries/libffi/default.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: { NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/} ''; - dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling. + dontStrip = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # Don't run the native `strip' when cross-compiling. inherit doCheck; diff --git a/pkgs/development/libraries/libgphoto2/default.nix b/pkgs/development/libraries/libgphoto2/default.nix index c196b137555dd..dd0baacbc1cca 100644 --- a/pkgs/development/libraries/libgphoto2/default.nix +++ b/pkgs/development/libraries/libgphoto2/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { postInstall = let executablePrefix = - if stdenv.buildPlatform == stdenv.hostPlatform then + if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then "$out" else buildPackages.libgphoto2; diff --git a/pkgs/development/libraries/libgrss/default.nix b/pkgs/development/libraries/libgrss/default.nix index ce0c6e14edc28..0c151b7460857 100644 --- a/pkgs/development/libraries/libgrss/default.nix +++ b/pkgs/development/libraries/libgrss/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { configureFlags = [ "PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config" - ] ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ + ] ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "--enable-gtk-doc" ]; diff --git a/pkgs/development/libraries/libgweather/default.nix b/pkgs/development/libraries/libgweather/default.nix index 42b9272115437..e4b0e90c5b3db 100644 --- a/pkgs/development/libraries/libgweather/default.nix +++ b/pkgs/development/libraries/libgweather/default.nix @@ -16,7 +16,7 @@ , geocode-glib_2 , vala , gnome -, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform +, withIntrospection ? (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/libgxps/default.nix b/pkgs/development/libraries/libgxps/default.nix index cff74fbb47416..c3389cdfc3327 100644 --- a/pkgs/development/libraries/libgxps/default.nix +++ b/pkgs/development/libraries/libgxps/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Denable-test=false" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-Ddisable-introspection=true" ]; diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix index d3ee9581305c7..52d500483cb6f 100644 --- a/pkgs/development/libraries/libical/default.nix +++ b/pkgs/development/libraries/libical/default.nix @@ -34,7 +34,7 @@ stdenv.mkDerivation rec { strictDeps = true; - depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + depsBuildBuild = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # provides ical-glib-src-generator that runs during build libical ]; @@ -71,7 +71,7 @@ stdenv.mkDerivation rec { "-DENABLE_GTK_DOC=False" "-DGOBJECT_INTROSPECTION=${if withIntrospection then "True" else "False"}" "-DICAL_GLIB_VAPI=${if withIntrospection then "True" else "False"}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev pkgsBuildBuild.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake" ]; diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix index b59887381f49e..f71b1502a2f4b 100644 --- a/pkgs/development/libraries/libiconv/default.nix +++ b/pkgs/development/libraries/libiconv/default.nix @@ -4,7 +4,7 @@ , enableDarwinABICompat ? false }: -# assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross +# assert !stdenv.hostPlatform.isLinux || (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # TODO: improve on cross stdenv.mkDerivation rec { pname = "libiconv"; diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index f0005969bbcfc..a49d45c180c5a 100644 --- a/pkgs/development/libraries/libinput/default.nix +++ b/pkgs/development/libraries/libinput/default.nix @@ -105,7 +105,7 @@ stdenv.mkDerivation rec { "--libexecdir=${placeholder "bin"}/libexec" ]; - doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = testsSupport && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); postPatch = '' patchShebangs \ diff --git a/pkgs/development/libraries/liblouis/default.nix b/pkgs/development/libraries/liblouis/default.nix index 8d2a4044458e5..0505ebac0b27d 100644 --- a/pkgs/development/libraries/liblouis/default.nix +++ b/pkgs/development/libraries/liblouis/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation (finalAttrs: { outputs = [ "out" "dev" "info" "doc" ] # configure: WARNING: cannot generate manual pages while cross compiling - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "man" ]; + ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "man" ]; src = fetchFromGitHub { owner = "liblouis"; diff --git a/pkgs/development/libraries/libmbim/default.nix b/pkgs/development/libraries/libmbim/default.nix index ee4acc094e668..671847d44ee70 100644 --- a/pkgs/development/libraries/libmbim/default.nix +++ b/pkgs/development/libraries/libmbim/default.nix @@ -11,7 +11,7 @@ , bash , buildPackages , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages -, withDocs ? stdenv.hostPlatform == stdenv.buildPlatform +, withDocs ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , gobject-introspection }: diff --git a/pkgs/development/libraries/libmcrypt/default.nix b/pkgs/development/libraries/libmcrypt/default.nix index 672ba730be12b..a3fcce2548b10 100644 --- a/pkgs/development/libraries/libmcrypt/default.nix +++ b/pkgs/development/libraries/libmcrypt/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { buildInputs = lib.optional stdenv.isDarwin darwin.cctools; configureFlags = lib.optionals disablePosixThreads [ "--disable-posix-threads" ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # AC_FUNC_MALLOC is broken on cross builds. "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" diff --git a/pkgs/development/libraries/libndp/default.nix b/pkgs/development/libraries/libndp/default.nix index 436045da89fb2..77164db1ea9c2 100644 --- a/pkgs/development/libraries/libndp/default.nix +++ b/pkgs/development/libraries/libndp/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ]; diff --git a/pkgs/development/libraries/libnice/default.nix b/pkgs/development/libraries/libnice/default.nix index 72419deaccb5a..da2ebdfa42cef 100644 --- a/pkgs/development/libraries/libnice/default.nix +++ b/pkgs/development/libraries/libnice/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { version = "0.1.22"; outputs = [ "bin" "out" "dev" ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ]; + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "devdoc" ]; src = fetchurl { url = "https://libnice.freedesktop.org/releases/${pname}-${version}.tar.gz"; @@ -64,8 +64,8 @@ stdenv.mkDerivation rec { ]; mesonFlags = [ - "-Dgtk_doc=${if (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}" - "-Dintrospection=${if (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}" + "-Dgtk_doc=${if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then "enabled" else "disabled"}" + "-Dintrospection=${if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then "enabled" else "disabled"}" "-Dexamples=disabled" # requires many dependencies and probably not useful for our users ]; diff --git a/pkgs/development/libraries/libomxil-bellagio/default.nix b/pkgs/development/libraries/libomxil-bellagio/default.nix index 78f37bbbb67dd..cc59b6a329d42 100644 --- a/pkgs/development/libraries/libomxil-bellagio/default.nix +++ b/pkgs/development/libraries/libomxil-bellagio/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { }; configureFlags = - lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ]; + lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ]; patches = [ ./fedora-fixes.patch diff --git a/pkgs/development/libraries/libosinfo/default.nix b/pkgs/development/libraries/libosinfo/default.nix index 498f26a7caf09..f0cbd5363c367 100644 --- a/pkgs/development/libraries/libosinfo/default.nix +++ b/pkgs/development/libraries/libosinfo/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { }; outputs = [ "out" "dev" ] - ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc"; + ++ lib.optional (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "devdoc"; nativeBuildInputs = [ pkg-config diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix index 7256e49226057..a88939dfc4fe3 100644 --- a/pkgs/development/libraries/libpcap/default.nix +++ b/pkgs/development/libraries/libpcap/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { "--disable-universal" ] ++ lib.optionals withRemote [ "--enable-remote" - ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) + ] ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_linux_vers=2" ]; postInstall = '' diff --git a/pkgs/development/libraries/libpng/12.nix b/pkgs/development/libraries/libpng/12.nix index 9792447bcc888..e0721a55d1ba3 100644 --- a/pkgs/development/libraries/libpng/12.nix +++ b/pkgs/development/libraries/libpng/12.nix @@ -2,7 +2,7 @@ , testers }: -assert stdenv.hostPlatform == stdenv.buildPlatform -> zlib != null; +assert (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) -> zlib != null; stdenv.mkDerivation (finalAttrs: { pname = "libpng"; diff --git a/pkgs/development/libraries/librest/default.nix b/pkgs/development/libraries/librest/default.nix index de0ff52f1e1bf..60137e87f54b2 100644 --- a/pkgs/development/libraries/librest/default.nix +++ b/pkgs/development/libraries/librest/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config gobject-introspection - ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + ] ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ gtk-doc docbook-xsl-nons docbook_xml_dtd_412 @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { ]; configureFlags = [ - (lib.enableFeature (stdenv.hostPlatform == stdenv.buildPlatform) "gtk-doc") + (lib.enableFeature (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "gtk-doc") # Remove when https://gitlab.gnome.org/GNOME/librest/merge_requests/2 is merged. "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt" ]; diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix index e9a9eb977db3f..015b4d3789af9 100644 --- a/pkgs/development/libraries/librsvg/default.nix +++ b/pkgs/development/libraries/librsvg/default.nix @@ -105,7 +105,7 @@ stdenv.mkDerivation (finalAttrs: { "--enable-always-build-tests" ] ++ lib.optional stdenv.isDarwin "--disable-Bsymbolic" - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "RUST_TARGET=${stdenv.hostPlatform.rust.rustcTarget}"; + ++ lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "RUST_TARGET=${stdenv.hostPlatform.rust.rustcTarget}"; doCheck = false; # all tests fail on libtool-generated rsvg-convert not being able to find coreutils @@ -143,7 +143,7 @@ stdenv.mkDerivation (finalAttrs: { # 'error: linker `cc` not found' when cross-compiling export RUSTFLAGS="-Clinker=$CC" - '' + lib.optionalString ((stdenv.buildPlatform != stdenv.hostPlatform) && (stdenv.hostPlatform.emulatorAvailable buildPackages)) '' + '' + lib.optionalString ((!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && (stdenv.hostPlatform.emulatorAvailable buildPackages)) '' # the replacement is the native conditional substituteInPlace gdk-pixbuf-loader/Makefile \ --replace 'RUN_QUERY_LOADER_TEST = false' 'RUN_QUERY_LOADER_TEST = test -z "$(DESTDIR)"' \ diff --git a/pkgs/development/libraries/librsync/default.nix b/pkgs/development/libraries/librsync/default.nix index 5139c397de3a3..0f096a7ba41f9 100644 --- a/pkgs/development/libraries/librsync/default.nix +++ b/pkgs/development/libraries/librsync/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ perl zlib bzip2 popt ]; - dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; + dontStrip = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); meta = with lib; { description = "Implementation of the rsync remote-delta algorithm"; diff --git a/pkgs/development/libraries/libvirt-glib/default.nix b/pkgs/development/libraries/libvirt-glib/default.nix index b01a9a788bad7..6db0c73de2815 100644 --- a/pkgs/development/libraries/libvirt-glib/default.nix +++ b/pkgs/development/libraries/libvirt-glib/default.nix @@ -12,7 +12,7 @@ , buildPackages , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages , gobject-introspection -, withDocs ? stdenv.hostPlatform == stdenv.buildPlatform +, withDocs ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , gtk-doc , docbook-xsl-nons }: diff --git a/pkgs/development/libraries/libvisual/default.nix b/pkgs/development/libraries/libvisual/default.nix index 12fae974312be..824cfd22a4ead 100644 --- a/pkgs/development/libraries/libvisual/default.nix +++ b/pkgs/development/libraries/libvisual/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook pkg-config ]; buildInputs = [ SDL glib ]; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # Remove once "sdl-cross-prereq.patch" patch above is removed. "--disable-lv-tool" ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ diff --git a/pkgs/development/libraries/libvpx/1_8.nix b/pkgs/development/libraries/libvpx/1_8.nix index 643dcb4d8f401..d219216b94f7c 100644 --- a/pkgs/development/libraries/libvpx/1_8.nix +++ b/pkgs/development/libraries/libvpx/1_8.nix @@ -141,7 +141,7 @@ stdenv.mkDerivation rec { (enableFeature (experimentalSpatialSvcSupport || experimentalFpMbStatsSupport || experimentalEmulateHardwareSupport) "experimental") - ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--enable-external-build" # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version) # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix index dda6b13c1bf6c..e69055013344c 100644 --- a/pkgs/development/libraries/libvpx/default.nix +++ b/pkgs/development/libraries/libvpx/default.nix @@ -163,7 +163,7 @@ stdenv.mkDerivation rec { (enableFeature (experimentalSpatialSvcSupport || experimentalFpMbStatsSupport || experimentalEmulateHardwareSupport) "experimental") - ] ++ optionals (stdenv.isBSD || stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (stdenv.isBSD || (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)) [ "--force-target=${stdenv.hostPlatform.parsed.cpu.name}-${kernel}-gcc" (lib.optionalString stdenv.hostPlatform.isCygwin "--enable-static-msvcrt") ] # Experimental features diff --git a/pkgs/development/libraries/libwacom/default.nix b/pkgs/development/libraries/libwacom/default.nix index 58c9b7c7f6669..4bcfb5b9be734 100644 --- a/pkgs/development/libraries/libwacom/default.nix +++ b/pkgs/development/libraries/libwacom/default.nix @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { libgudev ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && lib.meta.availableOn stdenv.hostPlatform valgrind && !stdenv.hostPlatform.isPower # one test times out ; diff --git a/pkgs/development/libraries/libwebsockets/default.nix b/pkgs/development/libraries/libwebsockets/default.nix index af028888b23bc..ea2334c0da742 100644 --- a/pkgs/development/libraries/libwebsockets/default.nix +++ b/pkgs/development/libraries/libwebsockets/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { "-DLWS_WITH_SOCKS5=ON" "-DDISABLE_WERROR=ON" "-DLWS_BUILD_HASH=no_hash" - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON" + ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON" ++ lib.optional withExternalPoll "-DLWS_WITH_EXTERNAL_POLL=ON" ++ ( if stdenv.hostPlatform.isStatic then diff --git a/pkgs/development/libraries/libxklavier/default.nix b/pkgs/development/libraries/libxklavier/default.nix index 3fa295279f0cd..97e98e51382fa 100644 --- a/pkgs/development/libraries/libxklavier/default.nix +++ b/pkgs/development/libraries/libxklavier/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchgit, fetchpatch, autoreconfHook, pkg-config, gtk-doc, xkeyboard_config, libxml2, xorg, docbook_xsl , glib, isocodes, gobject-introspection -, withDoc ? (stdenv.buildPlatform == stdenv.hostPlatform) +, withDoc ? (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index 79fe8c9f52dac..616a26fab0139 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -84,7 +84,7 @@ stdenv.mkDerivation (finalAttrs: rec { enableParallelBuilding = true; doCheck = - (stdenv.hostPlatform == stdenv.buildPlatform) && + (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && stdenv.hostPlatform.libc != "musl"; preCheck = lib.optional stdenv.isDarwin '' export DYLD_LIBRARY_PATH="$PWD/.libs:$DYLD_LIBRARY_PATH" diff --git a/pkgs/development/libraries/minizip-ng/default.nix b/pkgs/development/libraries/minizip-ng/default.nix index baf6a4f687a43..be54110d123d4 100644 --- a/pkgs/development/libraries/minizip-ng/default.nix +++ b/pkgs/development/libraries/minizip-ng/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation (finalAttrs: { fi ''; - doCheck = stdenv.buildPlatform == stdenv.hostPlatform; + doCheck = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); nativeCheckInputs = [ gtest ]; enableParallelChecking = false; diff --git a/pkgs/development/libraries/msgpack/generic.nix b/pkgs/development/libraries/msgpack/generic.nix index a784bc0263613..ede3bb3f5bfc2 100644 --- a/pkgs/development/libraries/msgpack/generic.nix +++ b/pkgs/development/libraries/msgpack/generic.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; - cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DMSGPACK_BUILD_EXAMPLES=OFF"; + cmakeFlags = lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "-DMSGPACK_BUILD_EXAMPLES=OFF"; meta = with lib; { description = "MessagePack implementation for C and C++"; diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 85bf4bee634e0..a5edb632c1212 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { "/usr/share/terminfo" # upstream default, probably all FHS-based distros "/run/current-system/sw/share/terminfo" # NixOS ]}" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "--with-build-cc=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" ] ++ (lib.optionals (stdenv.cc.bintools.isLLVM && lib.versionAtLeast stdenv.cc.bintools.version "17") [ # lld17+ passes `--no-undefined-version` by default and makes this a hard @@ -71,7 +71,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook pkg-config - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ # for `tic`, build already depends on for build `cc` so it's weird the build doesn't just build `tic`. ncurses ]; diff --git a/pkgs/development/libraries/newt/default.nix b/pkgs/development/libraries/newt/default.nix index 1e6f8de2d5890..db9cfb24826a8 100644 --- a/pkgs/development/libraries/newt/default.nix +++ b/pkgs/development/libraries/newt/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { "--disable-nls" ]; - makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + makeFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix index 339db2bb08792..b542b25474a88 100644 --- a/pkgs/development/libraries/nlohmann_json/default.nix +++ b/pkgs/development/libraries/nlohmann_json/default.nix @@ -29,7 +29,7 @@ in stdenv.mkDerivation (finalAttrs: { "-DJSON_MultipleHeaders=ON" ] ++ lib.optional finalAttrs.finalPackage.doCheck "-DJSON_TestDataDirectory=${testData}"; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # skip tests that require git or modify “installed files” preCheck = '' diff --git a/pkgs/development/libraries/nss/generic.nix b/pkgs/development/libraries/nss/generic.nix index b0a633869abc7..c0645f17cddef 100644 --- a/pkgs/development/libraries/nss/generic.nix +++ b/pkgs/development/libraries/nss/generic.nix @@ -98,7 +98,7 @@ stdenv.mkDerivation rec { -j $NIX_BUILD_CORES \ ${lib.optionalString enableFIPS "--enable-fips"} \ ${lib.optionalString stdenv.isDarwin "--clang"} \ - ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"} + ${lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "--disable-tests"} runHook postBuild ''; @@ -153,7 +153,7 @@ stdenv.mkDerivation rec { postFixup = let - isCross = stdenv.hostPlatform != stdenv.buildPlatform; + isCross = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); nss = if isCross then buildPackages.nss.tools else "$out"; in (lib.optionalString enableFIPS ('' diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix index 266b6900934ea..b833952b7cd7e 100644 --- a/pkgs/development/libraries/openldap/default.nix +++ b/pkgs/development/libraries/openldap/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { "--enable-crypt" "--enable-modules" "--enable-overlays" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--with-yielding_select=yes" "ac_cv_func_memcmp_working=yes" ] ++ lib.optional stdenv.isFreeBSD "--with-pic"; diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 361756f94ea90..3acc52cccfea3 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -89,7 +89,7 @@ let powerpc64-linux = "./Configure linux-ppc64"; riscv64-linux = "./Configure linux64-riscv64"; }.${stdenv.hostPlatform.system} or ( - if stdenv.hostPlatform == stdenv.buildPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then "./config" else if stdenv.hostPlatform.isBSD then if stdenv.hostPlatform.isx86_64 then "./Configure BSD-x86_64" diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index 52a4ba32315ee..04e9f912e64d9 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { patchShebangs RunGrepTest ''; - doCheck = !(with stdenv.hostPlatform; isCygwin || isFreeBSD) && stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = !(with stdenv.hostPlatform; isCygwin || isFreeBSD) && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); # XXX: test failure on Cygwin # we are running out of stack on both freeBSDs on Hydra diff --git a/pkgs/development/libraries/protobuf/generic-v3.nix b/pkgs/development/libraries/protobuf/generic-v3.nix index 9dc7f70c2fe20..a3ff919830e69 100644 --- a/pkgs/development/libraries/protobuf/generic-v3.nix +++ b/pkgs/development/libraries/protobuf/generic-v3.nix @@ -54,6 +54,6 @@ mkProtobufDerivation = buildProtobuf: stdenv: stdenv.mkDerivation { platforms = lib.platforms.unix; }; }; -in mkProtobufDerivation(if (stdenv.buildPlatform != stdenv.hostPlatform) +in mkProtobufDerivation(if (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then (mkProtobufDerivation null buildPackages.stdenv) else null) stdenv diff --git a/pkgs/development/libraries/protobuf/generic.nix b/pkgs/development/libraries/protobuf/generic.nix index cf00d1d50bebb..ec838af10d047 100644 --- a/pkgs/development/libraries/protobuf/generic.nix +++ b/pkgs/development/libraries/protobuf/generic.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # protoc of the same version must be available for build. For non-cross builds, it's able to # re-use the executable generated as part of the build buildPackages."protobuf_${lib.versions.major version}" diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix index b1308159eb688..559c4286f9f46 100644 --- a/pkgs/development/libraries/qt-5/5.15/default.nix +++ b/pkgs/development/libraries/qt-5/5.15/default.nix @@ -350,7 +350,7 @@ let qmake = callPackage ({ qtbase }: makeSetupHook { name = "qmake-hook"; - ${if stdenv.buildPlatform == stdenv.hostPlatform + ${if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then "propagatedBuildInputs" else "depsTargetTargetPropagated"} = [ qtbase.dev ]; substitutions = { @@ -380,7 +380,7 @@ let # qttranslations causes eval-time infinite recursion when # cross-compiling; disabled for now. qttranslations = - if stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then bootstrapScope.qttranslations else null; }); diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix index d92287feb1511..6dc2e8cf8a576 100644 --- a/pkgs/development/libraries/qt-5/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix @@ -21,7 +21,7 @@ , libGLSupported ? !stdenv.isDarwin , libGL # qmake detection for libmysqlclient does not seem to work when cross compiling -, mysqlSupport ? stdenv.hostPlatform == stdenv.buildPlatform +, mysqlSupport ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , libmysqlclient , buildExamples ? false , buildTests ? false @@ -88,7 +88,7 @@ stdenv.mkDerivation (finalAttrs: ({ nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ] ++ lib.optionals stdenv.isDarwin [ xcbuild ]; - } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + } // lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) { # `qtbase` expects to find `cc` (with no prefix) in the # `$PATH`, so the following is needed even if # `stdenv.buildPlatform.canExecute stdenv.hostPlatform` @@ -208,7 +208,7 @@ stdenv.mkDerivation (finalAttrs: ({ env = { NIX_CFLAGS_COMPILE = toString ([ "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-Wno-warn=free-nonheap-object" "-Wno-free-nonheap-object" "-w" @@ -226,7 +226,7 @@ stdenv.mkDerivation (finalAttrs: ({ ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"'' ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"'' ] ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC"); - } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + } // lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) { NIX_CFLAGS_COMPILE_FOR_BUILD = toString ([ "-Wno-warn=free-nonheap-object" "-Wno-free-nonheap-object" @@ -241,7 +241,7 @@ stdenv.mkDerivation (finalAttrs: ({ # To prevent these failures, we need to override PostgreSQL detection. PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq"; - } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + } // lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) { configurePlatforms = [ ]; } // { # TODO Remove obsolete and useless flags once the build will be totally mastered @@ -270,7 +270,7 @@ stdenv.mkDerivation (finalAttrs: ({ "-L" "${icu.out}/lib" "-I" "${icu.dev}/include" "-pch" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "-device ${qtPlatformCross stdenv.hostPlatform}" "-device-option CROSS_COMPILE=${stdenv.cc.targetPrefix}" ] @@ -278,7 +278,7 @@ stdenv.mkDerivation (finalAttrs: ({ ++ lib.optionals developerBuild [ "-developer-build" "-no-warnings-are-errors" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-no-warnings-are-errors" ] ++ (if (!stdenv.hostPlatform.isx86_64) then [ "-no-sse2" diff --git a/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix b/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix index e7d6be534409e..e21fc847898c9 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix @@ -8,5 +8,5 @@ qtModule { pname = "qtwebchannel"; propagatedBuildInputs = [ qtbase qtdeclarative ]; - outputs = [ "out" "dev" ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "bin" ]; + outputs = [ "out" "dev" ] ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "bin" ]; } diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix index b2715fbe7502c..df5948cf9e3f4 100644 --- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix +++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix @@ -57,7 +57,7 @@ qtModule ({ pname = "qtwebengine"; nativeBuildInputs = [ bison flex git gperf ninja pkg-config (python.withPackages(ps: [ ps.html5lib ])) which gn nodejs - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ perl lndir (lib.getDev pkgsBuildTarget.targetPackages.qt5.qtbase) pkgsBuildBuild.pkg-config @@ -135,7 +135,7 @@ qtModule ({ env = { NIX_CFLAGS_COMPILE = toString ( - lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-w " ] ++ lib.optionals stdenv.cc.isGNU [ # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit @@ -147,7 +147,7 @@ qtModule ({ ] ++ lib.optionals stdenv.cc.isClang [ "-Wno-elaborated-enum-base" ]); - } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + } // lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) { NIX_CFLAGS_LINK = "-Wl,--no-warn-search-mismatch"; "NIX_CFLAGS_LINK_${buildPackages.stdenv.cc.suffixSalt}" = "-Wl,--no-warn-search-mismatch"; }; @@ -158,7 +158,7 @@ qtModule ({ if [ -d "$PWD/tools/qmake" ]; then QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH" fi - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' export QMAKE_CC=$CC export QMAKE_CXX=$CXX export QMAKE_LINK=$CXX @@ -166,7 +166,7 @@ qtModule ({ ''; qmakeFlags = [ "--" "-system-ffmpeg" ] - ++ lib.optional (pipewireSupport && stdenv.buildPlatform == stdenv.hostPlatform) "-webengine-webrtc-pipewire" + ++ lib.optional (pipewireSupport && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)) "-webengine-webrtc-pipewire" ++ lib.optional enableProprietaryCodecs "-proprietary-codecs"; propagatedBuildInputs = [ @@ -264,7 +264,7 @@ qtModule ({ dontUseNinjaBuild = true; dontUseNinjaInstall = true; - postInstall = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postInstall = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' mkdir -p $out/libexec '' + lib.optionalString stdenv.isLinux '' cat > $out/libexec/qt.conf < withLibraries; assert withTests -> withLibraries; let - isCross = stdenv.buildPlatform != stdenv.hostPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); in stdenv.mkDerivation (finalAttrs: { pname = "wayland"; diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix index a260b2b63b92d..31c69ae6a46ff 100644 --- a/pkgs/development/libraries/wayland/protocols.nix +++ b/pkgs/development/libraries/wayland/protocols.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { version = "1.35"; # https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/48 - doCheck = stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.linker == "bfd" && wayland.withLibraries; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && stdenv.hostPlatform.linker == "bfd" && wayland.withLibraries; src = fetchurl { url = "https://gitlab.freedesktop.org/wayland/${pname}/-/releases/${version}/downloads/${pname}-${version}.tar.xz"; diff --git a/pkgs/development/libraries/waylandpp/default.nix b/pkgs/development/libraries/waylandpp/default.nix index 7eeeb2467edde..296db26df73e8 100644 --- a/pkgs/development/libraries/waylandpp/default.nix +++ b/pkgs/development/libraries/waylandpp/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++" ]; diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix index 98c28ca67997d..533c03e25eacb 100644 --- a/pkgs/development/libraries/webkitgtk/default.nix +++ b/pkgs/development/libraries/webkitgtk/default.nix @@ -94,7 +94,7 @@ stdenv.mkDerivation (finalAttrs: { }) ]; - preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preConfigure = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # Ignore gettext in cmake_prefix_path so that find_program doesn't # pick up the wrong gettext. TODO: Find a better solution for # this, maybe make cmake not look up executables in diff --git a/pkgs/development/libraries/webp-pixbuf-loader/default.nix b/pkgs/development/libraries/webp-pixbuf-loader/default.nix index 78496c0e919e3..03d329a561148 100644 --- a/pkgs/development/libraries/webp-pixbuf-loader/default.nix +++ b/pkgs/development/libraries/webp-pixbuf-loader/default.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation rec { # gdk-pixbuf disables the thumbnailer in cross-builds (https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/commit/fc37708313a5fc52083cf10c9326f3509d67701f) # and therefore makeWrapper will fail because 'gdk-pixbuf-thumbnailer' the executable does not exist. - '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + '' + lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # It assumes gdk-pixbuf-thumbnailer can find the webp loader in the loaders.cache referenced by environment variable, breaking containment. # So we replace it with a wrapped executable. mkdir -p "$out/bin" diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix index 91e8a435db804..25dbd3799dddd 100644 --- a/pkgs/development/libraries/x264/default.nix +++ b/pkgs/development/libraries/x264/default.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { configureFlags = lib.optional enableShared "--enable-shared" ++ lib.optional (!stdenv.isi686) "--enable-pic" - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}"; + ++ lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}"; makeFlags = [ "BASHCOMPLETIONSDIR=$(out)/share/bash-completion/completions" diff --git a/pkgs/development/libraries/x265/default.nix b/pkgs/development/libraries/x265/default.nix index 7f44834d48672..070fa48ade1ca 100644 --- a/pkgs/development/libraries/x265/default.nix +++ b/pkgs/development/libraries/x265/default.nix @@ -25,7 +25,7 @@ let mkFlag = optSet: flag: if optSet then "-D${flag}=ON" else "-D${flag}=OFF"; - isCross = stdenv.buildPlatform != stdenv.hostPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); in stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 23795b6aab40d..36d3b6923df9c 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: { dontConfigure = stdenv.hostPlatform.isMinGW; - preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preConfigure = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' export CHOST=${stdenv.hostPlatform.config} ''; @@ -114,7 +114,7 @@ stdenv.mkDerivation (finalAttrs: { # We don't strip on static cross-compilation because of reports that native # stripping corrupted the target library; see commit 12e960f5 for the report. - dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static; + dontStrip = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && static; configurePlatforms = []; installFlags = lib.optionals stdenv.hostPlatform.isMinGW [ diff --git a/pkgs/development/perl-modules/generic/default.nix b/pkgs/development/perl-modules/generic/default.nix index e7afedf5d63cd..44b49462bfcb7 100644 --- a/pkgs/development/perl-modules/generic/default.nix +++ b/pkgs/development/perl-modules/generic/default.nix @@ -43,7 +43,7 @@ lib.throwIf (attrs ? name) "buildPerlPackage: `name` (\"${attrs.name}\") is depr builder = ./builder.sh; buildInputs = buildInputs ++ [ perl ]; - nativeBuildInputs = nativeBuildInputs ++ (if stdenv.buildPlatform != stdenv.hostPlatform then [ perl.mini ] else [ perl ]); + nativeBuildInputs = nativeBuildInputs ++ (if (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then [ perl.mini ] else [ perl ]); inherit outputs src doCheck checkTarget enableParallelBuilding; env = { diff --git a/pkgs/development/python-modules/m2crypto/default.nix b/pkgs/development/python-modules/m2crypto/default.nix index 88f09710151ff..cdf03f48e31bd 100644 --- a/pkgs/development/python-modules/m2crypto/default.nix +++ b/pkgs/development/python-modules/m2crypto/default.nix @@ -36,7 +36,7 @@ buildPythonPackage rec { "-Wno-error=incompatible-pointer-types" ]); } - // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) { + // lib.optionalAttrs (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) { CPP = "${stdenv.cc.targetPrefix}cpp"; }; diff --git a/pkgs/development/python-modules/psycopg2/default.nix b/pkgs/development/python-modules/psycopg2/default.nix index 471cff85da6ed..e97d889a11a2a 100644 --- a/pkgs/development/python-modules/psycopg2/default.nix +++ b/pkgs/development/python-modules/psycopg2/default.nix @@ -61,7 +61,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "psycopg2" ]; - disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + disallowedReferences = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ buildPackages.postgresql ]; diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index ed0264c816dd6..68a6d84b77600 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -120,7 +120,7 @@ buildPythonPackage rec { nativeBuildInputs = [ pkg-config ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ libsForQt5.qmake ] + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ libsForQt5.qmake ] ++ [ setuptools lndir @@ -129,7 +129,7 @@ buildPythonPackage rec { ++ ( with pkgsBuildTarget.targetPackages.libsForQt5; [ ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ qmake ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ qmake ] ++ [ qtbase qtsvg @@ -148,7 +148,7 @@ buildPythonPackage rec { buildInputs = with libsForQt5; [ dbus ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ qtbase ] + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ qtbase ] ++ [ qtsvg qtdeclarative diff --git a/pkgs/development/python-modules/pyqtwebengine/default.nix b/pkgs/development/python-modules/pyqtwebengine/default.nix index b72fde6277f7b..feee596a42519 100644 --- a/pkgs/development/python-modules/pyqtwebengine/default.nix +++ b/pkgs/development/python-modules/pyqtwebengine/default.nix @@ -55,8 +55,8 @@ buildPythonPackage ( pkg-config qmake ] - ++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ sip ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ++ lib.optionals (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ sip ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ python.pythonOnBuildForHost.pkgs.sip ] ++ [ @@ -66,7 +66,7 @@ buildPythonPackage ( pyqt-builder pythonPackages.setuptools ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ qtdeclarative ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ qtdeclarative ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]; buildInputs = @@ -76,7 +76,7 @@ buildPythonPackage ( qtsvg qtwebengine ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ qtwebchannel qtdeclarative ]; @@ -109,7 +109,7 @@ buildPythonPackage ( hydraPlatforms = lib.lists.intersectLists qtwebengine.meta.platforms platforms.mesaPlatforms; }; } - // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + // lib.optionalAttrs (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) { # TODO: figure out why the env hooks aren't adding these inclusions automatically env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [ "-I${lib.getDev qtbase}/include/QtPrintSupport/" diff --git a/pkgs/development/python-modules/sigrok/default.nix b/pkgs/development/python-modules/sigrok/default.nix index 40253c5ad19c7..1c85c37c70aee 100644 --- a/pkgs/development/python-modules/sigrok/default.nix +++ b/pkgs/development/python-modules/sigrok/default.nix @@ -33,7 +33,7 @@ toPythonModule ( swig numpy ] - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ pythonImportsCheckHook pythonCatchConflictsHook ]; diff --git a/pkgs/development/python-modules/tpm2-pytss/default.nix b/pkgs/development/python-modules/tpm2-pytss/default.nix index 02494a535bfd6..4d21894686011 100644 --- a/pkgs/development/python-modules/tpm2-pytss/default.nix +++ b/pkgs/development/python-modules/tpm2-pytss/default.nix @@ -22,7 +22,7 @@ }: let - isCross = (stdenv.buildPlatform != stdenv.hostPlatform); + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); in buildPythonPackage rec { pname = "tpm2-pytss"; diff --git a/pkgs/development/skaware-packages/s6-linux-init/default.nix b/pkgs/development/skaware-packages/s6-linux-init/default.nix index d7d44aeac42ac..10efba25f15bc 100644 --- a/pkgs/development/skaware-packages/s6-linux-init/default.nix +++ b/pkgs/development/skaware-packages/s6-linux-init/default.nix @@ -33,7 +33,7 @@ skawarePackages.buildPackage { ]; # See ../s6-rc/default.nix for an explanation - postConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) '' + postConfigure = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) '' substituteInPlace src/init/s6-linux-init-maker.c \ --replace-fail '' '"${targetPackages.execline.dev}/include/execline/config.h"' \ --replace-fail '' '"${targetPackages.s6.dev}/include/s6/config.h"' \ diff --git a/pkgs/development/skaware-packages/s6-rc/default.nix b/pkgs/development/skaware-packages/s6-rc/default.nix index f6865f43af5d1..52c2d9c38bbe2 100644 --- a/pkgs/development/skaware-packages/s6-rc/default.nix +++ b/pkgs/development/skaware-packages/s6-rc/default.nix @@ -48,7 +48,7 @@ skawarePackages.buildPackage { # only time hostPlatform != targetPlatform. When that happens we # modify s6-rc-compile to use the configuration headers for the # system we're cross-compiling for. - postConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) '' + postConfigure = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) '' substituteInPlace src/s6-rc/s6-rc-compile.c \ --replace-fail '' '"${targetPackages.execline.dev}/include/execline/config.h"' \ --replace-fail '' '"${targetPackages.s6.dev}/include/s6/config.h"' \ diff --git a/pkgs/development/tools/bpf-linker/default.nix b/pkgs/development/tools/bpf-linker/default.nix index 5f594deba7c95..f39d24493ef88 100644 --- a/pkgs/development/tools/bpf-linker/default.nix +++ b/pkgs/development/tools/bpf-linker/default.nix @@ -39,6 +39,6 @@ rustPlatform.buildRustPackage rec { maintainers = with maintainers; [ nickcao ]; # llvm-sys crate locates llvm by calling llvm-config # which is not available when cross compiling - broken = stdenv.buildPlatform != stdenv.hostPlatform; + broken = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); }; } diff --git a/pkgs/development/tools/build-managers/jam/default.nix b/pkgs/development/tools/build-managers/jam/default.nix index bf06954df4dee..2f16e234456ee 100644 --- a/pkgs/development/tools/build-managers/jam/default.nix +++ b/pkgs/development/tools/build-managers/jam/default.nix @@ -20,7 +20,7 @@ let # host platform. This looks a little ridiculous because the vast majority of # build tools don't embed target-specific information into their binary, but # in this case we behave more like a compiler than a make(1)-alike. - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) '' cat >>jam.h < /dev/null ''; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' installShellCompletion --cmd k6 \ --bash <($out/bin/k6 completion bash) \ --fish <($out/bin/k6 completion fish) \ diff --git a/pkgs/development/tools/knightos/scas/default.nix b/pkgs/development/tools/knightos/scas/default.nix index e05953e87ec72..9a8778a6282bb 100644 --- a/pkgs/development/tools/knightos/scas/default.nix +++ b/pkgs/development/tools/knightos/scas/default.nix @@ -1,7 +1,7 @@ { fetchFromGitHub, lib, stdenv, cmake, buildPackages, asciidoc, libxslt }: let - isCrossCompiling = stdenv.hostPlatform != stdenv.buildPlatform; + isCrossCompiling = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in stdenv.mkDerivation rec { diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix index 3cb6760842f5f..1daf8c8011d82 100644 --- a/pkgs/development/tools/misc/autogen/default.nix +++ b/pkgs/development/tools/misc/autogen/default.nix @@ -63,7 +63,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ which pkg-config perl autoreconfHook/*patches applied*/ - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # autogen needs a build autogen when cross-compiling buildPackages.buildPackages.autogen buildPackages.texinfo ]; @@ -86,7 +86,7 @@ stdenv.mkDerivation rec { # Debian: https://salsa.debian.org/debian/autogen/-/blob/master/debian/rules#L21 "--enable-timeout=78" "CFLAGS=-D_FILE_OFFSET_BITS=64" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # the configure check for regcomp wants to run a host program "libopts_cv_with_libregex=yes" #"MAKEINFO=${buildPackages.texinfo}/bin/makeinfo" diff --git a/pkgs/development/tools/misc/babeltrace/default.nix b/pkgs/development/tools/misc/babeltrace/default.nix index 014d926eea3d7..a6df152965ada 100644 --- a/pkgs/development/tools/misc/babeltrace/default.nix +++ b/pkgs/development/tools/misc/babeltrace/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { # --enable-debug-info (default) requires the configure script to run host # executables to determine the elfutils library version, which cannot be done # while cross compiling. - configureFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-debug-info"; + configureFlags = lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "--disable-debug-info"; meta = with lib; { description = "Command-line tool and library to read and convert LTTng tracefiles"; diff --git a/pkgs/development/tools/misc/binutils/2.38/default.nix b/pkgs/development/tools/misc/binutils/2.38/default.nix index 474a565f351f9..2ea30779f0780 100644 --- a/pkgs/development/tools/misc/binutils/2.38/default.nix +++ b/pkgs/development/tools/misc/binutils/2.38/default.nix @@ -194,7 +194,7 @@ stdenv.mkDerivation { postFixup = ""; # Break dependency on pkgsBuildBuild.gcc when building a cross-binutils - stripDebugList = if stdenv.hostPlatform != stdenv.targetPlatform then "bin lib ${stdenv.hostPlatform.config}" else null; + stripDebugList = if (!lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) then "bin lib ${stdenv.hostPlatform.config}" else null; # INFO: Otherwise it fails with: # `./sanity.sh: line 36: $out/bin/size: not found` diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index a60457e73591e..a71f2dcfe3187 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -236,7 +236,7 @@ stdenv.mkDerivation (finalAttrs: { doCheck = false; # Break dependency on pkgsBuildBuild.gcc when building a cross-binutils - stripDebugList = if stdenv.hostPlatform != stdenv.targetPlatform then "bin lib ${stdenv.hostPlatform.config}" else null; + stripDebugList = if (!lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) then "bin lib ${stdenv.hostPlatform.config}" else null; # INFO: Otherwise it fails with: # `./sanity.sh: line 36: $out/bin/size: not found` diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix index a5a812aa034af..082bf372c10a9 100644 --- a/pkgs/development/tools/misc/elfutils/default.nix +++ b/pkgs/development/tools/misc/elfutils/default.nix @@ -85,9 +85,9 @@ stdenv.mkDerivation rec { !stdenv.hostPlatform.isMusl # Test suite tries using `uname` to determine whether certain tests # can be executed, so we need to match build and host platform exactly. - && (stdenv.hostPlatform == stdenv.buildPlatform); + && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); doInstallCheck = !stdenv.hostPlatform.isMusl - && (stdenv.hostPlatform == stdenv.buildPlatform); + && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); passthru.updateScript = gitUpdater { url = "https://sourceware.org/git/elfutils.git"; diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 263196dab5efa..da2359994fb65 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -6,7 +6,7 @@ # Run time , ncurses, readline, gmp, mpfr, expat, libipt, zlib, zstd, xz, dejagnu, sourceHighlight, libiconv -, pythonSupport ? stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isCygwin, python3 ? null +, pythonSupport ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && !stdenv.hostPlatform.isCygwin, python3 ? null , enableDebuginfod ? lib.meta.availableOn stdenv.hostPlatform elfutils, elfutils , guile ? null , hostCpuOnly ? false @@ -22,7 +22,7 @@ let basename = "gdb"; - targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + targetPrefix = lib.optionalString (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) "${stdenv.targetPlatform.config}-"; in diff --git a/pkgs/development/tools/misc/intltool/default.nix b/pkgs/development/tools/misc/intltool/default.nix index 967fc442a73d2..f6b8c9d82f1da 100644 --- a/pkgs/development/tools/misc/intltool/default.nix +++ b/pkgs/development/tools/misc/intltool/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = with perlPackages; [ perl XMLParser ]; propagatedBuildInputs = [ gettext ] ++ (with perlPackages; [ perl XMLParser ]); - postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postInstall = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' for f in $out/bin/*; do substituteInPlace $f --replace "${buildPackages.perl}" "${perlPackages.perl}" done diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix index 29d0a94e301ff..e74f3e4ecf809 100644 --- a/pkgs/development/tools/misc/luarocks/default.nix +++ b/pkgs/development/tools/misc/luarocks/default.nix @@ -105,7 +105,7 @@ stdenv.mkDerivation (finalAttrs: { export LUA_PATH="src/?.lua;''${LUA_PATH:-}" ''; - disallowedReferences = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + disallowedReferences = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ lua.luaOnBuild ]; diff --git a/pkgs/development/tools/misc/pkg-config/default.nix b/pkgs/development/tools/misc/pkg-config/default.nix index ae567bb01b738..a94f9bca27f70 100644 --- a/pkgs/development/tools/misc/pkg-config/default.nix +++ b/pkgs/development/tools/misc/pkg-config/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-internal-glib" ] ++ lib.optionals (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ] # Can't run these tests while cross-compiling - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "glib_cv_stack_grows=no" "glib_cv_uscore=no" "ac_cv_func_posix_getpwuid_r=yes" diff --git a/pkgs/development/tools/misc/texi2html/default.nix b/pkgs/development/tools/misc/texi2html/default.nix index 66609d8d17e18..5e63f6543d393 100644 --- a/pkgs/development/tools/misc/texi2html/default.nix +++ b/pkgs/development/tools/misc/texi2html/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { patchShebangs separated_to_hash.pl ''; - postInstall = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postInstall = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' for f in $out/bin/*; do substituteInPlace $f --replace "${buildPackages.perl}" "${perl}" done diff --git a/pkgs/development/tools/misc/texinfo/common.nix b/pkgs/development/tools/misc/texinfo/common.nix index f3f2e93892960..5aee8ecf344b4 100644 --- a/pkgs/development/tools/misc/texinfo/common.nix +++ b/pkgs/development/tools/misc/texinfo/common.nix @@ -14,7 +14,7 @@ let inherit (lib) getDev getLib optional optionals optionalString; - crossBuildTools = stdenv.hostPlatform != stdenv.buildPlatform; + crossBuildTools = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in stdenv.mkDerivation { diff --git a/pkgs/development/tools/misc/texlab/default.nix b/pkgs/development/tools/misc/texlab/default.nix index 463efbd198dbd..bbb40475d8519 100644 --- a/pkgs/development/tools/misc/texlab/default.nix +++ b/pkgs/development/tools/misc/texlab/default.nix @@ -11,7 +11,7 @@ }: let - isCross = stdenv.hostPlatform != stdenv.buildPlatform; + isCross = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in rustPlatform.buildRustPackage rec { pname = "texlab"; diff --git a/pkgs/development/tools/pandoc/default.nix b/pkgs/development/tools/pandoc/default.nix index 9d0c511f64794..54213c2b621a6 100644 --- a/pkgs/development/tools/pandoc/default.nix +++ b/pkgs/development/tools/pandoc/default.nix @@ -30,7 +30,7 @@ in remove-references-to \ -t ${haskellPackages.pandoc} \ $out/bin/pandoc - '' + lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform) '' + '' + lib.optionalString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' mkdir -p $out/share/bash-completion/completions $out/bin/pandoc --bash-completion > $out/share/bash-completion/completions/pandoc '' + '' diff --git a/pkgs/development/tools/parsing/bison/default.nix b/pkgs/development/tools/parsing/bison/default.nix index 43ef3ffa3e199..5d7e0073fa3a1 100644 --- a/pkgs/development/tools/parsing/bison/default.nix +++ b/pkgs/development/tools/parsing/bison/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { # there's a /bin/sh shebang in bin/yacc which when no strictDeps is patched with the build stdenv shell # however when cross-compiling it would still be patched with the build stdenv shell which would be wrong # cannot add bash to buildInputs due to infinite recursion - strictDeps = stdenv.hostPlatform != stdenv.buildPlatform; + strictDeps = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); nativeBuildInputs = [ m4 perl ] ++ lib.optional stdenv.isSunOS help2man; propagatedBuildInputs = [ m4 ]; diff --git a/pkgs/development/tools/parsing/flex/2.5.35.nix b/pkgs/development/tools/parsing/flex/2.5.35.nix index a68f7e07429c3..0c8f3708baead 100644 --- a/pkgs/development/tools/parsing/flex/2.5.35.nix +++ b/pkgs/development/tools/parsing/flex/2.5.35.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ m4 ]; - preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preConfigure = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' ac_cv_func_malloc_0_nonnull=yes ac_cv_func_realloc_0_nonnull=yes ''; diff --git a/pkgs/development/tools/parsing/flex/default.nix b/pkgs/development/tools/parsing/flex/default.nix index bd62241ec98ca..aaab453cd5558 100644 --- a/pkgs/development/tools/parsing/flex/default.nix +++ b/pkgs/development/tools/parsing/flex/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { postPatch = '' patchShebangs tests - '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace Makefile.in --replace "tests" " " substituteInPlace doc/Makefile.am --replace 'flex.1: $(top_srcdir)/configure.ac' 'flex.1: ' @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { buildInputs = [ bison ]; propagatedBuildInputs = [ m4 ]; - preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + preConfigure = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' export ac_cv_func_malloc_0_nonnull=yes export ac_cv_func_realloc_0_nonnull=yes ''; @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { sed -i Makefile -e 's/-no-undefined//;' ''; - dontDisableStatic = stdenv.buildPlatform != stdenv.hostPlatform; + dontDisableStatic = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); postInstall = '' ln -s $out/bin/flex $out/bin/lex diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix index 962bc3e246bec..98919bdd24549 100644 --- a/pkgs/development/web/nodejs/nodejs.nix +++ b/pkgs/development/web/nodejs/nodejs.nix @@ -14,7 +14,7 @@ let inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; - isCross = stdenv.hostPlatform != stdenv.buildPlatform; + isCross = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); majorVersion = lib.versions.major version; minorVersion = lib.versions.minor version; diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix index 6d099cfcfe312..4e132597ad906 100644 --- a/pkgs/games/nethack/default.nix +++ b/pkgs/games/nethack/default.nix @@ -77,7 +77,7 @@ in stdenv.mkDerivation rec { -e 's,moc-qt4,moc,' \ -i sys/unix/hints/linux-qt4 ''} - ${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) + ${lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) # If we're cross-compiling, replace the paths to the data generation tools # with the ones from the build platform's nethack package, since we can't # run the ones we've built here. diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/install.nix b/pkgs/os-specific/bsd/freebsd/pkgs/install.nix index b8e59adb09c5f..e50172a94cf44 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/install.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/install.nix @@ -36,7 +36,7 @@ mkDerivation { makeMinimal mandoc groff - (if stdenv.hostPlatform == stdenv.buildPlatform then boot-install else install) + (if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then boot-install else install) ]; skipIncludesPhase = true; buildInputs = compatIfNeeded ++ [ @@ -49,7 +49,7 @@ mkDerivation { "MK_WERROR=no" "TESTSDIR=${builtins.placeholder "test"}" ] - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "BOOTSTRAPPING=1" "INSTALL=boot-install" ]; diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix b/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix index 82a9e140102f6..23a940105e0e8 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/libnetbsd/package.nix @@ -19,10 +19,10 @@ mkDerivation { makeMinimal mandoc groff - (if stdenv.hostPlatform == stdenv.buildPlatform then boot-install else install) + (if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then boot-install else install) ]; makeFlags = [ "STRIP=-s" # flag to install, not command "MK_WERROR=no" - ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "INSTALL=boot-install"; + ] ++ lib.optional (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "INSTALL=boot-install"; } diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix index ed5e998714afe..e7504ba942a3f 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix @@ -13,7 +13,7 @@ in appleDerivation { nativeBuildInputs = [ python3 ]; - depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; + depsBuildBuild = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; postPatch = '' substituteInPlace makefile \ @@ -38,7 +38,7 @@ appleDerivation { --replace "&TestMailFilterCSS" "NULL" patchShebangs icuSources - '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' # This looks like a bug in the makefile. It defines ENV_BUILDHOST to # propagate the correct value of CC, CXX, etc, but has the following double @@ -64,7 +64,7 @@ appleDerivation { "MAC_OS_X_VERSION_MIN_REQUIRED=${formatVersionNumeric stdenv.hostPlatform.darwinMinVersion}" "ICU_TARGET_VERSION=-m${stdenv.hostPlatform.darwinPlatform}-version-min=${stdenv.hostPlatform.darwinMinVersion}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "CROSS_BUILD=YES" "BUILD_TYPE=" "RC_ARCHS=${stdenv.hostPlatform.darwinArch}" diff --git a/pkgs/os-specific/darwin/cctools/llvm.nix b/pkgs/os-specific/darwin/cctools/llvm.nix index f2986bf872f76..77654f763fb20 100644 --- a/pkgs/os-specific/darwin/cctools/llvm.nix +++ b/pkgs/os-specific/darwin/cctools/llvm.nix @@ -1,7 +1,7 @@ # Create a cctools-compatible bintools that uses equivalent tools from LLVM in place of the ones # from cctools when possible. -{ lib, stdenv, makeWrapper, cctools-port, llvmPackages, enableManpages ? stdenv.targetPlatform == stdenv.hostPlatform }: +{ lib, stdenv, makeWrapper, cctools-port, llvmPackages, enableManpages ? (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) }: let inherit (stdenv) targetPlatform hostPlatform; diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 377d84d9bf731..133e43720984a 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -11,7 +11,7 @@ let # The targetPrefix prepended to binary names to allow multiple binuntils on the # PATH to both be usable. targetPrefix = lib.optionalString - (stdenv.targetPlatform != stdenv.hostPlatform) + (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) "${stdenv.targetPlatform.config}-"; in @@ -66,7 +66,7 @@ stdenv.mkDerivation { # TODO(@Ericson2314): Always pass "--target" and always targetPrefix. configurePlatforms = [ "build" "host" ] - ++ lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target"; + ++ lib.optional (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) "target"; configureFlags = [ "--disable-clang-as" ] ++ lib.optionals enableTapiSupport [ "--enable-tapi-support" diff --git a/pkgs/os-specific/darwin/libtapi/default.nix b/pkgs/os-specific/darwin/libtapi/default.nix index cb6b3cf4b7393..01bb23c04f01e 100644 --- a/pkgs/os-specific/darwin/libtapi/default.nix +++ b/pkgs/os-specific/darwin/libtapi/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation (finalAttrs: { # Also means we don't have to manually fix the result with install_name_tool. patches = [ ./disable-rpath.patch - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # TODO: make unconditional and rebuild the world # TODO: send upstream ./native-clang-tblgen.patch @@ -30,7 +30,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ ncurses ]; cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=OFF" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-DCMAKE_CROSSCOMPILING=True" # This package could probably have a llvm_6 llvm-tblgen and clang-tblgen # provided to reduce some building. This package seems intended to diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 4c06ea352ee03..a9965c21d9d01 100644 --- a/pkgs/os-specific/linux/apparmor/default.nix +++ b/pkgs/os-specific/linux/apparmor/default.nix @@ -3,8 +3,8 @@ , flex, bison , linuxHeaders ? stdenv.cc.libc.linuxHeaders , gawk -, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform && lib.meta.availableOn stdenv.hostPlatform perl, perl -, withPython ? stdenv.hostPlatform == stdenv.buildPlatform && lib.meta.availableOn stdenv.hostPlatform python3, python3 +, withPerl ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && lib.meta.availableOn stdenv.hostPlatform perl, perl +, withPython ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && lib.meta.availableOn stdenv.hostPlatform python3, python3 , swig , ncurses , pam diff --git a/pkgs/os-specific/linux/audit/default.nix b/pkgs/os-specific/linux/audit/default.nix index d5e38ea62fb8b..a5cf3929346da 100644 --- a/pkgs/os-specific/linux/audit/default.nix +++ b/pkgs/os-specific/linux/audit/default.nix @@ -11,7 +11,7 @@ # Enabling python support while cross compiling would be possible, but the # configure script tries executing python to gather info instead of relying on # python3-config exclusively -, enablePython ? stdenv.hostPlatform == stdenv.buildPlatform, +, enablePython ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), }: stdenv.mkDerivation (finalAttrs: { diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index 4a291cc03b8f6..225ba0ff31d89 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -75,7 +75,7 @@ stdenv.mkDerivation rec { url = "https://git.alpinelinux.org/aports/plain/main/busybox/0002-nslookup-sanitize-all-printed-strings-with-printable.patch?id=ed92963eb55bbc8d938097b9ccb3e221a94653f4"; sha256 = "sha256-vl1wPbsHtXY9naajjnTicQ7Uj3N+EQ8pRNnrdsiow+w="; }) - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) ./clang-cross.patch; + ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) ./clang-cross.patch; separateDebugInfo = true; diff --git a/pkgs/os-specific/linux/cifs-utils/default.nix b/pkgs/os-specific/linux/cifs-utils/default.nix index cae7901386d19..b65dc39cbef23 100644 --- a/pkgs/os-specific/linux/cifs-utils/default.nix +++ b/pkgs/os-specific/linux/cifs-utils/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { buildInputs = [ libkrb5 keyutils pam talloc python3 ]; - configureFlags = [ "ROOTSBINDIR=$(out)/sbin" ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = [ "ROOTSBINDIR=$(out)/sbin" ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # AC_FUNC_MALLOC is broken on cross builds. "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" diff --git a/pkgs/os-specific/linux/criu/default.nix b/pkgs/os-specific/linux/criu/default.nix index 66e3303890b03..198687e417bb0 100644 --- a/pkgs/os-specific/linux/criu/default.nix +++ b/pkgs/os-specific/linux/criu/default.nix @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { "PREFIX=$(out)" "ASCIIDOC=${buildPackages.asciidoc}/bin/asciidoc" "XMLTO=${buildPackages.xmlto}/bin/xmlto" - ] ++ (lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ (lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ARCH=${linuxArchMapping."${stdenv.hostPlatform.linuxArch}"}" "CROSS_COMPILE=${stdenv.hostPlatform.config}-" ]); diff --git a/pkgs/os-specific/linux/exfat/default.nix b/pkgs/os-specific/linux/exfat/default.nix index e247bbb9e837c..411f4aa25f9ed 100644 --- a/pkgs/os-specific/linux/exfat/default.nix +++ b/pkgs/os-specific/linux/exfat/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "ARCH=${stdenv.hostPlatform.linuxArch}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix index 3cc7759b41830..34f9b13abf3ac 100644 --- a/pkgs/os-specific/linux/iproute/default.nix +++ b/pkgs/os-specific/linux/iproute/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { "SHARED_LIBS=n" # all build .so plugins: "TC_CONFIG_NO_XT=y" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "HOSTCC=$(CC_FOR_BUILD)" ]; diff --git a/pkgs/os-specific/linux/iwd/default.nix b/pkgs/os-specific/linux/iwd/default.nix index 5c1d153b83fc9..473d778691cda 100644 --- a/pkgs/os-specific/linux/iwd/default.nix +++ b/pkgs/os-specific/linux/iwd/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { }; outputs = [ "out" "man" "doc" ] - ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "test"; + ++ lib.optional (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "test"; nativeBuildInputs = [ autoreconfHook @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { # wrapPython wraps the scripts in $test. They pull in gobject-introspection, # which doesn't cross-compile. - pythonPath = lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ + pythonPath = lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ python3Packages.dbus-python python3Packages.pygobject3 ]; @@ -70,7 +70,7 @@ stdenv.mkDerivation rec { mkdir -p $doc/share/doc cp -a doc $doc/share/doc/iwd cp -a README AUTHORS TODO $doc/share/doc/iwd - '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + '' + lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' mkdir -p $test/bin cp -a test/* $test/bin/ ''; diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix index cb75f013b6241..0ae315273d0c1 100644 --- a/pkgs/os-specific/linux/kernel/manual-config.nix +++ b/pkgs/os-specific/linux/kernel/manual-config.nix @@ -423,7 +423,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPat "HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc" "HOSTLD=${buildPackages.stdenv.cc.bintools}/bin/${buildPackages.stdenv.cc.targetPrefix}ld" "ARCH=${stdenv.hostPlatform.linuxArch}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ] ++ (stdenv.hostPlatform.linux-kernel.makeFlags or []) ++ extraMakeFlags; diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix index 2b010e5c8bce2..822187a075db7 100644 --- a/pkgs/os-specific/linux/klibc/default.nix +++ b/pkgs/os-specific/linux/klibc/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { ] # TODO(@Ericson2314): We now can get the ABI from # `stdenv.hostPlatform.parsed.abi`, is this still a good idea? ++ lib.optional (stdenv.hostPlatform.linuxArch == "arm") "CONFIG_AEABI=y" - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "CROSS_COMPILE=${stdenv.cc.targetPrefix}"; + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "CROSS_COMPILE=${stdenv.cc.targetPrefix}"; # Install static binaries as well. postInstall = '' diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix index 3f971e7a6edb3..146af21144a52 100644 --- a/pkgs/os-specific/linux/kmod/default.nix +++ b/pkgs/os-specific/linux/kmod/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, fetchzip, autoconf, automake, docbook_xml_dtd_42 , docbook_xml_dtd_43, docbook_xsl, gtk-doc, libtool, pkg-config , libxslt, xz, zstd, elf-header -, withDevdoc ? stdenv.hostPlatform == stdenv.buildPlatform +, withDevdoc ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , withStatic ? stdenv.hostPlatform.isStatic , gitUpdater }: diff --git a/pkgs/os-specific/linux/lvm2/common.nix b/pkgs/os-specific/linux/lvm2/common.nix index caafa52a81738..5e9ea2e7faa62 100644 --- a/pkgs/os-specific/linux/lvm2/common.nix +++ b/pkgs/os-specific/linux/lvm2/common.nix @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { "--enable-dmeventd" "--with-dmeventd-pidfile=/run/dmeventd/pid" "--with-default-dm-run-dir=/run/dmeventd" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" ] ++ lib.optionals udevSupport [ diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix index 7150930cb5619..e507008de79bf 100644 --- a/pkgs/os-specific/linux/mdadm/default.nix +++ b/pkgs/os-specific/linux/mdadm/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { "SYSTEMD_DIR=$(out)/lib/systemd/system" "MANDIR=$(out)/share/man" "RUN_DIR=/dev/.mdadm" "STRIP=" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index e5f8fec5acb14..7fe4793fb9de4 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { ]; # Case-insensitivity workaround for https://github.com/linux-pam/linux-pam/issues/569 - postPatch = if stdenv.buildPlatform.isDarwin && stdenv.buildPlatform != stdenv.hostPlatform then '' + postPatch = if stdenv.buildPlatform.isDarwin && (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then '' rm CHANGELOG touch ChangeLog '' else null; diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix index e4d245fdc7ce1..796d1c7c05d67 100644 --- a/pkgs/os-specific/linux/procps-ng/default.nix +++ b/pkgs/os-specific/linux/procps-ng/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation rec { # Too red; 8bit support for fixing https://github.com/NixOS/nixpkgs/issues/275220 configureFlags = [ "--disable-modern-top" "--enable-watch8bit" ] ++ lib.optional withSystemd "--with-systemd" - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" ]; diff --git a/pkgs/os-specific/linux/psmisc/default.nix b/pkgs/os-specific/linux/psmisc/default.nix index 2e8003ab891ab..1250b406545ef 100644 --- a/pkgs/os-specific/linux/psmisc/default.nix +++ b/pkgs/os-specific/linux/psmisc/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoconf automake gettext ]; buildInputs = [ ncurses ]; - preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + preConfigure = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' # Goes past the rpl_malloc linking failure export ac_cv_func_malloc_0_nonnull=yes export ac_cv_func_realloc_0_nonnull=yes diff --git a/pkgs/os-specific/linux/rtl8723ds/default.nix b/pkgs/os-specific/linux/rtl8723ds/default.nix index d1f7e016e3bf3..45c0a43f5b9b8 100644 --- a/pkgs/os-specific/linux/rtl8723ds/default.nix +++ b/pkgs/os-specific/linux/rtl8723ds/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { makeFlags = [ "ARCH=${stdenv.hostPlatform.linuxArch}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/rtl8812au/default.nix b/pkgs/os-specific/linux/rtl8812au/default.nix index d9fd92c4a9f09..672f5c1261ecd 100644 --- a/pkgs/os-specific/linux/rtl8812au/default.nix +++ b/pkgs/os-specific/linux/rtl8812au/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { "ARCH=${stdenv.hostPlatform.linuxArch}" ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/rtl8821au/default.nix b/pkgs/os-specific/linux/rtl8821au/default.nix index e8be48cc403c8..683fc2680e380 100644 --- a/pkgs/os-specific/linux/rtl8821au/default.nix +++ b/pkgs/os-specific/linux/rtl8821au/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation { "ARCH=${stdenv.hostPlatform.linuxArch}" ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n")) - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/rtl8852au/default.nix b/pkgs/os-specific/linux/rtl8852au/default.nix index e7b682893f855..00658723de4d0 100644 --- a/pkgs/os-specific/linux/rtl8852au/default.nix +++ b/pkgs/os-specific/linux/rtl8852au/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation { "ARCH=${stdenv.hostPlatform.linuxArch}" ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/rtl8852bu/default.nix b/pkgs/os-specific/linux/rtl8852bu/default.nix index cc0f495b8122f..afe3f4051dbe4 100644 --- a/pkgs/os-specific/linux/rtl8852bu/default.nix +++ b/pkgs/os-specific/linux/rtl8852bu/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { "ARCH=${stdenv.hostPlatform.linuxArch}" ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix index 8329e9e8f966d..4a351e8df3be7 100644 --- a/pkgs/os-specific/linux/shadow/default.nix +++ b/pkgs/os-specific/linux/shadow/default.nix @@ -10,7 +10,7 @@ }: let glibc = - if stdenv.hostPlatform != stdenv.buildPlatform then glibcCross + if (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then glibcCross else assert stdenv.hostPlatform.libc == "glibc"; stdenv.cc.libc; in @@ -92,7 +92,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - disallowedReferences = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.shellPackage; + disallowedReferences = lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) stdenv.shellPackage; meta = with lib; { homepage = "https://github.com/shadow-maint"; diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix index 68209a4e2ccbc..b752dec47588e 100644 --- a/pkgs/os-specific/linux/systemd/default.nix +++ b/pkgs/os-specific/linux/systemd/default.nix @@ -860,7 +860,7 @@ stdenv.mkDerivation (finalAttrs: { wrapProgram $out/bin/ukify --prefix PATH : ${lib.makeBinPath [ targetPackages.stdenv.cc.bintools ] }:${placeholder "out"}/lib/systemd ''; - disallowedReferences = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) + disallowedReferences = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) # 'or p' is for manually specified buildPackages as they dont have __spliced (builtins.map (p: p.__spliced.buildHost or p) finalAttrs.nativeBuildInputs); diff --git a/pkgs/os-specific/linux/udisks/2-default.nix b/pkgs/os-specific/linux/udisks/2-default.nix index 51a342aa5e92e..1a39bae60a210 100644 --- a/pkgs/os-specific/linux/udisks/2-default.nix +++ b/pkgs/os-specific/linux/udisks/2-default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-L8jr1+SJWsCizkPXC8VKDy2eVa7/FpqdB8SkBYq6vwc="; }; - outputs = [ "out" "man" "dev" ] ++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) "devdoc"; + outputs = [ "out" "man" "dev" ] ++ lib.optional (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "devdoc"; patches = [ (substituteAll { @@ -62,7 +62,7 @@ stdenv.mkDerivation rec { preConfigure = "NOCONFIGURE=1 ./autogen.sh"; configureFlags = [ - (lib.enableFeature (stdenv.buildPlatform == stdenv.hostPlatform) "gtk-doc") + (lib.enableFeature (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "gtk-doc") "--sysconfdir=/etc" "--localstatedir=/var" "--with-systemdsystemunitdir=$(out)/etc/systemd/system" diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix index e393bf1ac08e6..f12c2aedd76b3 100644 --- a/pkgs/os-specific/linux/util-linux/default.nix +++ b/pkgs/os-specific/linux/util-linux/default.nix @@ -67,7 +67,7 @@ stdenv.mkDerivation rec { "systemdsystemunitdir" "${placeholder "bin"}/lib/systemd/system/") (lib.enableFeature translateManpages "poman") "SYSCONFSTATICDIR=${placeholder "lib"}/lib" - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "scanf_cv_type_modifier=ms" ; diff --git a/pkgs/os-specific/linux/wireguard/default.nix b/pkgs/os-specific/linux/wireguard/default.nix index 8d8342cce980b..8426cf5bdb2f0 100644 --- a/pkgs/os-specific/linux/wireguard/default.nix +++ b/pkgs/os-specific/linux/wireguard/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { buildFlags = [ "module" ]; makeFlags = [ "ARCH=${stdenv.hostPlatform.linuxArch}" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/servers/clickhouse/default.nix b/pkgs/servers/clickhouse/default.nix index db112aad6038f..9c66a11183315 100644 --- a/pkgs/servers/clickhouse/default.nix +++ b/pkgs/servers/clickhouse/default.nix @@ -216,6 +216,6 @@ in mkDerivation rec { # not supposed to work on 32-bit https://github.com/ClickHouse/ClickHouse/pull/23959#issuecomment-835343685 platforms = lib.filter (x: (lib.systems.elaborate x).is64bit) (platforms.linux ++ platforms.darwin); - broken = stdenv.buildPlatform != stdenv.hostPlatform; + broken = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); }; } diff --git a/pkgs/servers/dns/bind/default.nix b/pkgs/servers/dns/bind/default.nix index 7f3b8a4a169fa..4a635ee651cb0 100644 --- a/pkgs/servers/dns/bind/default.nix +++ b/pkgs/servers/dns/bind/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { "--without-lmdb" "--with-libidn2" ] ++ lib.optional enableGSSAPI "--with-gssapi=${libkrb5.dev}/bin/krb5-config" - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "BUILD_CC=$(CC_FOR_BUILD)"; + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "BUILD_CC=$(CC_FOR_BUILD)"; postInstall = '' moveToOutput bin/bind9-config $dev diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix index 5757b3255b8fe..cdcfa16450642 100644 --- a/pkgs/servers/http/nginx/generic.nix +++ b/pkgs/servers/http/nginx/generic.nix @@ -155,7 +155,7 @@ stdenv.mkDerivation { ''; }) ./nix-skip-check-logs-path.patch - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ (fetchpatch { url = "https://raw.githubusercontent.com/openwrt/packages/c057dfb09c7027287c7862afab965a4cd95293a3/net/nginx/patches/102-sizeof_test_fix.patch"; sha256 = "0i2k30ac8d7inj9l6bl0684kjglam2f68z8lf3xggcc2i5wzhh8a"; diff --git a/pkgs/servers/mail/dovecot/default.nix b/pkgs/servers/mail/dovecot/default.nix index 185f38d2e0be8..219bf38928abb 100644 --- a/pkgs/servers/mail/dovecot/default.nix +++ b/pkgs/servers/mail/dovecot/default.nix @@ -85,7 +85,7 @@ stdenv.mkDerivation rec { "--with-ldap" "--with-lucene" "--with-icu" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "i_cv_epoll_works=${if stdenv.isLinux then "yes" else "no"}" "i_cv_posix_fallocate_works=${if stdenv.isDarwin then "no" else "yes"}" "i_cv_inotify_works=${if stdenv.isLinux then "yes" else "no"}" diff --git a/pkgs/servers/mail/mlmmj/default.nix b/pkgs/servers/mail/mlmmj/default.nix index 2795ba1af358a..73f7ceef6aa4b 100644 --- a/pkgs/servers/mail/mlmmj/default.nix +++ b/pkgs/servers/mail/mlmmj/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { sha256 = "1sghqvwizvm1a9w56r34qy5njaq1c26bagj85r60h32gh3fx02bn"; }; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # AC_FUNC_MALLOC is broken on cross builds. "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" diff --git a/pkgs/servers/mail/postfix/default.nix b/pkgs/servers/mail/postfix/default.nix index 4bd224039b66a..4f91e260495f5 100644 --- a/pkgs/servers/mail/postfix/default.nix +++ b/pkgs/servers/mail/postfix/default.nix @@ -55,7 +55,7 @@ in stdenv.mkDerivation rec { }) ]; - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' sed -e 's!bin/postconf!${buildPackages.postfix}/bin/postconf!' -i postfix-install '' + '' sed -e '/^PATH=/d' -i postfix-install diff --git a/pkgs/servers/monitoring/zabbix/proxy.nix b/pkgs/servers/monitoring/zabbix/proxy.nix index b91fb94cd90ec..ab919366b8e98 100644 --- a/pkgs/servers/monitoring/zabbix/proxy.nix +++ b/pkgs/servers/monitoring/zabbix/proxy.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, pkg-config, libevent, libiconv, openssl, pcre, zlib , odbcSupport ? true, unixODBC -, snmpSupport ? stdenv.buildPlatform == stdenv.hostPlatform, net-snmp +, snmpSupport ? (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform), net-snmp , sshSupport ? true, libssh2 , sqliteSupport ? false, sqlite , mysqlSupport ? false, libmysqlclient diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix index d15b05699d630..f0e5005fbd358 100644 --- a/pkgs/servers/nosql/redis/default.nix +++ b/pkgs/servers/nosql/redis/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation (finalAttrs: { # More cross-compiling fixes. makeFlags = [ "PREFIX=${placeholder "out"}" ] - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ] + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ] ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index 331d1d3c71ac4..7e385b96f8c89 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -103,7 +103,7 @@ stdenv.mkDerivation rec { (lib.mesonBool "doxygen" false) (lib.mesonEnable "elogind" false) # gsettings does not support cross-compilation - (lib.mesonEnable "gsettings" (stdenv.isLinux && (stdenv.buildPlatform == stdenv.hostPlatform))) + (lib.mesonEnable "gsettings" (stdenv.isLinux && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform))) (lib.mesonEnable "gstreamer" false) (lib.mesonEnable "gtk" false) (lib.mesonEnable "jack" (jackaudioSupport && !libOnly)) @@ -155,7 +155,7 @@ stdenv.mkDerivation rec { cp config.h $dev/include/pulse ''; - preFixup = lib.optionalString (stdenv.isLinux && (stdenv.hostPlatform == stdenv.buildPlatform)) '' + preFixup = lib.optionalString (stdenv.isLinux && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)) '' wrapProgram $out/libexec/pulse/gsettings-helper \ --prefix XDG_DATA_DIRS : "$out/share/gsettings-schemas/${pname}-${version}" \ --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix index 4874f45d96241..c4bede32d5e81 100644 --- a/pkgs/servers/samba/4.x.nix +++ b/pkgs/servers/samba/4.x.nix @@ -102,7 +102,7 @@ stdenv.mkDerivation (finalAttrs: { rpcsvc-proto ] ++ optionals stdenv.isLinux [ buildPackages.stdenv.cc - ] ++ optional (stdenv.buildPlatform != stdenv.hostPlatform) samba # asn1_compile/compile_et + ] ++ optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) samba # asn1_compile/compile_et ++ optionals stdenv.isDarwin [ fixDarwinDylibNames ]; @@ -171,7 +171,7 @@ stdenv.mkDerivation (finalAttrs: { ++ optional enableProfiling "--with-profiling-data" ++ optional (!enableAcl) "--without-acl-support" ++ optional (!enablePam) "--without-pam" - ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ++ optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--bundled-libraries=!asn1_compile,!compile_et" "--cross-compile" "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}" @@ -199,7 +199,7 @@ stdenv.mkDerivation (finalAttrs: { # Save asn1_compile and compile_et so they are available to run on the build # platform when cross-compiling - postInstall = optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' mkdir -p "$dev/bin" cp bin/asn1_compile bin/compile_et "$dev/bin" ''; diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 70ac95a3ae179..4ab49ac0bacfb 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -22,7 +22,7 @@ let }: let - isCross = stdenv.buildPlatform != stdenv.hostPlatform; + isCross = (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); libExt = stdenv.hostPlatform.extensions.sharedLibrary; diff --git a/pkgs/servers/sql/postgresql/generic.nix b/pkgs/servers/sql/postgresql/generic.nix index 9104396a3f8c7..0ada75230e2f2 100644 --- a/pkgs/servers/sql/postgresql/generic.nix +++ b/pkgs/servers/sql/postgresql/generic.nix @@ -266,7 +266,7 @@ let # resulting LLVM IR isn't platform-independent this doesn't give you much. # In fact, I tried to test the result in a VM-test, but as soon as JIT was used to optimize # a query, postgres would coredump with `Illegal instruction`. - broken = (jitSupport && stdenv.hostPlatform != stdenv.buildPlatform) + broken = (jitSupport && (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)) # Allmost all tests fail FATAL errors for v12 and v13 || (jitSupport && stdenv.hostPlatform.isMusl && olderThan "14"); }; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index cd7e116c17d59..a62ebdc482441 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -14,7 +14,7 @@ let inherit (stdenv) isDarwin; malloc0ReturnsNullCrossFlag = lib.optional - (stdenv.hostPlatform != stdenv.buildPlatform) + (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "--enable-malloc0returnsnull"; addMainProgram = pkg: { mainProgram ? pkg.pname }: pkg.overrideAttrs (attrs: { @@ -241,7 +241,7 @@ self: super: buildInputs = attrs.buildInputs ++ [ libxcrypt ]; configureFlags = attrs.configureFlags or [] ++ [ "ac_cv_path_RAWCPP=${stdenv.cc.targetPrefix}cpp" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) # checking for /dev/urandom... configure: error: cannot check for file existence when cross compiling [ "ac_cv_file__dev_urandom=true" "ac_cv_file__dev_random=true" ]; meta = attrs.meta // { mainProgram = "xdm"; }; @@ -323,7 +323,7 @@ self: super: libXi = super.libXi.overrideAttrs (attrs: { outputs = [ "out" "dev" "man" "doc" ]; propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ xorg.libXfixes xorg.libXext ]; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "xorg_cv_malloc0_returns_null=no" ] ++ lib.optional stdenv.hostPlatform.isStatic "--disable-shared"; }); diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix index 25798533113c8..098f28101d61f 100644 --- a/pkgs/shells/bash/5.nix +++ b/pkgs/shells/bash/5.nix @@ -76,7 +76,7 @@ stdenv.mkDerivation rec { # do the same. "--without-bash-malloc" (if interactive then "--with-installed-readline" else "--disable-readline") - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "bash_cv_job_control_missing=nomissing" "bash_cv_sys_named_pipes=nomissing" "bash_cv_getcwd_malloc=yes" diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix index 921e0fc6d7fe6..e3a8171aab623 100644 --- a/pkgs/shells/fish/default.nix +++ b/pkgs/shells/fish/default.nix @@ -224,7 +224,7 @@ let # was clobbering the PATH. It probably needs to be fixed at a lower level. preConfigure = '' patchShebangs ./build_tools/git_version_gen.sh - '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' export CMAKE_PREFIX_PATH= ''; diff --git a/pkgs/shells/oksh/default.nix b/pkgs/shells/oksh/default.nix index 391ccab4ea5f0..10ead9a40a856 100644 --- a/pkgs/shells/oksh/default.nix +++ b/pkgs/shells/oksh/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { strictDeps = true; - postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace configure --replace "./conftest" "echo" ''; diff --git a/pkgs/shells/zsh/default.nix b/pkgs/shells/zsh/default.nix index c04d4d4bd6724..0cbd4274faa02 100644 --- a/pkgs/shells/zsh/default.nix +++ b/pkgs/shells/zsh/default.nix @@ -109,7 +109,7 @@ else fi fi EOF - ${if stdenv.hostPlatform == stdenv.buildPlatform then '' + ${if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then '' $out/bin/zsh -c "zcompile $out/etc/zshenv" '' else '' ${lib.getBin buildPackages.zsh}/bin/zsh -c "zcompile $out/etc/zshenv" diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index af68bf890ed29..dc15c245a7df8 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -202,7 +202,7 @@ let , doInstallCheck ? config.doCheckByDefault or false , # TODO(@Ericson2314): Make always true and remove / resolve #178468 - strictDeps ? if config.strictDepsByDefault then true else stdenv.hostPlatform != stdenv.buildPlatform + strictDeps ? if config.strictDepsByDefault then true else (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , enableParallelBuilding ? config.enableParallelBuildingByDefault diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index 6a0b11a6cc974..b7739d7a39275 100644 --- a/pkgs/test/cc-wrapper/default.nix +++ b/pkgs/test/cc-wrapper/default.nix @@ -3,7 +3,7 @@ let # Sanitizers are not supported on Darwin. # Sanitizer headers aren't available in older libc++ stdenvs due to a bug - sanitizersWorking = (stdenv.buildPlatform == stdenv.hostPlatform) && !stdenv.isDarwin && !stdenv.hostPlatform.isMusl && ( + sanitizersWorking = (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && !stdenv.isDarwin && !stdenv.hostPlatform.isMusl && ( (stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion stdenv.cc.name) "5.0.0") || (stdenv.cc.isGNU && stdenv.isLinux) ); diff --git a/pkgs/tools/admin/colmena/default.nix b/pkgs/tools/admin/colmena/default.nix index 57cd7e88eba1d..6dda62862546f 100644 --- a/pkgs/tools/admin/colmena/default.nix +++ b/pkgs/tools/admin/colmena/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { NIX_EVAL_JOBS = "${nix-eval-jobs}/bin/nix-eval-jobs"; - postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + postInstall = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' installShellCompletion --cmd colmena \ --bash <($out/bin/colmena gen-completions bash) \ --zsh <($out/bin/colmena gen-completions zsh) \ diff --git a/pkgs/tools/archivers/cabextract/default.nix b/pkgs/tools/archivers/cabextract/default.nix index 6860b52267717..fe4216bbf919c 100644 --- a/pkgs/tools/archivers/cabextract/default.nix +++ b/pkgs/tools/archivers/cabextract/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { # Let's assume that fnmatch works for cross-compilation, otherwise it gives an error: # undefined reference to `rpl_fnmatch'. - configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ac_cv_func_fnmatch_works=yes" ]; diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index 3ced84bed025f..6f7ef74226e7e 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { # I think this is a typo and should be CXX? Either way let's kill it sed -i '/XX=\/usr/d' makefile.macosx_llvm_64bits - '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace makefile.machine \ --replace 'CC=gcc' 'CC=${stdenv.cc.targetPrefix}gcc' \ --replace 'CXX=g++' 'CXX=${stdenv.cc.targetPrefix}g++' diff --git a/pkgs/tools/backup/bacula/default.nix b/pkgs/tools/backup/bacula/default.nix index f8ec672710f5b..b39a20509d324 100644 --- a/pkgs/tools/backup/bacula/default.nix +++ b/pkgs/tools/backup/bacula/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { "--with-logdir=/var/log/bacula" "--with-working-dir=/var/lib/bacula" "--mandir=\${out}/share/man" - ] ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "ac_cv_func_setpgrp_void=yes"; + ] ++ lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "ac_cv_func_setpgrp_void=yes"; installFlags = [ "logdir=\${out}/logdir" diff --git a/pkgs/tools/backup/restic/default.nix b/pkgs/tools/backup/restic/default.nix index 5f1ff957b6346..f734da8f4853a 100644 --- a/pkgs/tools/backup/restic/default.nix +++ b/pkgs/tools/backup/restic/default.nix @@ -31,7 +31,7 @@ buildGoModule rec { postInstall = '' wrapProgram $out/bin/restic --prefix PATH : '${rclone}/bin' - '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + '' + lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' $out/bin/restic generate \ --bash-completion restic.bash \ --fish-completion restic.fish \ diff --git a/pkgs/tools/cd-dvd/cdrkit/default.nix b/pkgs/tools/cd-dvd/cdrkit/default.nix index ae4a06bb57f2b..a3e21284f50d6 100644 --- a/pkgs/tools/cd-dvd/cdrkit/default.nix +++ b/pkgs/tools/cd-dvd/cdrkit/default.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { ln -s $out/bin/wodim $out/bin/cdrecord ''; - cmakeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-DBITFIELDS_HTOL=0" ]; + cmakeFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "-DBITFIELDS_HTOL=0" ]; makeFlags = [ "PREFIX=\$(out)" ]; diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix index d42866cdda9f9..44bdf0be6a08b 100644 --- a/pkgs/tools/compression/zstd/default.nix +++ b/pkgs/tools/compression/zstd/default.nix @@ -5,8 +5,8 @@ , static ? stdenv.hostPlatform.isStatic # generates static libraries *only* , enableStatic ? static # these need to be ran on the host, thus disable when cross-compiling -, buildContrib ? stdenv.hostPlatform == stdenv.buildPlatform -, doCheck ? stdenv.hostPlatform == stdenv.buildPlatform +, buildContrib ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) +, doCheck ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , nix-update-script # for passthru.tests diff --git a/pkgs/tools/filesystems/mtdutils/default.nix b/pkgs/tools/filesystems/mtdutils/default.nix index 405cecfd6e644..f4053b139e52c 100644 --- a/pkgs/tools/filesystems/mtdutils/default.nix +++ b/pkgs/tools/filesystems/mtdutils/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { "AR:=$(AR)" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); outputs = [ "out" "dev" ]; diff --git a/pkgs/tools/filesystems/squashfs/default.nix b/pkgs/tools/filesystems/squashfs/default.nix index ae658330b2801..cb1838e5b5bc2 100644 --- a/pkgs/tools/filesystems/squashfs/default.nix +++ b/pkgs/tools/filesystems/squashfs/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { strictDeps = true; nativeBuildInputs = [ which ] # when cross-compiling help2man cannot run the cross-compiled binary - ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ help2man ]; + ++ lib.optionals (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ help2man ]; buildInputs = [ zlib xz zstd lz4 lzo ]; preBuild = '' diff --git a/pkgs/tools/graphics/argyllcms/default.nix b/pkgs/tools/graphics/argyllcms/default.nix index efb77b89a64bf..da1cbc3b856d4 100644 --- a/pkgs/tools/graphics/argyllcms/default.nix +++ b/pkgs/tools/graphics/argyllcms/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { } ); - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' substituteInPlace Jambase \ --replace "-m64" "" ''; diff --git a/pkgs/tools/graphics/optipng/default.nix b/pkgs/tools/graphics/optipng/default.nix index 070ac7d4f9306..9a73aafd04050 100644 --- a/pkgs/tools/graphics/optipng/default.nix +++ b/pkgs/tools/graphics/optipng/default.nix @@ -29,11 +29,11 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-system-zlib" "--with-system-libpng" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ #"-prefix=$out" ]; - postInstall = if stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.isWindows then '' + postInstall = if (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && stdenv.hostPlatform.isWindows then '' mv "$out"/bin/optipng{,.exe} '' else null; diff --git a/pkgs/tools/graphics/scanbd/default.nix b/pkgs/tools/graphics/scanbd/default.nix index 3f2331a0de04d..770f45877f617 100644 --- a/pkgs/tools/graphics/scanbd/default.nix +++ b/pkgs/tools/graphics/scanbd/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { "--enable-udev" "--with-scanbdconfdir=/etc/scanbd" "--with-systemdsystemunitdir=$out/lib/systemd/system" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # AC_FUNC_MALLOC is broken on cross builds. "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix index 8e051b798f33a..8bd9c3e67e75d 100644 --- a/pkgs/tools/misc/coreutils/default.nix +++ b/pkgs/tools/misc/coreutils/default.nix @@ -28,7 +28,7 @@ assert selinuxSupport -> libselinux != null && libsepol != null; let inherit (lib) concatStringsSep isString optional optionals optionalString; - isCross = (stdenv.hostPlatform != stdenv.buildPlatform); + isCross = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in stdenv.mkDerivation rec { pname = "coreutils" + (optionalString (!minimal) "-full"); diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix index 09138dada7631..9de8d689f032f 100644 --- a/pkgs/tools/misc/file/default.nix +++ b/pkgs/tools/misc/file/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) file; + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) file; buildInputs = [ zlib ] ++ lib.optional stdenv.hostPlatform.isWindows libgnurx; diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix index cfa4105cda0d4..9a6bda1e20536 100644 --- a/pkgs/tools/misc/findutils/default.nix +++ b/pkgs/tools/misc/findutils/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { && !stdenv.hostPlatform.isFreeBSD && !(stdenv.hostPlatform.libc == "glibc" && stdenv.hostPlatform.isi686) && (stdenv.hostPlatform.libc != "musl") - && stdenv.hostPlatform == stdenv.buildPlatform; + && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); outputs = [ "out" "info" "locate"]; diff --git a/pkgs/tools/misc/grub/default.nix b/pkgs/tools/misc/grub/default.nix index ce58f6ea0a18a..1f1bd8eca3171 100644 --- a/pkgs/tools/misc/grub/default.nix +++ b/pkgs/tools/misc/grub/default.nix @@ -142,7 +142,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-grub-mount" # dep of os-prober - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # grub doesn't do cross-compilation as usual and tries to use unprefixed # tools to target the host. Provide toolchain information explicitly for # cross builds. diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix index 9e717cad275ab..a69e5edff7418 100644 --- a/pkgs/tools/misc/man-db/default.nix +++ b/pkgs/tools/misc/man-db/default.nix @@ -75,7 +75,7 @@ stdenv.mkDerivation rec { done ''; - disallowedReferences = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + disallowedReferences = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ buildPackages.groff ]; diff --git a/pkgs/tools/misc/toybox/default.nix b/pkgs/tools/misc/toybox/default.nix index 4ef5279ef4763..9e06f050f3ba3 100644 --- a/pkgs/tools/misc/toybox/default.nix +++ b/pkgs/tools/misc/toybox/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-7izs2C5/czec0Dt3apL8s7luARAlw4PfUFy9Xsxb0zw="; }; - depsBuildBuild = optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; + depsBuildBuild = optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; buildInputs = [ libxcrypt ] ++ optionals stdenv.isDarwin [ diff --git a/pkgs/tools/networking/curl-impersonate/default.nix b/pkgs/tools/networking/curl-impersonate/default.nix index f8ec8253c6daa..9beacd835164e 100644 --- a/pkgs/tools/networking/curl-impersonate/default.nix +++ b/pkgs/tools/networking/curl-impersonate/default.nix @@ -57,7 +57,7 @@ let strictDeps = true; - depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + depsBuildBuild = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ buildPackages.stdenv.cc ]; diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 154156e89463f..c37b0cc03ac47 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -11,7 +11,7 @@ # the "mig" tool does not configure its compiler correctly. This could be # fixed in mig, but losing gss support on cross compilation to darwin is # not worth the effort. - !(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform)) + !(isDarwin && (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)) ), libkrb5 , http2Support ? true, nghttp2 , http3Support ? false, nghttp3, ngtcp2 @@ -143,7 +143,7 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}" # For the 'urandom', maybe it should be a cross-system option - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "--with-random=/dev/urandom" ++ lib.optionals stdenv.hostPlatform.isWindows [ "--disable-shared" diff --git a/pkgs/tools/networking/hping/default.nix b/pkgs/tools/networking/hping/default.nix index 528bf11e7d94d..e9a06fb01f8ea 100644 --- a/pkgs/tools/networking/hping/default.nix +++ b/pkgs/tools/networking/hping/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { '' + lib.optionalString stdenv.isLinux '' sed -i -e 's|#include |#include |' \ libpcap_stuff.c script.c - '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace configure --replace 'BYTEORDER=`./byteorder -m`' BYTEORDER=${ { littleEndian = "__LITTLE_ENDIAN_BITFIELD"; diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix index cbd327b07297d..b07ebb41cdc4f 100644 --- a/pkgs/tools/networking/inetutils/default.nix +++ b/pkgs/tools/networking/inetutils/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { # https://lists.gnu.org/archive/html/bug-sed/2017-01/msg00001.html # https://git.congatec.com/yocto/meta-openembedded/blob/3402bfac6b595c622e4590a8ff5eaaa854e2a2a3/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.1.bb#L44 preConfigure = let - isCross = stdenv.hostPlatform != stdenv.buildPlatform; + isCross = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in lib.optionalString isCross '' export HELP2MAN=true ''; diff --git a/pkgs/tools/networking/networkmanager/default.nix b/pkgs/tools/networking/networkmanager/default.nix index 22d774f086bcc..53974c89e283e 100644 --- a/pkgs/tools/networking/networkmanager/default.nix +++ b/pkgs/tools/networking/networkmanager/default.nix @@ -113,7 +113,7 @@ stdenv.mkDerivation rec { # Miscellaneous # almost cross-compiles, however fails with # ** (process:9234): WARNING **: Failed to load shared library '/nix/store/...-networkmanager-aarch64-unknown-linux-gnu-1.38.2/lib/libnm.so.0' referenced by the typelib: /nix/store/...-networkmanager-aarch64-unknown-linux-gnu-1.38.2/lib/libnm.so.0: cannot open shared object file: No such file or directory - "-Ddocs=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}" + "-Ddocs=${lib.boolToString (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform)}" # We don't use firewalld in NixOS "-Dfirewalld_zone=false" "-Dtests=no" @@ -200,7 +200,7 @@ stdenv.mkDerivation rec { ln -s $PWD/src/libnm-client-impl/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0 ''; - postFixup = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postFixup = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' cp -r ${buildPackages.networkmanager.devdoc} $devdoc cp -r ${buildPackages.networkmanager.man} $man ''; diff --git a/pkgs/tools/networking/openconnect/common.nix b/pkgs/tools/networking/openconnect/common.nix index fa54eecb89e15..c63693f711102 100644 --- a/pkgs/tools/networking/openconnect/common.nix +++ b/pkgs/tools/networking/openconnect/common.nix @@ -15,7 +15,7 @@ , zlib , vpnc-scripts , PCSC -, useDefaultExternalBrowser ? stdenv.isLinux && stdenv.buildPlatform == stdenv.hostPlatform # xdg-utils doesn't cross-compile +, useDefaultExternalBrowser ? stdenv.isLinux && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) # xdg-utils doesn't cross-compile , xdg-utils , autoreconfHook }: diff --git a/pkgs/tools/networking/openssh/common.nix b/pkgs/tools/networking/openssh/common.nix index 7196ceeebaadf..130a47d6d1f02 100644 --- a/pkgs/tools/networking/openssh/common.nix +++ b/pkgs/tools/networking/openssh/common.nix @@ -114,7 +114,7 @@ stdenv.mkDerivation { doCheck = true; enableParallelChecking = false; nativeCheckInputs = [ openssl ] ++ lib.optional (!stdenv.isDarwin) hostname; - preCheck = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' + preCheck = lib.optionalString (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # construct a dummy HOME export HOME=$(realpath ../dummy-home) mkdir -p ~/.ssh diff --git a/pkgs/tools/networking/rp-pppoe/default.nix b/pkgs/tools/networking/rp-pppoe/default.nix index e58c257668106..41101c4404852 100644 --- a/pkgs/tools/networking/rp-pppoe/default.nix +++ b/pkgs/tools/networking/rp-pppoe/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { export PPPD=${ppp}/sbin/pppd ''; - configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "rpppoe_cv_pack_bitfields=rev" ]; + configureFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "rpppoe_cv_pack_bitfields=rev" ]; postConfigure = '' sed -i Makefile -e 's@DESTDIR)/etc/ppp@out)/etc/ppp@' diff --git a/pkgs/tools/networking/tcpdump/default.nix b/pkgs/tools/networking/tcpdump/default.nix index 996466901201d..f7104be6d733d 100644 --- a/pkgs/tools/networking/tcpdump/default.nix +++ b/pkgs/tools/networking/tcpdump/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { buildInputs = [ libpcap ]; - configureFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "ac_cv_linux_vers=2"; + configureFlags = lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "ac_cv_linux_vers=2"; meta = with lib; { description = "Network sniffer"; diff --git a/pkgs/tools/networking/zerotierone/default.nix b/pkgs/tools/networking/zerotierone/default.nix index fa2c86d6f83a9..d48e67244a154 100644 --- a/pkgs/tools/networking/zerotierone/default.nix +++ b/pkgs/tools/networking/zerotierone/default.nix @@ -80,7 +80,7 @@ in stdenv.mkDerivation { buildFlags = [ "all" "selftest" ]; - doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + doCheck = (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); checkPhase = '' runHook preCheck ./zerotier-selftest diff --git a/pkgs/tools/package-management/apk-tools/default.nix b/pkgs/tools/package-management/apk-tools/default.nix index 55a406d595695..eead88ff013d5 100644 --- a/pkgs/tools/package-management/apk-tools/default.nix +++ b/pkgs/tools/package-management/apk-tools/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitLab, pkg-config, scdoc, openssl, zlib -, luaSupport ? stdenv.hostPlatform == stdenv.buildPlatform, lua +, luaSupport ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), lua }: stdenv.mkDerivation rec { diff --git a/pkgs/tools/package-management/lix/common.nix b/pkgs/tools/package-management/lix/common.nix index e0d504774235c..2975198deb735 100644 --- a/pkgs/tools/package-management/lix/common.nix +++ b/pkgs/tools/package-management/lix/common.nix @@ -66,7 +66,7 @@ assert (hash == null) -> (src != null); xz, nixosTests, - enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, + enableDocumentation ? (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform), enableStatic ? stdenv.hostPlatform.isStatic, withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp, diff --git a/pkgs/tools/package-management/nix/common.nix b/pkgs/tools/package-management/nix/common.nix index 22b1cb817b691..183f9b6f2a4a4 100644 --- a/pkgs/tools/package-management/nix/common.nix +++ b/pkgs/tools/package-management/nix/common.nix @@ -72,7 +72,7 @@ in , util-linuxMinimal , xz -, enableDocumentation ? !atLeast24 || stdenv.hostPlatform == stdenv.buildPlatform +, enableDocumentation ? !atLeast24 || (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) , enableStatic ? stdenv.hostPlatform.isStatic , withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp , withLibseccomp ? lib.meta.availableOn stdenv.hostPlatform libseccomp, libseccomp @@ -219,7 +219,7 @@ self = stdenv.mkDerivation { # old style or LTO builds will run their linking on only one thread, which takes forever. "--jobserver-style=pipe" "profiledir=$(out)/etc/profile.d" - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "PRECOMPILE_HEADERS=0" + ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "PRECOMPILE_HEADERS=0" ++ lib.optional (stdenv.hostPlatform.isDarwin) "PRECOMPILE_HEADERS=1"; installFlags = [ "sysconfdir=$(out)/etc" ]; diff --git a/pkgs/tools/security/hashcat/default.nix b/pkgs/tools/security/hashcat/default.nix index 56399e61639e4..026bd05179fc5 100644 --- a/pkgs/tools/security/hashcat/default.nix +++ b/pkgs/tools/security/hashcat/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { "VERSION_TAG=${version}" "USE_SYSTEM_OPENCL=1" "USE_SYSTEM_XXHASH=1" - ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform == stdenv.buildPlatform) [ + ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)) [ "IS_APPLE_SILICON='${if stdenv.hostPlatform.isAarch64 then "1" else "0"}'" ]; diff --git a/pkgs/tools/security/nmap/default.nix b/pkgs/tools/security/nmap/default.nix index 9280abbcfb5d0..fd50f01b2b0a7 100644 --- a/pkgs/tools/security/nmap/default.nix +++ b/pkgs/tools/security/nmap/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { install -m 444 -D nselib/data/passwords.lst $out/share/wordlists/nmap.lst ''; - makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + makeFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "AR=${stdenv.cc.bintools.targetPrefix}ar" "RANLIB=${stdenv.cc.bintools.targetPrefix}ranlib" "CC=${stdenv.cc.targetPrefix}gcc" diff --git a/pkgs/tools/security/opensc/default.nix b/pkgs/tools/security/opensc/default.nix index b767261b4e0a8..30e320d7b12f9 100644 --- a/pkgs/tools/security/opensc/default.nix +++ b/pkgs/tools/security/opensc/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { else "${lib.getLib pcsclite}/lib/libpcsclite${stdenv.hostPlatform.extensions.sharedLibrary}" }" - (lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) + (lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "XSLTPROC=${buildPackages.libxslt}/bin/xsltproc") ]; diff --git a/pkgs/tools/security/tor/default.nix b/pkgs/tools/security/tor/default.nix index 30eb8360fe391..7e70b74676421 100644 --- a/pkgs/tools/security/tor/default.nix +++ b/pkgs/tools/security/tor/default.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation rec { [ "--enable-gpl" ] ++ # cross compiles correctly but needs the following - lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--disable-tool-name-check" ] + lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "--disable-tool-name-check" ] ++ # sandbox is broken on aarch64-linux https://gitlab.torproject.org/tpo/core/tor/-/issues/40599 lib.optionals (stdenv.isLinux && stdenv.isAarch64) [ "--disable-seccomp" ] diff --git a/pkgs/tools/system/collectd/default.nix b/pkgs/tools/system/collectd/default.nix index bbcc9f704bc48..42bd467cd7005 100644 --- a/pkgs/tools/system/collectd/default.nix +++ b/pkgs/tools/system/collectd/default.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation rec { "--localstatedir=/var" "--disable-werror" ] ++ plugins.configureFlags - ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "--with-fp-layout=nothing" ]; + ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "--with-fp-layout=nothing" ]; # do not create directories in /var during installPhase postConfigure = '' diff --git a/pkgs/tools/system/freeipmi/default.nix b/pkgs/tools/system/freeipmi/default.nix index 9fe830aa4d519..10ce562229bc1 100644 --- a/pkgs/tools/system/freeipmi/default.nix +++ b/pkgs/tools/system/freeipmi/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = [ libgcrypt readline libgpg-error ]; - configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) + configureFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "ac_cv_file__dev_urandom=true" "ac_cv_file__dev_random=true" ]; doCheck = true; diff --git a/pkgs/tools/system/monit/default.nix b/pkgs/tools/system/monit/default.nix index 49db2fae93d9b..a3816d4338e0a 100644 --- a/pkgs/tools/system/monit/default.nix +++ b/pkgs/tools/system/monit/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { "--with-ssl-lib-dir=${lib.getLib openssl}/lib" ] else [ "--without-ssl" - ]) ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + ]) ++ lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ # will need to check both these are true for musl "libmonit_cv_setjmp_available=yes" "libmonit_cv_vsnprintf_c99_conformant=yes" diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index b2461760da701..98558e9e37715 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -143,7 +143,7 @@ stdenv.mkDerivation rec { }; meta = with lib; { - broken = stdenv.isDarwin || stdenv.buildPlatform != stdenv.hostPlatform; + broken = stdenv.isDarwin || (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform); description = "Real-time performance monitoring tool"; homepage = "https://www.netdata.cloud/"; changelog = "https://github.com/netdata/netdata/releases/tag/v${version}"; diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix index 6c1bc8bf01f13..a45bdb2971eba 100644 --- a/pkgs/tools/text/diffutils/default.nix +++ b/pkgs/tools/text/diffutils/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { # "pr" need not be on the PATH as a run-time dep, so we need to tell # configure where it is. Covers the cross and native case alike. lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr" - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "gl_cv_func_getopt_gnu=yes"; + ++ lib.optional (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) "gl_cv_func_getopt_gnu=yes"; # Test failure on QEMU only (#300550) doCheck = !stdenv.buildPlatform.isRiscV64; diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix index c19e087ea5478..dcc0d9e0a93ff 100644 --- a/pkgs/tools/text/gnupatch/default.nix +++ b/pkgs/tools/text/gnupatch/default.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; - configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "ac_cv_func_strnlen_working=yes" ]; diff --git a/pkgs/tools/text/gnused/default.nix b/pkgs/tools/text/gnused/default.nix index bc736f418725b..819e79c20c687 100644 --- a/pkgs/tools/text/gnused/default.nix +++ b/pkgs/tools/text/gnused/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { preConfigure = "patchShebangs ./build-aux/help2man"; # Prevents attempts of running 'help2man' on cross-built binaries. - PERL = if stdenv.hostPlatform == stdenv.buildPlatform then null else "missing"; + PERL = if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then null else "missing"; meta = { homepage = "https://www.gnu.org/software/sed/"; diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix index 6e10144bb587c..a516d49465763 100644 --- a/pkgs/tools/text/groff/default.nix +++ b/pkgs/tools/text/groff/default.nix @@ -66,11 +66,11 @@ stdenv.mkDerivation rec { "--with-gs=${lib.getBin ghostscript}/bin/gs" "--with-awk=${lib.getBin gawk}/bin/gawk" "--with-appresdir=${placeholder "out"}/lib/X11/app-defaults" - ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + ] ++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ "gl_cv_func_signbit=yes" ]; - makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ + makeFlags = lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [ # Trick to get the build system find the proper 'native' groff # http://www.mail-archive.com/bug-groff@gnu.org/msg01335.html "GROFF_BIN_PATH=${buildPackages.groff}/bin" diff --git a/pkgs/tools/text/html-tidy/default.nix b/pkgs/tools/text/html-tidy/default.nix index 16e6035cef89e..d04e17000d9ad 100644 --- a/pkgs/tools/text/html-tidy/default.nix +++ b/pkgs/tools/text/html-tidy/default.nix @@ -18,9 +18,9 @@ stdenv.mkDerivation rec { }); nativeBuildInputs = [ cmake libxslt/*manpage*/ ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) html-tidy; + ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) html-tidy; - cmakeFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ + cmakeFlags = lib.optionals (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) [ "-DHOST_TIDY=tidy" ]; diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index d20b3692f31c3..dbf180fee227a 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/pkgs/tools/text/source-highlight/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { # source-highlight uses it's own binary to generate documentation. # During cross-compilation, that binary was built for the target # platform architecture, so it can't run on the build host. - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' substituteInPlace Makefile.in --replace "src doc tests" "src tests" ''; diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix index 69b0ccff68bd0..fed48cf2b57b4 100644 --- a/pkgs/tools/typesetting/asciidoc/default.nix +++ b/pkgs/tools/typesetting/asciidoc/default.nix @@ -244,7 +244,7 @@ in python3.pkgs.buildPythonApplication rec { substituteInPlace $f --replace "2002-11-25" "1980-01-02" substituteInPlace $f --replace "00:37:42" "00:00:00" done - '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + '' + lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' # We want to use asciidoc from the build platform to build the documentation. substituteInPlace Makefile.in \ --replace "python3 -m asciidoc.a2x" "${buildPackages.asciidoc}/bin/a2x" diff --git a/pkgs/tools/typesetting/tex/texlive/bin.nix b/pkgs/tools/typesetting/tex/texlive/bin.nix index 86ac35eb78094..3f186a42fb32c 100644 --- a/pkgs/tools/typesetting/tex/texlive/bin.nix +++ b/pkgs/tools/typesetting/tex/texlive/bin.nix @@ -81,7 +81,7 @@ let # see "from TL tree" vs. "Using installed" in configure output "zziplib" "mpfr" "gmp" "pixman" "potrace" "gd" "freetype2" "libpng" "libpaper" "zlib" - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ] ++ lib.optional (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) "BUILDCC=${buildPackages.stdenv.cc.targetPrefix}cc"; # move binaries to corresponding split outputs, based on content of texlive.tlpdb diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2bfb7251126fe..fe02b20da2d4c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34,7 +34,7 @@ with pkgs; stdenvNoCC = stdenv.override ( { cc = null; hasCC = false; } - // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && (stdenv.hostPlatform != stdenv.buildPlatform)) { + // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform)) { # TODO: This is a hack to use stdenvNoCC to produce a CF when cross # compiling. It's not very sound. The cross stdenv has: # extraBuildInputs = [ targetPackages.darwin.apple_sdks.frameworks.CoreFoundation ] @@ -61,7 +61,7 @@ with pkgs; }; stdenvNoLibs = - if stdenv.hostPlatform != stdenv.buildPlatform && (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.useLLVM or false) + if (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) && (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.useLLVM or false) then # We cannot touch binutils or cc themselves, because that will cause # infinite recursion. So instead, we just choose a libc based on the @@ -964,7 +964,7 @@ with pkgs; fetchbzr = callPackage ../build-support/fetchbzr { }; - fetchcvs = if stdenv.buildPlatform != stdenv.hostPlatform + fetchcvs = if (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) # hack around splicing being crummy with things that (correctly) don't eval. then buildPackages.fetchcvs else callPackage ../build-support/fetchcvs { }; @@ -1104,7 +1104,7 @@ with pkgs; fetchtorrent = callPackage ../build-support/fetchtorrent { }; - fetchsvn = if stdenv.buildPlatform != stdenv.hostPlatform + fetchsvn = if (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) # hack around splicing being crummy with things that (correctly) don't eval. then buildPackages.fetchsvn else callPackage ../build-support/fetchsvn { }; @@ -1123,7 +1123,7 @@ with pkgs; fetchNextcloudApp = callPackage ../build-support/fetchnextcloudapp { }; # `fetchurl' downloads a file from the network. - fetchurl = if stdenv.buildPlatform != stdenv.hostPlatform + fetchurl = if (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then buildPackages.fetchurl # No need to do special overrides twice, else makeOverridable (import ../build-support/fetchurl) { inherit lib stdenvNoCC buildPackages; @@ -3381,7 +3381,7 @@ with pkgs; callPackage ../stdenv/darwin/make-bootstrap-tools.nix { localSystem = stdenv.buildPlatform; crossSystem = - if stdenv.buildPlatform == stdenv.hostPlatform then null else stdenv.hostPlatform; + if (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then null else stdenv.hostPlatform; } else if stdenv.hostPlatform.isLinux then callPackage ../stdenv/linux/make-bootstrap-tools.nix {} @@ -15507,7 +15507,7 @@ with pkgs; # The GCC used to build libc for the target platform. Normal gccs will be # built with, and use, that cross-compiled libc. - gccWithoutTargetLibc = assert stdenv.targetPlatform != stdenv.hostPlatform; let + gccWithoutTargetLibc = assert (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform); let libcCross1 = binutilsNoLibc.libc; in wrapCCWith { cc = gccFun { @@ -15674,13 +15674,13 @@ with pkgs; # should be done with a (native) compiler of the same version. # If we are cross-compiling GNAT, we may as well do the same. gnat-bootstrap = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then buildPackages.gnat-bootstrap11 else buildPackages.gnat11; stdenv = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64 then overrideCC stdenv gnat-bootstrap11 @@ -15697,13 +15697,13 @@ with pkgs; # should be done with a (native) compiler of the same version. # If we are cross-compiling GNAT, we may as well do the same. gnat-bootstrap = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then buildPackages.gnat-bootstrap12 else buildPackages.gnat12; stdenv = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64 then overrideCC stdenv gnat-bootstrap12 @@ -15720,13 +15720,13 @@ with pkgs; # should be done with a (native) compiler of the same version. # If we are cross-compiling GNAT, we may as well do the same. gnat-bootstrap = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then buildPackages.gnat-bootstrap12 else buildPackages.gnat13; stdenv = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64 then overrideCC stdenv gnat-bootstrap12 @@ -15743,13 +15743,13 @@ with pkgs; # should be done with a (native) compiler of the same version. # If we are cross-compiling GNAT, we may as well do the same. gnat-bootstrap = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) then buildPackages.gnat-bootstrap12 else buildPackages.gnat13; stdenv = - if stdenv.hostPlatform == stdenv.targetPlatform - && stdenv.buildPlatform == stdenv.hostPlatform + if (lib.systems.equals stdenv.hostPlatform stdenv.targetPlatform) + && (lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) && stdenv.buildPlatform.isDarwin && stdenv.buildPlatform.isx86_64 then overrideCC stdenv gnat-bootstrap12 @@ -16969,8 +16969,8 @@ with pkgs; , ... } @ extraArgs: callPackage ../build-support/cc-wrapper (let self = { - nativeTools = stdenv.targetPlatform == stdenv.hostPlatform && stdenv.cc.nativeTools or false; - nativeLibc = stdenv.targetPlatform == stdenv.hostPlatform && stdenv.cc.nativeLibc or false; + nativeTools = (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) && stdenv.cc.nativeTools or false; + nativeLibc = (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) && stdenv.cc.nativeLibc or false; nativePrefix = stdenv.cc.nativePrefix or ""; noLibc = !self.nativeLibc && (self.libc == null); @@ -16986,12 +16986,12 @@ with pkgs; wrapBintoolsWith = { bintools - , libc ? if stdenv.targetPlatform != stdenv.hostPlatform then libcCross else stdenv.cc.libc + , libc ? if (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) then libcCross else stdenv.cc.libc , ... } @ extraArgs: callPackage ../build-support/bintools-wrapper (let self = { - nativeTools = stdenv.targetPlatform == stdenv.hostPlatform && stdenv.cc.nativeTools or false; - nativeLibc = stdenv.targetPlatform == stdenv.hostPlatform && stdenv.cc.nativeLibc or false; + nativeTools = (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) && stdenv.cc.nativeTools or false; + nativeLibc = (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) && stdenv.cc.nativeLibc or false; nativePrefix = stdenv.cc.nativePrefix or ""; noLibc = (self.libc == null); @@ -18107,12 +18107,12 @@ with pkgs; binutils-unwrapped = callPackage ../development/tools/misc/binutils { autoreconfHook = autoreconfHook269; # FHS sys dirs presumably only have stuff for the build platform - noSysDirs = (stdenv.targetPlatform != stdenv.hostPlatform) || noSysDirs; + noSysDirs = (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) || noSysDirs; }; binutils-unwrapped-all-targets = callPackage ../development/tools/misc/binutils { autoreconfHook = if targetPlatform.isiOS then autoreconfHook269 else autoreconfHook; # FHS sys dirs presumably only have stuff for the build platform - noSysDirs = (stdenv.targetPlatform != stdenv.hostPlatform) || noSysDirs; + noSysDirs = (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) || noSysDirs; withAllTargets = true; }; binutils = wrapBintoolsWith { @@ -18136,7 +18136,7 @@ with pkgs; binutils-unwrapped_2_38 = callPackage ../development/tools/misc/binutils/2.38 { autoreconfHook = autoreconfHook269; # FHS sys dirs presumably only have stuff for the build platform - noSysDirs = (stdenv.targetPlatform != stdenv.hostPlatform) || noSysDirs; + noSysDirs = (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) || noSysDirs; }; libbfd_2_38 = callPackage ../development/tools/misc/binutils/2.38/libbfd.nix { @@ -18461,7 +18461,7 @@ with pkgs; # This is for e.g. LLVM libraries on linux. gccForLibs = - if stdenv.targetPlatform == stdenv.hostPlatform && targetPackages.stdenv.cc.isGNU + if (lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) && targetPackages.stdenv.cc.isGNU # Can only do this is in the native case, otherwise we might get infinite # recursion if `targetPackages.stdenv.cc.cc` itself uses `gccForLibs`. then targetPackages.stdenv.cc.cc @@ -21015,7 +21015,7 @@ with pkgs; else if name == "relibc" then targetPackages.relibc or relibc else throw "Unknown libc ${name}"; - libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc; + libcCross = assert (!lib.systems.equals stdenv.targetPlatform stdenv.buildPlatform); libcCrossChooser stdenv.targetPlatform.libc; threadsCross = lib.optionalAttrs (stdenv.targetPlatform.isMinGW && !(stdenv.targetPlatform.useLLVM or false)) { @@ -22463,7 +22463,7 @@ with pkgs; # just in case you want it regardless of platform. libiconv = if lib.elem stdenv.hostPlatform.libc [ "glibc" "musl" "nblibc" "wasilibc" "fblibc" ] - then libcIconv (if stdenv.hostPlatform != stdenv.buildPlatform + then libcIconv (if (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then libcCross else stdenv.cc.libc) else if stdenv.hostPlatform.isDarwin @@ -25279,7 +25279,7 @@ with pkgs; ### DEVELOPMENT / PERL MODULES - perlInterpreters = import ../development/interpreters/perl { inherit callPackage; }; + perlInterpreters = import ../development/interpreters/perl { inherit callPackage lib; }; inherit (perlInterpreters) perl536 perl538; perl536Packages = recurseIntoAttrs perl536.pkgs; diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index cca74e047dbdd..d89fa85c0ada1 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -11,7 +11,7 @@ let # # TODO(@Ericson2314) Make unconditional, or optional but always true by # default. - targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) + targetPrefix = lib.optionalString (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) (stdenv.targetPlatform.config + "-"); # Bootstrap `fetchurl` needed to build SDK packages without causing an infinite recursion. @@ -89,7 +89,7 @@ impure-cmds // appleSourcePackages // chooseLibs // { binutils = pkgs.wrapBintoolsWith { libc = - if stdenv.targetPlatform != stdenv.hostPlatform + if (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) then pkgs.libcCross else pkgs.stdenv.cc.libc; bintools = self.binutils-unwrapped; @@ -103,7 +103,7 @@ impure-cmds // appleSourcePackages // chooseLibs // { binutilsDualAs = pkgs.wrapBintoolsWith { libc = - if stdenv.targetPlatform != stdenv.hostPlatform + if (!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform) then pkgs.libcCross else pkgs.stdenv.cc.libc; bintools = self.binutilsDualAs-unwrapped; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 04c2c05dadbb7..efdcbd57e0b15 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -9395,7 +9395,7 @@ with self; { hash = "sha256-TH1g4m2iwH8Fik40UCHpJQUnOzPJVCIVl34IRhHwns8="; }; buildInputs = [ FCGIClient ]; - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' sed -i '/use IO::File/d' Makefile.PL ''; meta = { @@ -13360,7 +13360,7 @@ with self; { hash = "sha256-34tRQ9mn3pnEe1XxoXC9H2n3EZNcGGptwKtW3QV1jjU="; }; # Do not abort cross-compilation on failure to load native JSON module into host perl - preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + preConfigure = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace Makefile.PL --replace "exit 0;" "" ''; buildInputs = [ TestPod ]; @@ -14690,7 +14690,7 @@ with self; { export NO_NETWORK_TESTING=1 ''; # support cross-compilation by avoiding using `has_module` which does not work in miniperl (it requires B native module) - postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace Makefile.PL --replace 'if has_module' 'if 0; #' ''; doCheck = !stdenv.isDarwin; @@ -16035,11 +16035,11 @@ with self; { url = "mirror://cpan/authors/id/L/LE/LEONT/Module-Build-0.4234.tar.gz"; hash = "sha256-Zq6sYSdBi+XkcerTdEZIx2a9AUgoJcW2ZlJnXyvIao8="; }; - postConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postConfigure = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # for unknown reason, the first run of Build fails ./Build || true ''; - postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) '' # remove version check since miniperl uses a stub of File::Temp, which do not provide a version: # https://github.com/arsv/perl-cross/blob/master/cnf/stub/File/Temp.pm sed -i '/File::Temp/d' \ @@ -24274,7 +24274,7 @@ with self; { }; TermReadKey = let - cross = stdenv.hostPlatform != stdenv.buildPlatform; + cross = (!lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform); in buildPerlPackage { pname = "TermReadKey"; version = "2.38"; @@ -28660,7 +28660,7 @@ with self; { hash = "sha256-0zEzJJHFHMz7TLlP/ET5zXM3jmGEmNSjffngQ2YcUV0="; }; patches = [ ../development/perl-modules/xml-parser-0001-HACK-Assumes-Expat-paths-are-good.patch ]; - postPatch = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) '' + postPatch = lib.optionalString (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) '' substituteInPlace Expat/Makefile.PL --replace 'use English;' '#' '' + lib.optionalString stdenv.isCygwin '' sed -i"" -e "s@my \$compiler = File::Spec->catfile(\$path, \$cc\[0\]) \. \$Config{_exe};@my \$compiler = File::Spec->catfile(\$path, \$cc\[0\]) \. (\$^O eq 'cygwin' ? \"\" : \$Config{_exe});@" inc/Devel/CheckLib.pm diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 087b43c3cb145..db065a9dd3b2f 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -210,7 +210,7 @@ let overlays = [ (self': super': { pkgsMusl = super'; })] ++ overlays; - ${if stdenv.hostPlatform == stdenv.buildPlatform + ${if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then "localSystem" else "crossSystem"} = { parsed = makeMuslParsedPlatform stdenv.hostPlatform.parsed; }; @@ -222,7 +222,7 @@ let overlays = [ (self': super': { pkgsi686Linux = super'; })] ++ overlays; - ${if stdenv.hostPlatform == stdenv.buildPlatform + ${if (lib.systems.equals stdenv.hostPlatform stdenv.buildPlatform) then "localSystem" else "crossSystem"} = { parsed = stdenv.hostPlatform.parsed // { cpu = lib.systems.parse.cpuTypes.i686;