1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 12:11:28 +00:00
nixpkgs/pkgs/servers/hqplayerd/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

120 lines
2.5 KiB
Nix
Raw Normal View History

2022-05-04 00:21:57 +01:00
{ stdenv, lib
2021-10-21 23:14:36 +01:00
, addOpenGLRunpath
2022-05-04 00:21:57 +01:00
, alsa-lib
2021-06-10 07:40:27 +01:00
, autoPatchelfHook
, cairo
, fetchurl
, flac
2022-08-10 04:45:57 +01:00
, gcc12
2021-06-10 07:40:27 +01:00
, gssdp
2022-05-04 00:21:57 +01:00
, gupnp
, gupnp-av
2022-01-22 20:19:48 +00:00
, lame
2021-06-10 07:40:27 +01:00
, libgmpris
2022-05-04 00:21:57 +01:00
, libusb-compat-0_1
2022-11-09 16:18:38 +00:00
, llvmPackages_14
2022-05-04 00:21:57 +01:00
, meson
2021-11-04 22:32:34 +00:00
, mpg123
2022-05-04 00:21:57 +01:00
, ninja
2021-06-10 07:40:27 +01:00
, rpmextract
, wavpack
2022-11-09 16:18:38 +00:00
, callPackage
, rygel ? null
}@inputs:
let
# FIXME: Replace with gnome.rygel once hqplayerd releases a new version.
rygel-hqplayerd = inputs.rygel or (callPackage ./rygel.nix { });
in
2021-06-10 07:40:27 +01:00
stdenv.mkDerivation rec {
pname = "hqplayerd";
2023-02-01 17:20:09 +00:00
version = "4.34.0-100sse42";
2021-06-10 07:40:27 +01:00
src = fetchurl {
2022-08-10 04:45:57 +01:00
url = "https://www.signalyst.eu/bins/${pname}/fc36/${pname}-${version}.fc36.x86_64.rpm";
2023-02-01 17:20:09 +00:00
hash = "sha256-MCRZ0XKi6pztVTuPQpPEn6wHsOwtSxR0Px9r12jnC9U=";
2021-06-10 07:40:27 +01:00
};
unpackPhase = ''
${rpmextract}/bin/rpmextract $src
'';
2021-10-21 23:14:36 +01:00
nativeBuildInputs = [ addOpenGLRunpath autoPatchelfHook rpmextract ];
2021-06-10 07:40:27 +01:00
buildInputs = [
alsa-lib
cairo
flac
2022-08-10 04:45:57 +01:00
gcc12.cc.lib
2022-11-09 16:18:38 +00:00
rygel-hqplayerd
2021-06-10 07:40:27 +01:00
gssdp
2022-04-18 07:58:59 +01:00
gupnp
gupnp-av
2022-01-22 20:19:48 +00:00
lame
2021-06-10 07:40:27 +01:00
libgmpris
2022-05-04 00:21:57 +01:00
libusb-compat-0_1
2022-11-09 16:18:38 +00:00
llvmPackages_14.openmp
2021-11-04 22:32:34 +00:00
mpg123
2021-06-10 07:40:27 +01:00
wavpack
];
dontConfigure = true;
dontBuild = true;
installPhase = ''
2021-06-13 23:12:55 +01:00
runHook preInstall
2022-05-04 00:21:57 +01:00
# executables
mkdir -p $out
cp -rv ./usr/bin $out/bin
# libs
mkdir -p $out
cp -rv ./opt/hqplayerd/lib $out
2021-06-10 07:40:27 +01:00
2022-05-04 00:21:57 +01:00
# configuration
mkdir -p $out/etc
cp -rv ./etc/hqplayer $out/etc/
2021-06-10 07:40:27 +01:00
# systemd service file
2022-05-04 00:21:57 +01:00
mkdir -p $out/lib/systemd
cp -rv ./usr/lib/systemd/system $out/lib/systemd/
2021-06-10 07:40:27 +01:00
# documentation
2022-05-04 00:21:57 +01:00
mkdir -p $out/share/doc
cp -rv ./usr/share/doc/hqplayerd $out/share/doc/
2021-06-10 07:40:27 +01:00
# misc service support files
2022-05-04 00:21:57 +01:00
mkdir -p $out/var/lib
cp -rv ./var/lib/hqplayer $out/var/lib/
2021-06-13 23:12:55 +01:00
runHook postInstall
2021-06-10 07:40:27 +01:00
'';
postInstall = ''
substituteInPlace $out/lib/systemd/system/hqplayerd.service \
--replace /usr/bin/hqplayerd $out/bin/hqplayerd \
--replace "NetworkManager-wait-online.service" ""
2021-06-10 07:40:27 +01:00
'';
2021-10-21 23:14:36 +01:00
# NB: addOpenGLRunpath needs to run _after_ autoPatchelfHook, which runs in
# postFixup, so we tack it on here.
doInstallCheck = true;
installCheckPhase = ''
addOpenGLRunpath $out/bin/hqplayerd
$out/bin/hqplayerd --version
2021-06-10 07:40:27 +01:00
'';
2022-11-09 16:18:38 +00:00
passthru = {
rygel = rygel-hqplayerd;
};
2021-06-10 07:40:27 +01:00
meta = with lib; {
homepage = "https://www.signalyst.com/custom.html";
description = "High-end upsampling multichannel software embedded HD-audio player";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2021-06-10 07:40:27 +01:00
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
2021-06-10 07:40:27 +01:00
maintainers = with maintainers; [ lovesegfault ];
};
}