alvr: 20.11.1 -> 20.12.1 (#374869)
[NixPkgs.git] / pkgs / applications / audio / hqplayer-desktop / default.nix
blob8dd61ab808f41bb03b69ded478bb91ff9e16736a
2   stdenv,
3   alsa-lib,
4   autoPatchelfHook,
5   dpkg,
6   evince,
7   fetchurl,
8   flac,
9   lib,
10   libmicrohttpd,
11   libogg,
12   libusb-compat-0_1,
13   llvmPackages,
14   mpfr,
15   qtcharts,
16   qtdeclarative,
17   qtwayland,
18   qtwebengine,
19   qtwebview,
20   wavpack,
21   wrapQtAppsHook,
24 let
25   version = "5.8.2-25";
26   srcs = {
27     aarch64-linux = fetchurl {
28       url = "https://signalyst.com/bins/bookworm/hqplayer5desktop_${version}_arm64.deb";
29       hash = "sha256-t3aiEkxl5fP5yup2l/iuLqZhltIjo4Ahe8EUg52lOLQ=";
30     };
31     x86_64-linux = fetchurl {
32       url = "https://signalyst.com/bins/noble/hqplayer5desktop_${version}_amd64.deb";
33       hash = "sha256-kDNVR8HkMogbdk5+eRszpyLeuE+vO3ynDS+TmCWYZ2Y=";
34     };
35   };
37 stdenv.mkDerivation {
38   pname = "hqplayer-desktop";
39   inherit version;
41   src =
42     srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
44   nativeBuildInputs = [
45     autoPatchelfHook
46     dpkg
47     wrapQtAppsHook
48   ];
50   buildInputs = [
51     alsa-lib
52     flac
53     stdenv.cc.cc.lib
54     libmicrohttpd
55     libogg
56     libusb-compat-0_1
57     llvmPackages.openmp
58     mpfr
59     qtcharts
60     qtdeclarative
61     qtwayland
62     qtwebengine
63     qtwebview
64     wavpack
65   ];
67   dontPatch = true;
68   dontConfigure = true;
69   dontBuild = true;
71   installPhase = ''
72     runHook preInstall
74     # main executable
75     mkdir -p "$out"/bin
76     mv ./usr/bin/* "$out"/bin
78     # documentation
79     mkdir -p "$doc/share/doc/hqplayer-desktop" "$doc/share/applications"
80     mv ./usr/share/doc/hqplayer5desktop/* "$doc/share/doc/hqplayer-desktop"
81     mv ./usr/share/applications/hqplayer5desktop-manual.desktop "$doc/share/applications"
83     # desktop files
84     mkdir -p "$out/share/applications"
85     mv ./usr/share/applications/* "$out/share/applications"
87     # pixmaps
88     mkdir -p "$out/share/pixmaps"
89     mv ./usr/share/pixmaps/* "$out/share/pixmaps"
91     runHook postInstall
92   '';
94   # doc has dependencies on evince that is not required by main app
95   outputs = [
96     "out"
97     "doc"
98   ];
100   postInstall = ''
101     for desktopFile in $out/share/applications/hqplayer5{client,desktop}.desktop; do
102       substituteInPlace "$desktopFile" \
103         --replace /usr/bin "$out"/bin
104     done
105     substituteInPlace "$doc/share/applications/hqplayer5desktop-manual.desktop" \
106         --replace /usr/share/doc/hqplayer5desktop "$doc/share/doc/hqplayer-desktop" \
107         --replace evince "${evince}/bin/evince"
108   '';
110   postFixup = ''
111     patchelf --replace-needed libomp.so.5 libomp.so $out/bin/.hqplayer5*-wrapped
112   '';
114   meta = with lib; {
115     homepage = "https://www.signalyst.com";
116     description = "High-end upsampling multichannel software HD-audio player";
117     license = licenses.unfree;
118     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
119     platforms = builtins.attrNames srcs;
120     maintainers = with maintainers; [ lovesegfault ];
121   };