nixpkgs/pkgs/by-name/so/sonobus/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

88 lines
1.9 KiB
Nix

{
lib,
pkg-config,
stdenv,
fetchFromGitHub,
autoPatchelfHook,
alsa-lib,
cmake,
freetype,
libGL,
libX11,
libXcursor,
libXext,
libXinerama,
libXrandr,
libjack2,
libopus,
curl,
gtk3,
webkitgtk_4_0,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sonobus";
version = "1.7.2";
src = fetchFromGitHub {
owner = "sonosaurus";
repo = "sonobus";
rev = finalAttrs.version;
hash = "sha256-NOdmHFKrV7lb8XbeG5GdLKYZ0c/vcz3fcqYj9JvE+/Q=";
fetchSubmodules = true;
};
nativeBuildInputs = [
autoPatchelfHook
cmake
pkg-config
];
buildInputs = [
alsa-lib
freetype
libjack2
libopus
curl
gtk3
webkitgtk_4_0
];
runtimeDependencies = [
libGL
libX11
libXcursor
libXext
libXinerama
libXrandr
];
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.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
patchShebangs linux/install.sh
'';
# The program does not provide any CMake install instructions
installPhase = lib.optionalString (stdenv.hostPlatform.isLinux) ''
runHook preInstall
cd ../linux
./install.sh "$out"
runHook postInstall
'';
meta = with lib; {
description = "High-quality network audio streaming";
homepage = "https://sonobus.net/";
license = with licenses; [ gpl3Plus ];
maintainers = with maintainers; [ PowerUser64 ];
platforms = platforms.unix;
broken = stdenv.hostPlatform.isDarwin;
mainProgram = "sonobus";
};
})