treewide: replace stdenv.is with stdenv.hostPlatform.is (#341407)

This commit is contained in:
Emily 2024-09-24 22:10:46 +01:00 committed by GitHub
commit 492e9179ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4283 changed files with 8367 additions and 8237 deletions

View File

@ -47,7 +47,7 @@
checks = forAllSystems (system: {
tarball = jobs.${system}.tarball;
# Exclude power64 due to "libressl is not available on the requested hostPlatform" with hostPlatform being power64
} // lib.optionalAttrs (self.legacyPackages.${system}.stdenv.isLinux && !self.legacyPackages.${system}.targetPlatform.isPower64) {
} // lib.optionalAttrs (self.legacyPackages.${system}.stdenv.hostPlatform.isLinux && !self.legacyPackages.${system}.targetPlatform.isPower64) {
# Test that ensures that the nixosSystem function can accept a lib argument
# Note: prefer not to extend or modify `lib`, especially if you want to share reusable modules
# alternatives include: `import` a file, or put a custom library in an option or in `_module.args.<libname>`

View File

@ -33,7 +33,7 @@ pkgs.runCommand "nixpkgs-lib-tests-nix-${nix.version}" {
nativeBuildInputs = [
nix
pkgs.gitMinimal
] ++ lib.optional pkgs.stdenv.isLinux pkgs.inotify-tools;
] ++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.inotify-tools;
strictDeps = true;
} ''
datadir="${nix}/share"

View File

@ -13,5 +13,5 @@ mkShell {
clippy
rustfmt
]
++ lib.optional stdenv.isDarwin pkgs.libiconv;
++ lib.optional stdenv.hostPlatform.isDarwin pkgs.libiconv;
}

View File

@ -52,7 +52,7 @@ let
${lib.optionalString (pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform) ''
<!-- Pre-generated font caches -->
<cachedir>${cache}</cachedir>
${lib.optionalString (pkgs.stdenv.isx86_64 && cfg.cache32Bit) ''
${lib.optionalString (pkgs.stdenv.hostPlatform.isx86_64 && cfg.cache32Bit) ''
<cachedir>${cache32}</cachedir>
''}
''}

View File

@ -32,7 +32,7 @@ in {
config = {
assertions = [
{ assertion = isNull config.environment.ldso32 || pkgs.stdenv.isx86_64;
{ assertion = isNull config.environment.ldso32 || pkgs.stdenv.hostPlatform.isx86_64;
message = "Option environment.ldso32 currently only works on x86_64.";
}
];
@ -44,7 +44,7 @@ in {
"d /${libDir} 0755 root root - -"
"L+ /${libDir}/${ldsoBasename} - - - - ${config.environment.ldso}"
]
) ++ optionals pkgs.stdenv.isx86_64 (
) ++ optionals pkgs.stdenv.hostPlatform.isx86_64 (
if isNull config.environment.ldso32 then [
"r /${libDir32}/${ldsoBasename32} - - - - -"
] else [

View File

@ -12,7 +12,7 @@ let
# Forces 32bit pulseaudio and alsa-plugins to be built/supported for apps
# using 32bit alsa on 64bit linux.
enable32BitAlsaPlugins = cfg.support32Bit && pkgs.stdenv.isx86_64 && (pkgs.pkgsi686Linux.alsa-lib != null && pkgs.pkgsi686Linux.libpulseaudio != null);
enable32BitAlsaPlugins = cfg.support32Bit && pkgs.stdenv.hostPlatform.isx86_64 && (pkgs.pkgsi686Linux.alsa-lib != null && pkgs.pkgsi686Linux.libpulseaudio != null);
myConfigFile =

View File

@ -49,7 +49,7 @@ in {
config = mkIf cfg.enable {
environment.ldso = mkDefault stub-ld;
environment.ldso32 = mkIf pkgs.stdenv.isx86_64 (mkDefault stub-ld32);
environment.ldso32 = mkIf pkgs.stdenv.hostPlatform.isx86_64 (mkDefault stub-ld32);
};
meta.maintainers = with lib.maintainers; [ tejing ];

View File

@ -100,7 +100,7 @@ in
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.enable32Bit -> pkgs.stdenv.isx86_64;
assertion = cfg.enable32Bit -> pkgs.stdenv.hostPlatform.isx86_64;
message = "`hardware.graphics.enable32Bit` only makes sense on a 64-bit system.";
}
{
@ -112,7 +112,7 @@ in
systemd.tmpfiles.settings.graphics-driver = {
"/run/opengl-driver"."L+".argument = toString driversEnv;
"/run/opengl-driver-32" =
if pkgs.stdenv.isi686 then
if pkgs.stdenv.hostPlatform.isi686 then
{ "L+".argument = "opengl-driver"; }
else if cfg.enable32Bit then
{ "L+".argument = toString driversEnv32; }

View File

@ -52,7 +52,7 @@ in
# VMware support.
"mptspi" "vmxnet3" "vsock"
] ++ lib.optional platform.isx86 "vmw_balloon"
++ lib.optionals (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) [
++ lib.optionals (pkgs.stdenv.hostPlatform.isi686 || pkgs.stdenv.hostPlatform.isx86_64) [
"vmw_vmci" "vmwgfx" "vmw_vsock_vmci_transport"
# Hyper-V support.
@ -68,7 +68,7 @@ in
# Broadcom
"vc4"
] ++ lib.optionals pkgs.stdenv.isAarch64 [
] ++ lib.optionals pkgs.stdenv.hostPlatform.isAarch64 [
# Most of the following falls into two categories:
# - early KMS / early display
# - early storage (e.g. USB) support

View File

@ -8,7 +8,7 @@ let
pcmPlugin = cfg.jackd.enable && cfg.alsa.enable;
loopback = cfg.jackd.enable && cfg.loopback.enable;
enable32BitAlsaPlugins = cfg.alsa.support32Bit && pkgs.stdenv.isx86_64 && pkgs.pkgsi686Linux.alsa-lib != null;
enable32BitAlsaPlugins = cfg.alsa.support32Bit && pkgs.stdenv.hostPlatform.isx86_64 && pkgs.pkgsi686Linux.alsa-lib != null;
umaskNeeded = versionOlder cfg.jackd.package.version "1.9.12";
bridgeNeeded = versionAtLeast cfg.jackd.package.version "1.9.12";

View File

@ -19,7 +19,7 @@ let
'';
cfg = config.services.pipewire;
enable32BitAlsaPlugins = cfg.alsa.support32Bit
&& pkgs.stdenv.isx86_64
&& pkgs.stdenv.hostPlatform.isx86_64
&& pkgs.pkgsi686Linux.pipewire != null;
# The package doesn't output to $out/lib/pipewire directly so that the

View File

@ -80,7 +80,7 @@ in {
PrivateUsers = true;
SupplementaryGroups = lib.optional (allowSystemdJournal) "systemd-journal";
} // (optionalAttrs (!pkgs.stdenv.isAarch64) { # FIXME: figure out why this breaks on aarch64
} // (optionalAttrs (!pkgs.stdenv.hostPlatform.isAarch64) { # FIXME: figure out why this breaks on aarch64
SystemCallFilter = "@system-service";
});
};

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
let
cfg = config.services.mame;
mame = "mame${lib.optionalString pkgs.stdenv.is64bit "64"}";
mame = "mame${lib.optionalString pkgs.stdenv.hostPlatform.is64bit "64"}";
in
{
options = {

View File

@ -71,7 +71,7 @@ in
- nixpkgs.config.cudaSupport
- nixpkgs.config.rocmSupport
- if stdenv.isDarwin && stdenv.isAarch64
- if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64
IFF multiple acceleration methods are found to be enabled or if you
haven't set either `cudaSupport or rocmSupport` you will have to

View File

@ -274,7 +274,7 @@ in
CapabilityBoundingSet = "CAP_NET_ADMIN CAP_NET_RAW CAP_SETUID";
ProtectSystem = true;
# Doesn't work on i686, causing service to fail
MemoryDenyWriteExecute = !pkgs.stdenv.isi686;
MemoryDenyWriteExecute = !pkgs.stdenv.hostPlatform.isi686;
ProtectHome = true;
PrivateTmp = true;
};

View File

@ -603,8 +603,8 @@ in
reuseport = mkOption {
type = types.bool;
default = pkgs.stdenv.isLinux;
defaultText = literalExpression "pkgs.stdenv.isLinux";
default = pkgs.stdenv.hostPlatform.isLinux;
defaultText = literalExpression "pkgs.stdenv.hostPlatform.isLinux";
description = ''
Whether to enable SO_REUSEPORT on all used sockets. This lets multiple
processes bind to the same port. This speeds up operation especially

View File

@ -518,7 +518,7 @@ in
libva-utils
procps
radeontop
] ++ lib.optionals (!stdenv.isAarch64) [
] ++ lib.optionals (!stdenv.hostPlatform.isAarch64) [
# not available on aarch64-linux
intel-gpu-tools
];

View File

@ -327,7 +327,7 @@ let
setHostId = optionalString (config.networking.hostId != null) ''
hi="${config.networking.hostId}"
${if pkgs.stdenv.isBigEndian then ''
${if pkgs.stdenv.hostPlatform.isBigEndian then ''
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > /etc/hostid
'' else ''
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > /etc/hostid

View File

@ -679,7 +679,7 @@ in
# Increase numeric PID range (set directly instead of copying a one-line file from systemd)
# https://github.com/systemd/systemd/pull/12226
boot.kernel.sysctl."kernel.pid_max" = mkIf pkgs.stdenv.is64bit (lib.mkDefault 4194304);
boot.kernel.sysctl."kernel.pid_max" = mkIf pkgs.stdenv.hostPlatform.is64bit (lib.mkDefault 4194304);
services.logrotate.settings = {
"/var/log/btmp" = mapAttrs (_: mkDefault) {

View File

@ -438,7 +438,7 @@ let
hostidFile = pkgs.runCommand "gen-hostid" { preferLocalBuild = true; } ''
hi="${cfg.hostId}"
${if pkgs.stdenv.isBigEndian then ''
${if pkgs.stdenv.hostPlatform.isBigEndian then ''
echo -ne "\x''${hi:0:2}\x''${hi:2:2}\x''${hi:4:2}\x''${hi:6:2}" > $out
'' else ''
echo -ne "\x''${hi:6:2}\x''${hi:4:2}\x''${hi:2:2}\x''${hi:0:2}" > $out

View File

@ -244,7 +244,7 @@ in
};
assertions = [
{ assertion = cfg.enableNvidia && pkgs.stdenv.isx86_64 -> config.hardware.graphics.enable32Bit or false;
{ assertion = cfg.enableNvidia && pkgs.stdenv.hostPlatform.isx86_64 -> config.hardware.graphics.enable32Bit or false;
message = "Option enableNvidia on x86_64 requires 32-bit support libraries";
}];

View File

@ -605,7 +605,7 @@ in
config = lib.modules.mkIf cfg.enable {
assertions = [
{
assertion = pkgs.stdenv.isx86_64;
assertion = pkgs.stdenv.hostPlatform.isx86_64;
message = "Xen is currently not supported on ${pkgs.stdenv.hostPlatform.system}.";
}
{

View File

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "filesender";
meta = {
maintainers = with lib.maintainers; [ nhnn ];
broken = pkgs.stdenv.isAarch64; # selenium.common.exceptions.WebDriverException: Message: Unsupported platform/architecture combination: linux/aarch64
broken = pkgs.stdenv.hostPlatform.isAarch64; # selenium.common.exceptions.WebDriverException: Message: Unsupported platform/architecture combination: linux/aarch64
};
nodes.filesender = { ... }: let

View File

@ -24,7 +24,7 @@ let
nodes = { "${name}" = machine; };
meta.maintainers = with pkgs.lib.maintainers; [ kirillrdy ];
# time-out on ofborg
meta.broken = pkgs.stdenv.isAarch64;
meta.broken = pkgs.stdenv.hostPlatform.isAarch64;
enableOCR = true;
testScript = ''

View File

@ -6,7 +6,7 @@ makeInstalledTest {
testConfig = {
# Tests allocate a lot of memory trying to exploit a CVE
# but qemu-system-i386 has a 2047M memory limit
virtualisation.memorySize = if pkgs.stdenv.isi686 then 2047 else 4096;
virtualisation.memorySize = if pkgs.stdenv.hostPlatform.isi686 then 2047 else 4096;
};
testRunnerFlags = [ "--timeout" "1800" ];

View File

@ -189,7 +189,7 @@ import ../make-test-python.nix (
m.start()
m.wait_for_unit("k3s")
is_aarch64 = "${toString pkgs.stdenv.isAarch64}" == "1"
is_aarch64 = "${toString pkgs.stdenv.hostPlatform.isAarch64}" == "1"
# wait for the agent to show up
server.wait_until_succeeds("k3s kubectl get node agent")

View File

@ -30,7 +30,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
testScript = let
nixosInstallISO = (import ../release.nix {}).iso_minimal.${pkgs.stdenv.hostPlatform.system};
virshShutdownCmd = if pkgs.stdenv.isx86_64 then "shutdown" else "destroy";
virshShutdownCmd = if pkgs.stdenv.hostPlatform.isx86_64 then "shutdown" else "destroy";
in ''
start_all()

View File

@ -40,7 +40,7 @@ let
};
environment.systemPackages = [ testers.testPlay pkgs.pavucontrol ]
++ lib.optional pkgs.stdenv.isx86_64 testers.testPlay32;
++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 testers.testPlay32;
} // lib.optionalAttrs systemWide {
users.users.alice.extraGroups = [ "pulse-access" ];
systemd.services.pulseaudio.wantedBy = [ "multi-user.target" ];
@ -54,7 +54,7 @@ let
machine.send_chars("testPlay \n")
machine.wait_for_file("/tmp/testPlay_success")
${lib.optionalString pkgs.stdenv.isx86_64 ''
${lib.optionalString pkgs.stdenv.hostPlatform.isx86_64 ''
machine.send_chars("testPlay32 \n")
machine.wait_for_file("/tmp/testPlay32_success")
''}

View File

@ -18,7 +18,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
libDir = pkgs.stdenv.hostPlatform.libDir;
ldsoBasename = lib.last (lib.splitString "/" pkgs.stdenv.cc.bintools.dynamicLinker);
check32 = pkgs.stdenv.isx86_64;
check32 = pkgs.stdenv.hostPlatform.isx86_64;
pkgs32 = pkgs.pkgsi686Linux;
libDir32 = pkgs32.stdenv.hostPlatform.libDir;

View File

@ -2,7 +2,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: {
name = "sunshine";
meta = {
# test is flaky on aarch64
broken = pkgs.stdenv.isAarch64;
broken = pkgs.stdenv.hostPlatform.isAarch64;
maintainers = [ lib.maintainers.devusb ];
};

View File

@ -43,7 +43,7 @@ let
in
listToAttrs (
map (makeWineTest "winePackages" [ hello32 ]) variants
++ optionals pkgs.stdenv.is64bit
++ optionals pkgs.stdenv.hostPlatform.is64bit
(map (makeWineTest "wineWowPackages" [ hello32 hello64 ])
# This wayland combination times out after spending many hours.
# https://hydra.nixos.org/job/nixos/trunk-combined/nixos.tests.wine.wineWowPackages-wayland.x86_64-linux

View File

@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
taglib
];
postInstall = lib.optionalString stdenv.isDarwin ''
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
for file in $out/lib/ario/plugins/*.dylib; do
ln -s $file $out/lib/ario/plugins/$(basename $file .dylib).so
done

View File

@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
dontUseCmakeConfigure = true;
nativeBuildInputs = [ cmake pkg-config meson ninja ];
buildInputs = [ libmpdclient yaml-cpp ]
++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.CoreFoundation ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.CoreFoundation ];
mesonFlags = [ "-Dunsupported_use_system_yamlcpp=true" ];

View File

@ -10,7 +10,7 @@ stdenv.mkDerivation (finalAttrs: {
};
buildInputs = [ sndio ]
++ lib.optional (!stdenv.isDarwin && !stdenv.hostPlatform.isBSD)
++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isBSD)
libbsd;
outputs = [ "out" "man" ];
@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
preBuild = ''
makeFlagsArray+=("PREFIX=$out")
'' + lib.optionalString
(!stdenv.isDarwin && !stdenv.hostPlatform.isBSD) ''
(!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isBSD) ''
makeFlagsArray+=(LDADD="-lsndio -lbsd")
# Fix warning about implicit declaration of function 'strlcpy'

View File

@ -75,10 +75,10 @@ stdenv.mkDerivation rec {
mkdir src/private
substituteInPlace scripts/build/macOS/fix_bundle.py \
--replace "path.startswith('/usr/lib/')" "path.startswith('${builtins.storeDir}')"
'' + lib.optionalString stdenv.isLinux ''
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace libraries/lib-files/FileNames.cpp \
--replace /usr/include/linux/magic.h ${linuxHeaders}/include/linux/magic.h
'' + lib.optionalString (stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") ''
'' + lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "11.0") ''
sed -z -i "s/NSAppearanceName.*systemAppearance//" src/AudacityApp.mm
'';
@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
python3
makeWrapper
wrapGAppsHook3
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
linuxHeaders
];
@ -125,7 +125,7 @@ stdenv.mkDerivation rec {
portaudio
wavpack
wxGTK32
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib # for portaudio
at-spi2-core
dbus
@ -138,7 +138,7 @@ stdenv.mkDerivation rec {
libsepol
libuuid
util-linux
] ++ lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
AppKit
CoreAudioKit # for portaudio
libpng
@ -176,13 +176,13 @@ stdenv.mkDerivation rec {
# Replace audacity's wrapper, to:
# - put it in the right place, it shouldn't be in "$out/audacity"
# - Add the ffmpeg dynamic dependency
postFixup = lib.optionalString stdenv.isLinux ''
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram "$out/bin/audacity" \
"''${gappsWrapperArgs[@]}" \
--prefix LD_LIBRARY_PATH : "$out/lib/audacity":${lib.makeLibraryPath [ ffmpeg_7 ]} \
--suffix AUDACITY_MODULES_PATH : "$out/lib/audacity/modules" \
--suffix AUDACITY_PATH : "$out/share/audacity"
'' + lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/{Applications,bin}
mv $out/Audacity.app $out/Applications/
makeWrapper $out/Applications/Audacity.app/Contents/MacOS/Audacity $out/bin/audacity

View File

@ -89,6 +89,6 @@ stdenv.mkDerivation rec {
mainProgram = "Cardinal";
platforms = lib.platforms.all;
# never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
};
}

View File

@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
installFlags = [ "PREFIX=$(out)" "INSTALL=install" ];
buildInputs = []
++ lib.optional stdenv.isDarwin IOKit;
++ lib.optional stdenv.hostPlatform.isDarwin IOKit;
meta = with lib; {
homepage = "http://linukz.org/cd-discid.shtml";

View File

@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
sha256 = "1pv4zrajm46za0f6lv162iqffih57a8ly4pc69f7y0gfyigb8p80";
};
patches = lib.optionals stdenv.isDarwin [
patches = lib.optionals stdenv.hostPlatform.isDarwin [
(fetchpatch {
url = "https://trac.macports.org/export/70964/trunk/dports/audio/cdparanoia/files/osx_interface.patch";
sha256 = "0hq3lvfr0h1m3p0r33jij0s1aspiqlpy533rwv19zrfllb39qvr8";
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
autoreconfHook
];
propagatedBuildInputs = lib.optionals stdenv.isDarwin [
propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
Carbon
IOKit
];

View File

@ -12,16 +12,16 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ flex bison which ]
++ lib.optionals stdenv.isDarwin [ DarwinTools xcbuild ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ DarwinTools xcbuild ];
buildInputs = [ libsndfile ]
++ lib.optional (!stdenv.isDarwin) alsa-lib
++ lib.optionals stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel MultitouchSupport ];
++ lib.optional (!stdenv.hostPlatform.isDarwin) alsa-lib
++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel MultitouchSupport ];
patches = [ ./darwin-limits.patch ];
makeFlags = [ "-C src" "DESTDIR=$(out)/bin" ];
buildFlags = [ (if stdenv.isDarwin then "mac" else "linux-alsa") ];
buildFlags = [ (if stdenv.hostPlatform.isDarwin then "mac" else "linux-alsa") ];
meta = with lib; {
description = "Programming language for real-time sound synthesis and music creation";

View File

@ -1,15 +1,15 @@
{ config, lib, stdenv, fetchFromGitHub, ncurses, pkg-config
, libiconv, CoreAudio, AudioUnit, VideoToolbox
, alsaSupport ? stdenv.isLinux, alsa-lib ? null
, alsaSupport ? stdenv.hostPlatform.isLinux, alsa-lib ? null
# simple fallback for everyone else
, aoSupport ? !stdenv.isLinux, libao ? null
, aoSupport ? !stdenv.hostPlatform.isLinux, libao ? null
, jackSupport ? false, libjack ? null
, samplerateSupport ? jackSupport, libsamplerate ? null
, ossSupport ? false, alsa-oss ? null
, pulseaudioSupport ? config.pulseaudio or false, libpulseaudio ? null
, sndioSupport ? false, sndio ? null
, mprisSupport ? stdenv.isLinux, systemd ? null
, mprisSupport ? stdenv.hostPlatform.isLinux, systemd ? null
# TODO: add these
#, artsSupport
@ -103,7 +103,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ncurses ]
++ lib.optionals stdenv.isDarwin [ libiconv CoreAudio AudioUnit VideoToolbox ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv CoreAudio AudioUnit VideoToolbox ]
++ lib.flatten (lib.concatMap (a: a.deps) opts);
prefixKey = "prefix=";

View File

@ -1,5 +1,5 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, curl, libnotify
, gdk-pixbuf, libnotifySupport ? stdenv.isLinux, debug ? false }:
, gdk-pixbuf, libnotifySupport ? stdenv.hostPlatform.isLinux, debug ? false }:
stdenv.mkDerivation rec {
pname = "cmusfm";

View File

@ -31,21 +31,21 @@ stdenv.mkDerivation rec {
};
cmakeFlags = [ "-DBUILD_CSOUND_AC=0" ] # fails to find Score.hpp
++ lib.optional stdenv.isDarwin "-DCS_FRAMEWORK_DEST=${placeholder "out"}/lib"
++ lib.optional stdenv.hostPlatform.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";
nativeBuildInputs = [ cmake flex bison gettext ];
buildInputs = [ libsndfile libsamplerate boost ]
++ lib.optionals stdenv.isDarwin [
++ lib.optionals stdenv.hostPlatform.isDarwin [
Accelerate AudioUnit CoreAudio CoreMIDI portaudio
] ++ lib.optionals stdenv.isLinux (builtins.filter (optional: optional != null) [
] ++ lib.optionals stdenv.hostPlatform.isLinux (builtins.filter (optional: optional != null) [
alsa-lib libpulseaudio libjack2
liblo ladspa-sdk fluidsynth eigen
curl tcltk fltk
]);
postInstall = lib.optional stdenv.isDarwin ''
postInstall = lib.optional stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Library/Frameworks
ln -s $out/lib/CsoundLib64.framework $out/Library/Frameworks
'';

View File

@ -50,7 +50,7 @@ python3Packages.buildPythonApplication rec {
gobject-introspection
wrapGAppsHook4
blueprint-compiler
] ++ lib.optional stdenv.isDarwin gtk4; # for gtk4-update-icon-cache
] ++ lib.optional stdenv.hostPlatform.isDarwin gtk4; # for gtk4-update-icon-cache
buildInputs = [
librsvg

View File

@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
cmake
pkg-config
wrapQtAppsHook
] ++ lib.optional stdenv.isLinux copyDesktopItems;
] ++ lib.optional stdenv.hostPlatform.isLinux copyDesktopItems;
buildInputs = [
qtbase
@ -48,11 +48,11 @@ stdenv.mkDerivation rec {
installPhase =
''
runHook preInstall
'' + lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications
mv "easyaudiosync.app" "Easy Audio Sync.app"
cp -r "Easy Audio Sync.app" $out/Applications
'' + lib.optionalString stdenv.isLinux ''
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
install -Dm755 easyaudiosync $out/bin/easyaudiosync
for RES in 48 64 128 256; do

View File

@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
'';
meta = {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "LV2 EQ plugins and more, with 64 bit processing";
longDescription = ''
Up to 10-Bands parametric equalizer with mono and stereo versions.

View File

@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
buildInputs = lib.optional mbrolaSupport mbrola
++ lib.optional pcaudiolibSupport pcaudiolib
++ lib.optional sonicSupport sonic
++ lib.optionals stdenv.isDarwin [
++ lib.optionals stdenv.hostPlatform.isDarwin [
CoreAudio
AudioToolbox
AudioUnit
@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
# touch ChangeLog to avoid below error on darwin:
# Makefile.am: error: required file './ChangeLog.md' not found
preConfigure = lib.optionalString stdenv.isDarwin ''
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
touch ChangeLog
'' + ''
./autogen.sh
@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
--replace '../src/espeak-ng --compile' "${lib.getExe buildPackages.espeak-ng} --compile"
'';
postInstall = lib.optionalString stdenv.isLinux ''
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf --set-rpath "$(patchelf --print-rpath $out/bin/espeak-ng)" $out/bin/speak-ng
wrapProgram $out/bin/espeak-ng \
--set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib

View File

@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ buildPackages.stdenv.cc pkg-config cmake ];
buildInputs = [ glib libsndfile libjack2 ]
++ lib.optionals stdenv.isLinux [ alsa-lib libpulseaudio ]
++ lib.optionals stdenv.isDarwin [ AppKit AudioUnit CoreAudio CoreMIDI CoreServices ];
++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libpulseaudio ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit AudioUnit CoreAudio CoreMIDI CoreServices ];
cmakeFlags = [
"-Denable-framework=off"

View File

@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = [ SDL2 ]
++ lib.optional stdenv.isLinux alsa-lib
++ lib.optionals stdenv.isDarwin [
++ lib.optional stdenv.hostPlatform.isLinux alsa-lib
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
CoreAudio
CoreMIDI

View File

@ -25,9 +25,9 @@ rustPlatform.buildRustPackage rec {
rustPlatform.bindgenHook
];
buildInputs = lib.optionals stdenv.isDarwin [
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.AudioUnit
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
];

View File

@ -75,6 +75,6 @@ stdenv.mkDerivation rec {
license = lib.licenses.gpl3Plus;
maintainers = lib.teams.gnome.members;
platforms = lib.platforms.unix;
broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/gnome-podcasts.x86_64-darwin
broken = stdenv.hostPlatform.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/gnome-podcasts.x86_64-darwin
};
}

View File

@ -37,7 +37,7 @@ buildGoModule rec {
buildInputs = [
flac
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
];

View File

@ -41,8 +41,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkg-config imagemagick libicns makeWrapper ];
buildInputs = [ fftwFloat zlib wavpack wxGTK32 yaml-cpp ]
++ lib.optionals stdenv.isLinux [ alsa-lib udev ]
++ lib.optionals stdenv.isDarwin [ Cocoa ]
++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib udev ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ]
++ lib.optional jackaudioSupport libjack2;
cmakeFlags = lib.optionals (!jackaudioSupport) [
@ -52,9 +52,9 @@ stdenv.mkDerivation rec {
"-DINSTALL_DEPEND=OFF"
] ++ lib.optional (!includeDemo) "-DINSTALL_DEMO=OFF";
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DTARGET_OS_IPHONE=0";
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DTARGET_OS_IPHONE=0";
postInstall = lib.optionalString stdenv.isDarwin ''
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/{Applications,bin,lib}
mv $out/GrandOrgue.app $out/Applications/
for lib in $out/Applications/GrandOrgue.app/Contents/Frameworks/lib*; do

View File

@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
enableParallelBuilding = true;
meta = {
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
description = "GStreamer based command line media player";
homepage = "https://space.twc.de/~stefan/gst123.php";
license = lib.licenses.lgpl2Plus;

View File

@ -66,6 +66,6 @@ stdenv.mkDerivation (finalAttrs: {
platforms = platforms.all;
mainProgram = "hivelytracker";
maintainers = with maintainers; [ fgaz ];
broken = stdenv.isDarwin; # TODO: try to use xcbuild
broken = stdenv.hostPlatform.isDarwin; # TODO: try to use xcbuild
};
})

View File

@ -80,7 +80,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
meta = {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "Audio effect processor for PipeWire clients";
mainProgram = "jamesdsp";
homepage = "https://github.com/Audio4Linux/JDSP4Linux";

View File

@ -21,7 +21,7 @@ buildGoModule rec {
buildInputs = [ alsa-lib ];
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "Jellyfin terminal client";
longDescription = ''
Terminal music player, works with Jellyfin (>= 10.6) , Emby (>= 4.4), and

View File

@ -5,7 +5,7 @@
, pkg-config
, stdenv
, openssl
, withALSA ? stdenv.isLinux
, withALSA ? stdenv.hostPlatform.isLinux
, alsa-lib
, alsa-plugins
, withPortAudio ? false
@ -28,7 +28,7 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-tbDlWP0sUIa0W9HhdYNOvo9cGeqFemclhA7quh7f/Rw=";
nativeBuildInputs = [ pkg-config makeWrapper ] ++ lib.optionals stdenv.isDarwin [
nativeBuildInputs = [ pkg-config makeWrapper ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
rustPlatform.bindgenHook
];

View File

@ -28,7 +28,7 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [ pkg-config installShellFiles asciidoctor ];
buildInputs = [ sqlite ] ++ (if stdenv.isDarwin then [
buildInputs = [ sqlite ] ++ (if stdenv.hostPlatform.isDarwin then [
libiconv
Security
SystemConfiguration
@ -39,7 +39,7 @@ rustPlatform.buildRustPackage rec {
buildFeatures = [
"shell_completion"
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
"systemd"
];

View File

@ -20,8 +20,8 @@ stdenv.mkDerivation {
buildInputs = [
SDL
]
++ lib.optional stdenv.isDarwin Foundation
++ lib.optional stdenv.isLinux jack2;
++ lib.optional stdenv.hostPlatform.isDarwin Foundation
++ lib.optional stdenv.hostPlatform.isLinux jack2;
patches = [
# Remove outdated (pre-64bit) checks that would fail on modern platforms
@ -32,15 +32,15 @@ stdenv.mkDerivation {
preBuild = "cd projects";
makeFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ]
++ lib.optionals stdenv.isLinux [ "PLATFORM=DEB" ]
++ lib.optionals stdenv.isDarwin [ "PLATFORM=OSX" ];
++ lib.optionals stdenv.hostPlatform.isLinux [ "PLATFORM=DEB" ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ "PLATFORM=OSX" ];
env.NIX_CFLAGS_COMPILE = toString ([ "-fpermissive" ] ++
lib.optional stdenv.hostPlatform.isAarch64 "-Wno-error=narrowing");
NIX_LDFLAGS = lib.optional stdenv.isDarwin "-framework Foundation";
NIX_LDFLAGS = lib.optional stdenv.hostPlatform.isDarwin "-framework Foundation";
installPhase = let extension = if stdenv.isDarwin then "app" else "deb-exe";
installPhase = let extension = if stdenv.hostPlatform.isDarwin then "app" else "deb-exe";
in "install -Dm555 lgpt.${extension} $out/bin/lgpt";
passthru.updateScript = unstableGitUpdater {
@ -69,7 +69,7 @@ stdenv.mkDerivation {
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
# https://github.com/NixOS/nixpkgs/pull/91766#issuecomment-688751821
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
mainProgram = "lgpt";
};
}

View File

@ -23,8 +23,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ libGL python3 ]
++ lib.optionals stdenv.isDarwin [ Cocoa ]
++ lib.optionals stdenv.isLinux [ libX11 libXext libXrandr ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ]
++ lib.optionals stdenv.hostPlatform.isLinux [ libX11 libXext libXrandr ];
enableParallelBuilding = true;
@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
description = "automatic mastering plugin for live streaming, podcasts and internet radio";
maintainers = with maintainers; [ magnetophon ];
platforms = platforms.all;
broken = stdenv.isDarwin; # error: no type or protocol named 'NSPasteboardType'
broken = stdenv.hostPlatform.isDarwin; # error: no type or protocol named 'NSPasteboardType'
license = licenses.gpl3Plus;
mainProgram = "master_me";
};

View File

@ -62,7 +62,7 @@ mkDerivation rec {
meta = with lib; {
inherit (qtbase.meta) platforms;
broken = stdenv.isDarwin; # test build fails, but the project is not maintained anymore
broken = stdenv.hostPlatform.isDarwin; # test build fails, but the project is not maintained anymore
description = "Cloud music integration for your desktop";
mainProgram = "MellowPlayer";

View File

@ -36,13 +36,13 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
glfw
ffmpeg-full
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
libX11
libXrandr
libXinerama
libXcursor
gtk3
] ++ lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
AppKit
Carbon
Cocoa
@ -52,7 +52,7 @@ stdenv.mkDerivation (finalAttrs: {
Kernel
];
installPhase = if stdenv.isDarwin then ''
installPhase = if stdenv.hostPlatform.isDarwin then ''
mkdir -p $out/Applications $out/bin
cp -r MIDIVisualizer.app $out/Applications/
ln -s ../Applications/MIDIVisualizer.app/Contents/MacOS/MIDIVisualizer $out/bin/

View File

@ -59,6 +59,6 @@ stdenv.mkDerivation (finalAttrs: {
license = licenses.gpl2Plus;
maintainers = with maintainers; [ fgaz ];
platforms = platforms.all;
broken = stdenv.isDarwin; # not attempted
broken = stdenv.hostPlatform.isDarwin; # not attempted
};
})

View File

@ -25,10 +25,10 @@ rustPlatform.buildRustPackage rec {
cargoBuildFlags = ["-p minidsp -p minidsp-daemon"];
buildInputs =
lib.optionals stdenv.isLinux [libusb1]
++ lib.optionals stdenv.isDarwin [AppKit IOKit];
lib.optionals stdenv.hostPlatform.isLinux [libusb1]
++ lib.optionals stdenv.hostPlatform.isDarwin [AppKit IOKit];
nativeBuildInputs = lib.optionals stdenv.isLinux [pkg-config];
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [pkg-config];
meta = with lib; {
description = "Control interface for some MiniDSP products";

View File

@ -132,7 +132,7 @@ mkDerivation rec {
"-DINSTALL_USER_UDEV_RULES=OFF"
];
postInstall = lib.optionalString stdenv.isLinux ''
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
rules="$src/res/linux/mixxx-usb-uaccess.rules"
if [ ! -f "$rules" ]; then
echo "$rules is missing, must update the Nix file."

View File

@ -3,7 +3,7 @@
, ncurses, db , popt, libtool
, libiconv, CoreServices
# Sound sub-systems
, alsaSupport ? (!stdenv.isDarwin), alsa-lib
, alsaSupport ? (!stdenv.hostPlatform.isDarwin), alsa-lib
, pulseSupport ? true, libpulseaudio
, jackSupport ? true, libjack2
, ossSupport ? true
@ -80,7 +80,7 @@ stdenv.mkDerivation {
# Misc
++ lib.optional curlSupport curl
++ lib.optional samplerateSupport libsamplerate
++ lib.optionals stdenv.isDarwin [ libiconv CoreServices ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv CoreServices ];
configureFlags = [
# Sound sub-systems

View File

@ -33,7 +33,7 @@ pythonPackages.buildPythonApplication rec {
requests
setuptools
tornado
] ++ lib.optional (!stdenv.isDarwin) dbus-python
] ++ lib.optional (!stdenv.hostPlatform.isDarwin) dbus-python
);
propagatedNativeBuildInputs = [

View File

@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
buildInputs = [
ncurses
libvorbis
] ++ lib.optional stdenv.isDarwin SDL;
] ++ lib.optional stdenv.hostPlatform.isDarwin SDL;
env.NIX_CFLAGS_COMPILE = toString ([
"-Wno-narrowing"

View File

@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
buildInputs = [
libmpdclient
]
++ lib.optionals stdenv.isDarwin [ libiconv ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
nativeBuildInputs = [
installShellFiles

View File

@ -35,10 +35,10 @@
}:
let
stdenv' = if stdenv.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
stdenv' = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
# portaudio propagates Darwin frameworks. Rebuild it using the 11.0 stdenv
# from Qt and the 11.0 SDK frameworks.
portaudio' = if stdenv.isDarwin then portaudio.override {
portaudio' = if stdenv.hostPlatform.isDarwin then portaudio.override {
stdenv = stdenv';
inherit (darwin.apple_sdk_11_0.frameworks)
AudioUnit
@ -94,10 +94,10 @@ in stdenv'.mkDerivation (finalAttrs: {
qtWrapperArgs = [
# MuseScore JACK backend loads libjack at runtime.
"--prefix ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}"
] ++ lib.optionals (stdenv.isLinux) [
"--prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libjack2 ]}"
] ++ lib.optionals (stdenv.hostPlatform.isLinux) [
"--set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib"
] ++ lib.optionals (!stdenv.isDarwin) [
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
# There are some issues with using the wayland backend, see:
# https://musescore.org/en/node/321936
"--set-default QT_QPA_PLATFORM xcb"
@ -115,7 +115,7 @@ in stdenv'.mkDerivation (finalAttrs: {
qttools
pkg-config
ninja
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
# Since https://github.com/musescore/MuseScore/pull/13847/commits/685ac998
# GTK3 is needed for file dialogs. Fixes crash with No GSettings schemas error.
wrapGAppsHook3
@ -141,17 +141,17 @@ in stdenv'.mkDerivation (finalAttrs: {
qtsvg
qtscxml
qtnetworkauth
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
qtwayland
] ++ lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk_11_0.frameworks.Cocoa
];
postInstall = ''
# Remove unneeded bundled libraries and headers
rm -r $out/{include,lib}
'' + lib.optionalString stdenv.isDarwin ''
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out/Applications"
mv "$out/mscore.app" "$out/Applications/mscore.app"
mkdir -p $out/bin
@ -174,8 +174,8 @@ in stdenv'.mkDerivation (finalAttrs: {
# so we disable it and explicitly use makeQtWrapper.
#
# TODO: check if something like this is also needed for macOS.
dontWrapQtApps = stdenv.isLinux;
postFixup = lib.optionalString stdenv.isLinux ''
dontWrapQtApps = stdenv.hostPlatform.isLinux;
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
mkdir -p $out/libexec
mv $out/bin/mscore $out/libexec
makeQtWrapper $out/libexec/mscore $out/bin/mscore

View File

@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
};
nativeBuildInputs = [ pkg-config wrapGAppsHook3 ];
buildInputs = lib.optional stdenv.isDarwin CoreServices;
buildInputs = lib.optional stdenv.hostPlatform.isDarwin CoreServices;
preConfigure = ''
substituteInPlace lib/utils.rs \
@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-+UVUejKCfjC6zdW315wmu7f3A5GmnoQ3rIk8SK6LIRI=";
meta = with lib; {
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
description = "Automatic music sorter (based on ID3 tags)";
mainProgram = "muso";
homepage = "https://github.com/quebin31/muso";

View File

@ -35,16 +35,16 @@ rustPlatform.buildRustPackage rec {
++ lib.optional withClipboard python3;
buildInputs = [ ncurses ]
++ lib.optional stdenv.isLinux openssl
++ lib.optional stdenv.hostPlatform.isLinux openssl
++ lib.optional withALSA alsa-lib
++ lib.optional withClipboard libxcb
++ lib.optional withCover ueberzug
++ lib.optional withPulseAudio libpulseaudio
++ lib.optional withPortAudio portaudio
++ lib.optional (withMPRIS || withNotify) dbus
++ lib.optional stdenv.isDarwin Cocoa;
++ lib.optional stdenv.hostPlatform.isDarwin Cocoa;
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DNCURSES_UNCTRL_H_incl";
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DNCURSES_UNCTRL_H_incl";
buildNoDefaultFeatures = true;

View File

@ -28,7 +28,7 @@ stdenv.mkDerivation {
] ++ additionalBuildInputs;
meta = with lib; {
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
description = description;
homepage = "https://open-music-kontrollers.ch/lv2/${pname}:";
license = licenses.artistic2;

View File

@ -39,7 +39,7 @@ buildDotnetModule rec {
dotnetInstallFlags = [ "-p:PublishReadyToRun=false" ];
# socket cannot bind to localhost on darwin for tests
doCheck = !stdenv.isDarwin;
doCheck = !stdenv.hostPlatform.isDarwin;
# net7.0 replacement needed until upstream bumps to dotnet 7
postPatch = ''
@ -54,9 +54,9 @@ buildDotnetModule rec {
# need to make sure proprietary worldline resampler is copied
postInstall = let
runtime = if (stdenv.isLinux && stdenv.isx86_64) then "linux-x64"
else if (stdenv.isLinux && stdenv.isAarch64) then "linux-arm64"
else if stdenv.isDarwin then "osx"
runtime = if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64) then "linux-x64"
else if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) then "linux-arm64"
else if stdenv.hostPlatform.isDarwin then "osx"
else null;
in lib.optionalString (runtime != null) ''
cp runtimes/${runtime}/native/libworldline${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/OpenUtau/

View File

@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkg-config ]
++ lib.optionals stdenv.isDarwin [ libiconv ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
buildInputs = [ libogg ];
@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/fmang/opustags";
description = "Ogg Opus tags editor";
platforms = platforms.all;
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
maintainers = with maintainers; [ kmein ];
license = licenses.bsd3;
mainProgram = "opustags";

View File

@ -28,7 +28,7 @@ rustPlatform.buildRustPackage {
nativeBuildInputs = [ cmake makeBinaryWrapper pkg-config ];
buildInputs = [ libopus openssl ]
++ lib.optionals stdenv.isDarwin [ Security ];
++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
postInstall = ''
wrapProgram $out/bin/parrot \

View File

@ -38,7 +38,7 @@ stdenv.mkDerivation {
'';
meta = {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "Time domain pitch tracker for Pure Data";
homepage = "http://www.katjaas.nl/helmholtz/helmholtz.html";
license = lib.licenses.bsd3;

View File

@ -30,7 +30,7 @@ pythonPackages.buildPythonApplication rec {
(with pythonPackages; [ pygobject3 pylast ]);
meta = with lib; {
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
description = "Pandora Internet Radio player for GNOME";
mainProgram = "pithos";
homepage = "https://pithos.github.io/";

View File

@ -21,7 +21,7 @@ stdenv.mkDerivation {
'';
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
homepage = "https://github.com/cth103/plugin-torture";
description = "Tool to test LADSPA and LV2 plugins";
license = licenses.gpl2;

View File

@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
];
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "Soundfont editor for creating musical instruments";
mainProgram = "polyphone";
homepage = "https://www.polyphone-soundfonts.com/";

View File

@ -18,7 +18,7 @@ stdenv.mkDerivation (finalAttrs: {
};
nativeBuildInputs = [ cmake ];
buildInputs = [ SDL2 ] ++ lib.optional stdenv.isLinux alsa-lib;
buildInputs = [ SDL2 ] ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib;
postInstall = ''
install -Dm444 "$src/release/other/Freedesktop.org Resources/ProTracker 2 clone.desktop" \

View File

@ -25,9 +25,9 @@ stdenv.mkDerivation rec {
buildInputs = [
fftw
libjack2
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
] ++ lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
portaudio
];
@ -35,9 +35,9 @@ stdenv.mkDerivation rec {
"--enable-universal"
"--enable-fftw"
"--enable-jack"
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
"--enable-alsa"
] ++ lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
"--enable-portaudio"
"--without-local-portaudio"
"--disable-jack-framework"

View File

@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
'';
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
homepage = "https://github.com/jpcima/quadrafuzz";
description = "Multi-band fuzz distortion plugin";
maintainers = [ maintainers.magnetophon ];

View File

@ -94,7 +94,7 @@ stdenv.mkDerivation rec {
env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
nativeCheckInputs = [ gtest ];
doCheck = !stdenv.isAarch64; # single failure that I can't explain
doCheck = !stdenv.hostPlatform.isAarch64; # single failure that I can't explain
preFixup = ''
gappsWrapperArgs+=(--suffix PATH : ${lib.makeBinPath [ dbus ]})

View File

@ -15,14 +15,14 @@
, xdotool
, which
, jackSupport ? stdenv.isLinux
, jackSupport ? stdenv.hostPlatform.isLinux
, jackLibrary
, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux
, pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux
, libpulseaudio
}:
let
url_for_platform = version: arch: if stdenv.isDarwin
url_for_platform = version: arch: if stdenv.hostPlatform.isDarwin
then "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_universal.dmg"
else "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${arch}.tar.xz";
in
@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = url_for_platform version stdenv.hostPlatform.qemuArch;
hash = if stdenv.isDarwin then "sha256-dIRZCUIfqnGTxBaLzczwzD6hA/PyAxPqfa+FfCRKdu0=" else {
hash = if stdenv.hostPlatform.isDarwin then "sha256-dIRZCUIfqnGTxBaLzczwzD6hA/PyAxPqfa+FfCRKdu0=" else {
x86_64-linux = "sha256-aa2KcL8yZYG+Dki7J6U473E2BQgdACAIzRLtD9zuHV0=";
aarch64-linux = "sha256-NECEEUKtTQajl0MZK8/NsbhcuyihHOo0Q5Y5UpAAgrM=";
}.${stdenv.hostPlatform.system};
@ -40,24 +40,24 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
makeWrapper
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
which
autoPatchelfHook
xdg-utils # Required for desktop integration
] ++ lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
undmg
];
sourceRoot = lib.optionalString stdenv.isDarwin "Reaper.app";
sourceRoot = lib.optionalString stdenv.hostPlatform.isDarwin "Reaper.app";
buildInputs = [
stdenv.cc.cc.lib # reaper and libSwell need libstdc++.so.6
] ++ lib.optionals stdenv.isLinux [
] ++ lib.optionals stdenv.hostPlatform.isLinux [
gtk3
alsa-lib
];
runtimeDependencies = lib.optionals stdenv.isLinux [
runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux [
gtk3 # libSwell needs libgdk-3.so.0
]
++ lib.optional jackSupport jackLibrary
@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
dontBuild = true;
installPhase = if stdenv.isDarwin then ''
installPhase = if stdenv.hostPlatform.isDarwin then ''
runHook preInstall
mkdir -p "$out/Applications/Reaper.app"
cp -r * "$out/Applications/Reaper.app/"

View File

@ -21,6 +21,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Only;
maintainers = [ maintainers.joelmo ];
platforms = platforms.unix;
broken = stdenv.isAarch64; # g++: error: unrecognized command line option '-mfpmath=sse'
broken = stdenv.hostPlatform.isAarch64; # g++: error: unrecognized command line option '-mfpmath=sse'
};
}

View File

@ -21,18 +21,18 @@ stdenv.mkDerivation rec {
};
configureFlags = [ "--enable-dependency-tracking" ]
++ lib.optional stdenv.isDarwin "--disable-sdltest";
++ lib.optional stdenv.hostPlatform.isDarwin "--disable-sdltest";
nativeBuildInputs = [ autoreconfHook python3 ];
buildInputs = [ SDL2 ]
++ lib.optionals stdenv.isLinux [ alsa-lib libXext ]
++ lib.optionals stdenv.isDarwin [ Cocoa ];
++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib libXext ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa ];
enableParallelBuilding = true;
# Our Darwin SDL2 doesn't have a SDL2main to link against
preConfigure = lib.optionalString stdenv.isDarwin ''
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure.ac \
--replace '-lSDL2main' '-lSDL2'
'';

View File

@ -1,6 +1,6 @@
{ stdenv, lib, config, fetchFromGitHub, cmake, pkg-config
, alsaSupport ? stdenv.isLinux, alsa-lib
, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
, alsaSupport ? stdenv.hostPlatform.isLinux, alsa-lib
, pulseSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux, libpulseaudio
, jackSupport ? false, libjack2, soxr
, pcapSupport ? false, libpcap
}:

View File

@ -55,7 +55,7 @@ stdenv.mkDerivation (finalAttrs: {
makeFlags = [ "DESTDIR=$(out)" ];
meta = with lib; {
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
homepage = "http://www.drpetter.se/project_sfxr.html";
description = "Videogame sound effect generator";
mainProgram = "sfxr";

View File

@ -24,10 +24,10 @@ stdenv.mkDerivation rec {
asio avahi flac libogg libvorbis libopus
aixlog popl soxr
] ++ lib.optional pulseaudioSupport libpulseaudio
++ lib.optional stdenv.isLinux alsa-lib
++ lib.optionals stdenv.isDarwin [ IOKit AudioToolbox ];
++ lib.optional stdenv.hostPlatform.isLinux alsa-lib
++ lib.optionals stdenv.hostPlatform.isDarwin [ IOKit AudioToolbox ];
TARGET=lib.optionalString stdenv.isDarwin "MACOS";
TARGET=lib.optionalString stdenv.hostPlatform.isDarwin "MACOS";
# Upstream systemd unit files are pretty awful, so we provide our own in a
# NixOS module. It might make sense to get that upstreamed...

View File

@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ];
buildInputs = [ fftw gsl motif ]
++ lib.optionals stdenv.isLinux [ alsa-lib ]
++ lib.optionals stdenv.isDarwin [ CoreServices CoreMIDI ]
++ lib.optionals stdenv.hostPlatform.isLinux [ alsa-lib ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices CoreMIDI ]
++ (with xorg; [ libXext libXft libXpm libXt ]);
configureFlags = [ "--with-motif" ];

View File

@ -59,7 +59,7 @@ stdenv.mkDerivation (finalAttrs: {
env.NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isLinux "-rpath ${lib.makeLibraryPath (finalAttrs.runtimeDependencies)}";
dontPatchELF = true; # needed or nix will try to optimize the binary by removing "useless" rpath
postPatch = lib.optionalString (stdenv.isLinux) ''
postPatch = lib.optionalString (stdenv.hostPlatform.isLinux) ''
# needs special setup on Linux, dunno if it can work on Darwin
# Also, I get issues with linking without that, not sure why
sed -i -e '/juce::juce_recommended_lto_flags/d' CMakeLists.txt
@ -67,7 +67,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
# The program does not provide any CMake install instructions
installPhase = lib.optionalString (stdenv.isLinux) ''
installPhase = lib.optionalString (stdenv.hostPlatform.isLinux) ''
runHook preInstall
cd ../linux
./install.sh "$out"
@ -80,7 +80,7 @@ stdenv.mkDerivation (finalAttrs: {
license = with licenses; [ gpl3Plus ];
maintainers = with maintainers; [ PowerUser64 ];
platforms = platforms.unix;
broken = stdenv.isDarwin;
broken = stdenv.hostPlatform.isDarwin;
mainProgram = "sonobus";
};
})

View File

@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
'';
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
homepage = "http://openavproductions.com/sorcer/";
description = "Wavetable LV2 plugin synth, targeted at the electronic / dubstep genre";
license = licenses.gpl3Plus;

View File

@ -59,7 +59,7 @@ stdenv.mkDerivation (finalAttrs: {
goocanvas
libxml2
libsndfile
] ++ lib.optional stdenv.isLinux alsa-lib;
] ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib;
meta = with lib; {
description = "Music tracking tool similar in design to the DOS program FastTracker and the Amiga legend ProTracker";

View File

@ -35,7 +35,7 @@ stdenv.mkDerivation {
'';
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
description = "Speech denoise lv2 plugin based on RNNoise library";
homepage = "https://github.com/lucianodato/speech-denoiser";
license = licenses.lgpl3;

View File

@ -49,7 +49,7 @@ rustPlatform.buildRustPackage rec {
pkg-config
cmake
rustPlatform.bindgenHook
] ++ lib.optionals stdenv.isDarwin [
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
makeBinaryWrapper
];
@ -61,14 +61,14 @@ rustPlatform.buildRustPackage rec {
++ lib.optionals withSixel [ libsixel ]
++ lib.optionals (withAudioBackend == "alsa") [ alsa-lib ]
++ lib.optionals (withAudioBackend == "pulseaudio") [ libpulseaudio ]
++ lib.optionals (withAudioBackend == "rodio" && stdenv.isLinux) [ alsa-lib ]
++ lib.optionals (withAudioBackend == "rodio" && stdenv.hostPlatform.isLinux) [ alsa-lib ]
++ lib.optionals (withAudioBackend == "portaudio") [ portaudio ]
++ lib.optionals (withAudioBackend == "jackaudio") [ libjack2 ]
++ lib.optionals (withAudioBackend == "rodiojack") [ alsa-lib libjack2 ]
++ lib.optionals (withAudioBackend == "sdl") [ SDL2 ]
++ lib.optionals (withAudioBackend == "gstreamer") [ gst_all_1.gstreamer gst_all_1.gst-devtools gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good ]
++ lib.optionals (stdenv.isDarwin && withMediaControl) [ darwin.apple_sdk.frameworks.MediaPlayer ]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
++ lib.optionals (stdenv.hostPlatform.isDarwin && withMediaControl) [ darwin.apple_sdk.frameworks.MediaPlayer ]
++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
AppKit
AudioUnit
Cocoa
@ -88,7 +88,7 @@ rustPlatform.buildRustPackage rec {
++ lib.optionals withFuzzy [ "fzf" ];
# sixel-sys is dynamically linked to libsixel
postInstall = lib.optionals (stdenv.isDarwin && withSixel) ''
postInstall = lib.optionals (stdenv.hostPlatform.isDarwin && withSixel) ''
wrapProgram $out/bin/spotify_player \
--prefix DYLD_LIBRARY_PATH : "${lib.makeLibraryPath [libsixel]}"
'';

View File

@ -27,7 +27,7 @@ mkDerivation rec {
installFlags = [ "DESTDIR=$(out)" ];
postInstall = lib.optionalString stdenvNoCC.isDarwin ''
postInstall = lib.optionalString stdenvNoCC.hostPlatform.isDarwin ''
mkdir -p $out/Applications
mv $out/bin/spotify-qt.app $out/Applications
ln $out/Applications/spotify-qt.app/Contents/MacOS/spotify-qt $out/bin/spotify-qt

View File

@ -11,7 +11,7 @@ stdenv.mkDerivation {
version = "1.2.40.599.g606b7f29";
src = if stdenv.isAarch64 then (
src = if stdenv.hostPlatform.isAarch64 then (
fetchurl {
url = "https://web.archive.org/web/20240622065234/https://download.scdn.co/SpotifyARM64.dmg";
hash = "sha256-mmjxKYmsX0rFlIU19JOfPbNgOhlcZs5slLUhDhlON1c=";

View File

@ -18,6 +18,6 @@ let
mainProgram = "spotify";
};
in if stdenv.isDarwin
in if stdenv.hostPlatform.isDarwin
then callPackage ./darwin.nix (extraArgs // { inherit pname meta; })
else callPackage ./linux.nix (extraArgs // { inherit pname meta; })

View File

@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
installFlags = [ "PREFIX=$(out)" ];
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
homepage = "https://github.com/jpcima/stone-phaser";
description = "Classic analog phaser effect, made with DPF and Faust";
maintainers = [ maintainers.magnetophon ];

Some files were not shown because too many files have changed in this diff Show More