push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,116 @@
{
lib,
stdenv,
fetchFromGitHub,
flac,
libgpiod,
libmad,
libpulseaudio,
libvorbis,
mpg123,
audioBackend ? if stdenv.hostPlatform.isLinux then "alsa" else "portaudio",
alsaSupport ? stdenv.hostPlatform.isLinux,
alsa-lib,
dsdSupport ? true,
faad2Support ? true,
faad2,
ffmpegSupport ? true,
ffmpeg,
opusSupport ? true,
opusfile,
resampleSupport ? true,
soxr,
sslSupport ? true,
openssl,
portaudioSupport ? stdenv.hostPlatform.isDarwin,
portaudio,
slimserver,
}:
let
inherit (lib) optional optionals optionalString;
pulseSupport = audioBackend == "pulse";
binName = "squeezelite${optionalString pulseSupport "-pulse"}";
in
stdenv.mkDerivation {
# the nixos module uses the pname as the binary name
pname = binName;
# versions are specified in `squeezelite.h`
# see https://github.com/ralph-irving/squeezelite/issues/29
version = "2.0.0.1541";
src = fetchFromGitHub {
owner = "ralph-irving";
repo = "squeezelite";
rev = "72e1fd8abfa9b2f8e9636f033247526920878718";
hash = "sha256-1uzkf7vkzfHdsWvWcXnUv279kgtzrHLU0hAPaTKRWI8=";
};
buildInputs = [
flac
libmad
libvorbis
mpg123
]
++ optional pulseSupport libpulseaudio
++ optional alsaSupport alsa-lib
++ optional portaudioSupport portaudio
++ optional faad2Support faad2
++ optional ffmpegSupport ffmpeg
++ optional opusSupport opusfile
++ optional resampleSupport soxr
++ optional sslSupport openssl
++ optional (stdenv.hostPlatform.isAarch32 or stdenv.hostPlatform.isAarch64) libgpiod;
enableParallelBuilding = true;
postPatch = ''
substituteInPlace opus.c \
--replace "<opusfile.h>" "<opus/opusfile.h>"
'';
EXECUTABLE = binName;
OPTS = [
"-DLINKALL"
"-DGPIO"
]
++ optional dsdSupport "-DDSD"
++ optional (!faad2Support) "-DNO_FAAD"
++ optional ffmpegSupport "-DFFMPEG"
++ optional opusSupport "-DOPUS"
++ optional portaudioSupport "-DPORTAUDIO"
++ optional pulseSupport "-DPULSEAUDIO"
++ optional resampleSupport "-DRESAMPLE"
++ optional sslSupport "-DUSE_SSL"
++ optional (stdenv.hostPlatform.isAarch32 or stdenv.hostPlatform.isAarch64) "-DRPI";
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { LDADD = "-lportaudio -lpthread"; };
installPhase = ''
runHook preInstall
install -Dm555 -t $out/bin ${binName}
install -Dm444 -t $out/share/man/man1 doc/squeezelite.1
runHook postInstall
'';
passthru = {
inherit (slimserver) tests;
updateScript = ./update.sh;
};
meta = with lib; {
description = "Lightweight headless squeezebox client emulator";
homepage = "https://github.com/ralph-irving/squeezelite";
license = with licenses; [ gpl3Plus ] ++ optional dsdSupport bsd2;
mainProgram = binName;
maintainers = with maintainers; [ adamcstephens ];
platforms =
if (audioBackend == "pulse") then platforms.linux else platforms.linux ++ platforms.darwin;
};
}

View File

@@ -0,0 +1,18 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p common-updater-scripts coreutils curl gnused jq nix nix-prefetch-git nix-prefetch-github ripgrep
set -euo pipefail
latestRev="$(curl -s "https://api.github.com/repos/ralph-irving/squeezelite/commits?per_page=1" | jq -r ".[0].sha")"
latestVersion="$( curl -s https://raw.githubusercontent.com/ralph-irving/squeezelite/${latestRev}/squeezelite.h | rg 'define (MAJOR|MINOR|MICRO)_VERSION' | sed 's/#.*VERSION //' | tr '\n' '.' | sed -e 's/"//g' -e 's/\.$//')"
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; squeezelite.version or (lib.getVersion squeezelite)" | tr -d '"')
if [[ "$currentVersion" == "$latestVersion" ]]; then
echo "squeezelite is up-to-date: $currentVersion"
exit 0
fi
srcHash=$(nix-prefetch-github ralph-irving squeezelite --rev "$latestRev" | jq -r .hash)
update-source-version squeezelite "$latestVersion" "$srcHash" --rev="${latestRev}"