Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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>`
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/test-with-nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
] ++ lib.optional pkgs.stdenv.hostPlatform.isLinux pkgs.inotify-tools;
] ++ lib.optional pkgs.stdenv.buildPlatform.isLinux pkgs.inotify-tools;

This probably applies to most conditionals for any nativeBuildInputs.

strictDeps = true;
} ''
datadir="${nix}/share"
Expand Down
2 changes: 1 addition & 1 deletion maintainers/scripts/convert-to-import-cargo-lock/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ mkShell {
clippy
rustfmt
]
++ lib.optional stdenv.isDarwin pkgs.libiconv;
++ lib.optional stdenv.hostPlatform.isDarwin pkgs.libiconv;
}
2 changes: 1 addition & 1 deletion nixos/modules/config/fonts/fontconfig.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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>
''}
''}
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/config/ldso.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}
];
Expand All @@ -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 [
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/pulseaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/config/stub-ld.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/hardware/graphics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}
{
Expand All @@ -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; }
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/profiles/all-hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/audio/jack.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/desktops/pipewire/pipewire.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/logging/promtail.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
});
};
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/mame.nix
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/misc/tabby.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/networking/cjdns.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/networking/dnscrypt-wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ let
sha256 = "0c4mq741q4rpmdn09agwmxap32kf0vgfz7pkhcdc5h54chc3g3xy";
};

configureFlags = lib.optional stdenv.isLinux "--with-systemd";
configureFlags = lib.optional stdenv.hostPlatform.isLinux "--with-systemd";

nativeBuildInputs = [ autoreconfHook pkg-config ];

# <ldns/ldns.h> depends on <openssl/ssl.h>
buildInputs = [ libsodium openssl.dev ldns ] ++ lib.optional stdenv.isLinux systemd;
buildInputs = [ libsodium openssl.dev ldns ] ++ lib.optional stdenv.hostPlatform.isLinux systemd;

postInstall = ''
# Previous versions required libtool files to load plugins; they are
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/services/networking/nsd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/services/video/frigate.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
];
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/stage-1.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/tasks/network-interfaces.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}];

Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/xen-dom0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ in

config = mkIf cfg.enable {
assertions = [ {
assertion = pkgs.stdenv.isx86_64;
assertion = pkgs.stdenv.hostPlatform.isx86_64;
message = "Xen currently not supported on ${pkgs.stdenv.hostPlatform.system}";
} {
assertion = config.boot.loader.grub.enable && (config.boot.loader.grub.efiSupport == false);
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/filesender.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/freetube.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/installed-tests/gdk-pixbuf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/k3s/multi-node.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/k3s/single-node.nix
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ import ../make-test-python.nix (
machine.succeed("kubectl cluster-info")
machine.fail("sudo -u noprivs kubectl cluster-info")
'' # Fix-Me: Tests fail for 'aarch64-linux' as: "CONFIG_CGROUP_FREEZER: missing (fail)"
+ lib.optionalString (!pkgs.stdenv.isAarch64) ''machine.succeed("k3s check-config")''
+ lib.optionalString (!pkgs.stdenv.hostPlatform.isAarch64) ''machine.succeed("k3s check-config")''
+ ''
machine.succeed(
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/libvirtd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions nixos/tests/pulseaudio.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];
Expand All @@ -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")
''}
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/stub-ld.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/sunshine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
};

Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/wine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/ario/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/audio/ashuffle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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" ];

Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/audio/aucatctl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ stdenv.mkDerivation (finalAttrs: {
};

buildInputs = [ sndio ]
++ lib.optional (!stdenv.isDarwin && !stdenv.hostPlatform.isBSD)
++ lib.optional (!stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isBSD)
libbsd;

outputs = [ "out" "man" ];

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'
Expand Down
Loading