diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2022-07-30 19:43:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-30 19:43:34 +0200 |
commit | 6e5cce711d76c4c5b4a2bc99cc338fd32d8c668d (patch) | |
tree | 40e9b43d1d834189f09adbb0662ebf6178ccef98 | |
parent | 6a894dc68d3fc16de7f52b235b2931a98c8e0b9b (diff) | |
parent | 153bfc996609745cd8996400575b0ec3033036dd (diff) |
Merge pull request #183997 from alyssais/isAarch
27 files changed, 35 insertions, 37 deletions
diff --git a/nixos/lib/qemu-common.nix b/nixos/lib/qemu-common.nix index 250f714be0a7a..fc3dcb24ab9c1 100644 --- a/nixos/lib/qemu-common.nix +++ b/nixos/lib/qemu-common.nix @@ -18,7 +18,7 @@ rec { ]; qemuSerialDevice = if pkgs.stdenv.hostPlatform.isx86 || pkgs.stdenv.hostPlatform.isRiscV then "ttyS0" - else if (with pkgs.stdenv.hostPlatform; isAarch32 || isAarch64 || isPower) then "ttyAMA0" + else if (with pkgs.stdenv.hostPlatform; isAarch || isPower) then "ttyAMA0" else throw "Unknown QEMU serial device for system '${pkgs.stdenv.hostPlatform.system}'"; qemuBinary = qemuPkg: { diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix index 89a1217dfb313..bd5540646b086 100644 --- a/nixos/modules/hardware/all-firmware.nix +++ b/nixos/modules/hardware/all-firmware.nix @@ -62,7 +62,7 @@ in { alsa-firmware sof-firmware libreelec-dvb-firmware - ] ++ optional (pkgs.stdenv.hostPlatform.isAarch32 || pkgs.stdenv.hostPlatform.isAarch64) raspberrypiWirelessFirmware + ] ++ optional pkgs.stdenv.hostPlatform.isAarch raspberrypiWirelessFirmware ++ optionals (versionOlder config.boot.kernelPackages.kernel.version "4.13") [ rtl8723bs-firmware ] ++ optionals (versionOlder config.boot.kernelPackages.kernel.version "5.16") [ diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index d1ccc6c2072f7..9309fe70a8618 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -476,9 +476,9 @@ in isoImage.squashfsCompression = mkOption { default = with pkgs.stdenv.targetPlatform; "xz -Xdict-size 100% " - + lib.optionalString (isx86_32 || isx86_64) "-Xbcj x86" + + lib.optionalString isx86 "-Xbcj x86" # Untested but should also reduce size for these platforms - + lib.optionalString (isAarch32 || isAarch64) "-Xbcj arm" + + lib.optionalString isAarch "-Xbcj arm" + lib.optionalString (isPower && is32bit && isBigEndian) "-Xbcj powerpc" + lib.optionalString (isSparc) "-Xbcj sparc"; description = '' diff --git a/nixos/modules/profiles/all-hardware.nix b/nixos/modules/profiles/all-hardware.nix index 8347453d403b4..af1e3d32a0a29 100644 --- a/nixos/modules/profiles/all-hardware.nix +++ b/nixos/modules/profiles/all-hardware.nix @@ -57,7 +57,7 @@ in # Hyper-V support. "hv_storvsc" - ] ++ lib.optionals (pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64) [ + ] ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch [ # Most of the following falls into two categories: # - early KMS / early display # - early storage (e.g. USB) support diff --git a/nixos/modules/services/home-automation/home-assistant.nix b/nixos/modules/services/home-automation/home-assistant.nix index 2cff5051c757f..1d76d2fd39c68 100644 --- a/nixos/modules/services/home-automation/home-assistant.nix +++ b/nixos/modules/services/home-automation/home-assistant.nix @@ -92,7 +92,7 @@ in { "default_config" "met" "esphome" - ] ++ optionals (pkgs.stdenv.hostPlatform.isAarch32 || pkgs.stdenv.hostPlatform.isAarch64) [ + ] ++ optionals pkgs.stdenv.hostPlatform.isAarch [ # Use the platform as an indicator that we might be running on a RaspberryPi and include # relevant components "rpi_power" diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index e87f540fd57cb..5b2d81eeb68fc 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -870,7 +870,7 @@ in (mkIf pkgs.stdenv.hostPlatform.isx86 [ "-usb" "-device usb-tablet,bus=usb-bus.0" ]) - (mkIf (pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64) [ + (mkIf pkgs.stdenv.hostPlatform.isAarch [ "-device virtio-gpu-pci" "-device usb-ehci,id=usb0" "-device usb-kbd" "-device usb-tablet" ]) (let diff --git a/pkgs/applications/networking/instant-messengers/jami/daemon.nix b/pkgs/applications/networking/instant-messengers/jami/daemon.nix index 635cc569e86fb..f23b22022ebbd 100644 --- a/pkgs/applications/networking/instant-messengers/jami/daemon.nix +++ b/pkgs/applications/networking/instant-messengers/jami/daemon.nix @@ -48,7 +48,7 @@ let configureFlags = old.configureFlags ++ (readLinesToList ./config/ffmpeg_args_common) ++ lib.optionals stdenv.isLinux (readLinesToList ./config/ffmpeg_args_linux) - ++ lib.optionals (stdenv.isx86_32 || stdenv.isx86_64) (readLinesToList ./config/ffmpeg_args_x86); + ++ lib.optionals stdenv.hostPlatform.isx86 (readLinesToList ./config/ffmpeg_args_x86); outputs = [ "out" "doc" ]; meta = old.meta // { # undefined reference to `ff_nlmeans_init_aarch64' diff --git a/pkgs/applications/video/handbrake/default.nix b/pkgs/applications/video/handbrake/default.nix index 3c73e7f59944b..d20c6125beb2c 100644 --- a/pkgs/applications/video/handbrake/default.nix +++ b/pkgs/applications/video/handbrake/default.nix @@ -206,7 +206,7 @@ let self = stdenv.mkDerivation rec { ++ optional (!useGtk) "--disable-gtk" ++ optional useFdk "--enable-fdk-aac" ++ optional stdenv.isDarwin "--disable-xcode" - ++ optional (stdenv.isx86_32 || stdenv.isx86_64) "--harden"; + ++ optional stdenv.hostPlatform.isx86 "--harden"; # NOTE: 2018-12-27: Check NixOS HandBrake test if changing NIX_LDFLAGS = [ "-lx265" ]; diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix index 7fcf5f7a6b4ae..e870b8572d8de 100644 --- a/pkgs/applications/video/vlc/default.nix +++ b/pkgs/applications/video/vlc/default.nix @@ -80,7 +80,6 @@ let inherit (lib) optionalString optional optionals; - hostIsAarch = stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64; in stdenv.mkDerivation rec { pname = "${optionalString onlyLibVLC "lib"}vlc"; @@ -159,7 +158,7 @@ stdenv.mkDerivation rec { xcbutilkeysyms xlibsWrapper ]) - ++ optional (!hostIsAarch && !onlyLibVLC) live555 + ++ optional (!stdenv.hostPlatform.isAarch && !onlyLibVLC) live555 ++ optional jackSupport libjack2 ++ optionals chromecastSupport [ libmicrodns protobuf ] ++ optionals skins2Support (with xorg; [ @@ -184,7 +183,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - LIVE555_PREFIX = if hostIsAarch then null else live555; + LIVE555_PREFIX = if stdenv.hostPlatform.isAarch then null else live555; # vlc depends on a c11-gcc wrapper script which we don't have so we need to # set the path to the compiler diff --git a/pkgs/development/haskell-modules/configuration-arm.nix b/pkgs/development/haskell-modules/configuration-arm.nix index 2da11c87f81a6..9b7811417d9f6 100644 --- a/pkgs/development/haskell-modules/configuration-arm.nix +++ b/pkgs/development/haskell-modules/configuration-arm.nix @@ -1,8 +1,8 @@ # ARM-SPECIFIC OVERRIDES FOR THE HASKELL PACKAGE SET IN NIXPKGS # -# This extension is applied to all haskell package sets in nixpkgs -# if `stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64` -# to apply arm specific workarounds or fixes. +# This extension is applied to all haskell package sets in nixpkgs if +# `stdenv.hostPlatform.isAarch` to apply arm specific workarounds or +# fixes. # # The file is split into three parts: # diff --git a/pkgs/development/haskell-modules/default.nix b/pkgs/development/haskell-modules/default.nix index 8392e751da2d6..7bc1fa0f7e832 100644 --- a/pkgs/development/haskell-modules/default.nix +++ b/pkgs/development/haskell-modules/default.nix @@ -21,8 +21,7 @@ let inherit stdenv haskellLib ghc buildHaskellPackages extensible-self all-cabal-hashes; }; - isArm = with stdenv.hostPlatform; isAarch64 || isAarch32; - platformConfigurations = lib.optionals isArm [ + platformConfigurations = lib.optionals stdenv.hostPlatform.isAarch [ (configurationArm { inherit pkgs haskellLib; }) ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ (configurationDarwin { inherit pkgs haskellLib; }) diff --git a/pkgs/development/interpreters/j/default.nix b/pkgs/development/interpreters/j/default.nix index 7f35dcfc63597..5e67986ac105e 100644 --- a/pkgs/development/interpreters/j/default.nix +++ b/pkgs/development/interpreters/j/default.nix @@ -30,7 +30,7 @@ stdenv.mkDerivation rec { # emulating build_all.sh configuration variables jplatform = if stdenv.isDarwin then "darwin" - else if (stdenv.isAarch32 || stdenv.isAarch64) then "raspberry" + else if stdenv.hostPlatform.isAarch then "raspberry" else if stdenv.isLinux then "linux" else "unsupported"; diff --git a/pkgs/development/libraries/exiv2/default.nix b/pkgs/development/libraries/exiv2/default.nix index 7a79e597beb5b..54f42ae8db7b8 100644 --- a/pkgs/development/libraries/exiv2/default.nix +++ b/pkgs/development/libraries/exiv2/default.nix @@ -69,7 +69,7 @@ stdenv.mkDerivation rec { patchShebangs ../test/ mkdir ../test/tmp - ${lib.optionalString (stdenv.isAarch64 || stdenv.isAarch32) '' + ${lib.optionalString stdenv.hostPlatform.isAarch '' # Fix tests on arm # https://github.com/Exiv2/exiv2/issues/933 rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix index 0ed2dea0c4c0e..c1dd608f80529 100644 --- a/pkgs/development/libraries/gperftools/default.nix +++ b/pkgs/development/libraries/gperftools/default.nix @@ -29,11 +29,11 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook ]; # tcmalloc uses libunwind in a way that works correctly only on non-ARM linux - buildInputs = lib.optional (stdenv.isLinux && !(stdenv.isAarch64 || stdenv.isAarch32)) libunwind; + buildInputs = lib.optional (stdenv.isLinux && !stdenv.hostPlatform.isAarch) libunwind; # Disable general dynamic TLS on AArch to support dlopen()'ing the library: # https://bugzilla.redhat.com/show_bug.cgi?id=1483558 - configureFlags = lib.optional (stdenv.isAarch32 || stdenv.isAarch64) + configureFlags = lib.optional stdenv.hostPlatform.isAarch "--disable-general-dynamic-tls"; prePatch = lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix index 9f7f5fcb1d8fd..ec12f1031cf56 100644 --- a/pkgs/development/libraries/libdrm/default.nix +++ b/pkgs/development/libraries/libdrm/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { "-Dnm-path=${stdenv.cc.targetPrefix}nm" "-Dinstall-test-programs=true" "-Domap=true" - ] ++ lib.optionals (stdenv.isAarch32 || stdenv.isAarch64) [ + ] ++ lib.optionals stdenv.hostPlatform.isAarch [ "-Dtegra=true" "-Detnaviv=true" ]; diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix index dc2b1c40c6cbf..df248f6b4d433 100644 --- a/pkgs/development/libraries/x264/default.nix +++ b/pkgs/development/libraries/x264/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { preConfigure = lib.optionalString (stdenv.buildPlatform.isx86_64 || stdenv.hostPlatform.isi686) '' # `AS' is set to the binutils assembler, but we need nasm unset AS - '' + lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) '' + '' + lib.optionalString stdenv.hostPlatform.isAarch '' export AS=$CC ''; diff --git a/pkgs/development/python-modules/afdko/default.nix b/pkgs/development/python-modules/afdko/default.nix index 2ca94a2085a48..29593503252ad 100644 --- a/pkgs/development/python-modules/afdko/default.nix +++ b/pkgs/development/python-modules/afdko/default.nix @@ -85,7 +85,7 @@ buildPythonPackage rec { "test_filename_without_dir" "test_overwrite" "test_options" - ] ++ lib.optionals (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isRiscV) [ + ] ++ lib.optionals (stdenv.hostPlatform.isAarch || stdenv.hostPlatform.isRiscV) [ # unknown reason so far # https://github.com/adobe-type-tools/afdko/issues/1425 "test_spec" diff --git a/pkgs/development/python-modules/fastnumbers/default.nix b/pkgs/development/python-modules/fastnumbers/default.nix index 779949b38fd7d..5fd8115152f5a 100644 --- a/pkgs/development/python-modules/fastnumbers/default.nix +++ b/pkgs/development/python-modules/fastnumbers/default.nix @@ -29,7 +29,7 @@ buildPythonPackage rec { # Tests fail due to numeric precision differences on ARM # See https://github.com/SethMMorton/fastnumbers/issues/28 - doCheck = !(stdenv.isAarch64 || stdenv.isAarch32); + doCheck = !stdenv.hostPlatform.isAarch; checkInputs = [ hypothesis diff --git a/pkgs/development/python-modules/uvloop/default.nix b/pkgs/development/python-modules/uvloop/default.nix index c3b637da0670e..3e877ea1a8e02 100644 --- a/pkgs/development/python-modules/uvloop/default.nix +++ b/pkgs/development/python-modules/uvloop/default.nix @@ -48,7 +48,7 @@ buildPythonPackage rec { # Depend on pyopenssl "--deselect tests/test_tcp.py::Test_UV_TCPSSL::test_flush_before_shutdown" "--deselect tests/test_tcp.py::Test_UV_TCPSSL::test_renegotiation" - ] ++ lib.optionals (stdenv.isAarch32 || stdenv.isAarch64) [ + ] ++ lib.optionals stdenv.hostPlatform.isAarch [ # test gets stuck in epoll_pwait on hydras aarch64 builders # https://github.com/MagicStack/uvloop/issues/412 "--deselect tests/test_tcp.py::Test_AIO_TCPSSL::test_remote_shutdown_receives_trailing_data" diff --git a/pkgs/games/gemrb/default.nix b/pkgs/games/gemrb/default.nix index 947957bc3af61..b29eed160cde6 100644 --- a/pkgs/games/gemrb/default.nix +++ b/pkgs/games/gemrb/default.nix @@ -18,7 +18,7 @@ let # the GLES backend on rpi is untested as I don't have the hardware backend = - if (stdenv.isx86_32 || stdenv.isx86_64) then "OpenGL" else "GLES"; + if stdenv.hostPlatform.isx86 then "OpenGL" else "GLES"; withVLC = stdenv.isDarwin; diff --git a/pkgs/misc/screensavers/xscreensaver/default.nix b/pkgs/misc/screensavers/xscreensaver/default.nix index fcec51506a518..836714fb919a1 100644 --- a/pkgs/misc/screensavers/xscreensaver/default.nix +++ b/pkgs/misc/screensavers/xscreensaver/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { ]; # "marbling" has NEON code that mixes signed and unsigned vector types - NIX_CFLAGS_COMPILE = lib.optional (with stdenv.hostPlatform; isAarch64 || isAarch32) "-flax-vector-conversions"; + NIX_CFLAGS_COMPILE = lib.optional stdenv.hostPlatform.isAarch "-flax-vector-conversions"; postInstall = '' for bin in $out/bin/*; do diff --git a/pkgs/os-specific/linux/nmon/default.nix b/pkgs/os-specific/linux/nmon/default.nix index 9372018f5b708..41c16f9f394c0 100644 --- a/pkgs/os-specific/linux/nmon/default.nix +++ b/pkgs/os-specific/linux/nmon/default.nix @@ -13,8 +13,8 @@ stdenv.mkDerivation rec { dontUnpack = true; buildPhase = "${stdenv.cc.targetPrefix}cc -o nmon ${src} -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -lm -g -D ${ with stdenv.targetPlatform; - if isx86_32 || isx86_64 then "X86" - else if isAarch32 || isAarch64 then "ARM" + if isx86 then "X86" + else if isAarch then "ARM" else if isPower then "POWER" else "UNKNOWN" }"; diff --git a/pkgs/os-specific/linux/rtl8189es/default.nix b/pkgs/os-specific/linux/rtl8189es/default.nix index c1032473db10e..a755404e6e5d9 100644 --- a/pkgs/os-specific/linux/rtl8189es/default.nix +++ b/pkgs/os-specific/linux/rtl8189es/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { makeFlags = kernel.makeFlags ++ [ "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n")) - ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n")) + ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) ]; preInstall = '' diff --git a/pkgs/os-specific/linux/rtl8812au/default.nix b/pkgs/os-specific/linux/rtl8812au/default.nix index b385b9a27da09..30f04c1eb8b3e 100644 --- a/pkgs/os-specific/linux/rtl8812au/default.nix +++ b/pkgs/os-specific/linux/rtl8812au/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { "ARCH=${stdenv.hostPlatform.linuxArch}" "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ("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")) + ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/shells/bash/bash-completion/default.nix b/pkgs/shells/bash/bash-completion/default.nix index 75ded461ea63a..d73afa7e2a972 100644 --- a/pkgs/shells/bash/bash-completion/default.nix +++ b/pkgs/shells/bash/bash-completion/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { # - ignore test_screen because it assumes vt terminals exist checkPhase = '' pytest . \ - ${lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) "--ignore=test/t/test_gcc.py"} \ + ${lib.optionalString stdenv.hostPlatform.isAarch "--ignore=test/t/test_gcc.py"} \ --ignore=test/t/test_chsh.py \ --ignore=test/t/test_ether_wake.py \ --ignore=test/t/test_ifdown.py \ diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index 871aed59e35e5..73030e7d941e8 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -178,7 +178,7 @@ let # Except when: # - static aarch64, where compilation works, but produces segfaulting dynamically linked binaries. # - static armv7l, where compilation fails. - !((stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) && stdenv.hostPlatform.isStatic) + !(stdenv.hostPlatform.isAarch && stdenv.hostPlatform.isStatic) then supportedHardeningFlags else lib.remove "pie" supportedHardeningFlags; enabledHardeningOptions = diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 8856d41232100..c6b36677875eb 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -108,7 +108,7 @@ in { # aarch64 ghc865Binary gets SEGVs due to haskell#15449 or similar # the oldest ghc with aarch64-darwin support is 8.10.5 # Musl bindists do not exist for ghc 8.6.5, so we use 8.10.* for them - if stdenv.isAarch64 || stdenv.isAarch32 then + if stdenv.hostPlatform.isAarch then packages.ghc8107BinaryMinimal else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then # to my (@a-m-joseph) knowledge there are no newer official binaries for this platform @@ -127,7 +127,7 @@ in { bootPkgs = # aarch64 ghc8107Binary exceeds max output size on hydra # the oldest ghc with aarch64-darwin support is 8.10.5 - if stdenv.isAarch64 || stdenv.isAarch32 then + if stdenv.hostPlatform.isAarch then packages.ghc8107BinaryMinimal else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then packages.ghc8107 @@ -141,7 +141,7 @@ in { ghc923 = callPackage ../development/compilers/ghc/9.2.3.nix { bootPkgs = # aarch64 ghc8107Binary exceeds max output size on hydra - if stdenv.isAarch64 || stdenv.isAarch32 then + if stdenv.hostPlatform.isAarch then packages.ghc8107BinaryMinimal else if stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian then packages.ghc8107 |