nixpkgs/pkgs/applications/audio/snapcast/default.nix
Rick van Schijndel 9833d56c24 treewide: mark packages broken that never built on PLATFORM
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.

I manually audited the results and removed some results that were not valid.

Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.

Some observations:

- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
  - gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
  platforms that are not x86_64-linux
2022-12-13 21:40:12 +01:00

52 lines
1.6 KiB
Nix

{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, darwin
, alsa-lib, asio, avahi, boost17x, flac, libogg, libvorbis, soxr
, aixlog, popl
, pulseaudioSupport ? false, libpulseaudio
, nixosTests }:
assert pulseaudioSupport -> libpulseaudio != null;
stdenv.mkDerivation rec {
pname = "snapcast";
version = "0.26.0";
src = fetchFromGitHub {
owner = "badaix";
repo = "snapcast";
rev = "v${version}";
sha256 = "sha256-CCifn9OEFM//Hk1PJj8T3MXIV8pXCTdBBXPsHuZwLyQ=";
};
nativeBuildInputs = [ cmake pkg-config ];
# snapcast also supports building against tremor but as we have libogg, that's
# not needed
buildInputs = [
boost17x
asio avahi flac libogg libvorbis
aixlog popl soxr
] ++ lib.optional pulseaudioSupport libpulseaudio
++ lib.optional stdenv.isLinux alsa-lib
++ lib.optionals stdenv.isDarwin [darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.AudioToolbox];
TARGET=lib.optionalString stdenv.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...
postInstall = ''
install -d $out/share/doc/snapcast
cp -r ../doc/* ../*.md $out/share/doc/snapcast
'';
passthru.tests.snapcast = nixosTests.snapcast;
meta = with lib; {
description = "Synchronous multi-room audio player";
homepage = "https://github.com/badaix/snapcast";
maintainers = with maintainers; [ fpletz ];
platforms = platforms.linux ++ platforms.darwin;
license = licenses.gpl3Plus;
# never built on x86_64-darwin since first introduction in nixpkgs
broken = stdenv.isDarwin && stdenv.isx86_64;
};
}