Skip to content

Commit

Permalink
hqplayer-desktop: 4.22.0-65 -> 5.8.2-25
Browse files Browse the repository at this point in the history
  • Loading branch information
wegank committed Nov 19, 2024
1 parent 9342b5d commit 73da872
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 31 deletions.
70 changes: 40 additions & 30 deletions pkgs/applications/audio/hqplayer-desktop/default.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,62 @@
{ mkDerivation
{ stdenv
, alsa-lib
, autoPatchelfHook
, dpkg
, evince
, fetchurl
, flac
, gcc12
, lib
, libmicrohttpd
, libogg
, libusb-compat-0_1
, llvmPackages
, mpfr
, qtcharts
, qtdeclarative
, qtquickcontrols2
, qtwayland
, qtwebengine
, qtwebview
, rpmextract
, wavpack
, wrapQtAppsHook
}:

mkDerivation rec {
pname = "hqplayer-desktop";
version = "4.22.0-65";

src = fetchurl {
url = "https://www.signalyst.eu/bins/hqplayer4desktop-${version}.fc36.x86_64.rpm";
sha256 = "sha256-PA8amsqy4O9cMruNYVhG+uBiUGQ5WfnZC2ARppmZd7g=";
let
version = "5.8.2-25";
srcs = {
aarch64-linux = fetchurl {
url = "https://signalyst.com/bins/bookworm/hqplayer5desktop_${version}_arm64.deb";
hash = "sha256-t3aiEkxl5fP5yup2l/iuLqZhltIjo4Ahe8EUg52lOLQ=";
};
x86_64-linux = fetchurl {
url = "https://signalyst.com/bins/noble/hqplayer5desktop_${version}_amd64.deb";
hash = "sha256-kDNVR8HkMogbdk5+eRszpyLeuE+vO3ynDS+TmCWYZ2Y=";
};
};
in
stdenv.mkDerivation {
pname = "hqplayer-desktop";
inherit version;

unpackPhase = ''
${rpmextract}/bin/rpmextract "$src"
'';
src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");

nativeBuildInputs = [ autoPatchelfHook rpmextract ];
nativeBuildInputs = [
autoPatchelfHook
dpkg
wrapQtAppsHook
];

buildInputs = [
alsa-lib
flac
gcc12.cc.lib
stdenv.cc.cc.lib
libmicrohttpd
libogg
libusb-compat-0_1
llvmPackages.openmp
mpfr
qtcharts
qtdeclarative
qtquickcontrols2
qtwayland
qtwebengine
qtwebview
wavpack
Expand All @@ -55,18 +69,14 @@ mkDerivation rec {
installPhase = ''
runHook preInstall
# additional library
mkdir -p "$out"/lib
mv ./opt/hqplayer4desktop/lib/* "$out"/lib
# main executable
mkdir -p "$out"/bin
mv ./usr/bin/* "$out"/bin
# documentation
mkdir -p "$doc/share/doc/${pname}" "$doc/share/applications"
mv ./usr/share/doc/hqplayer4desktop/* "$doc/share/doc/${pname}"
mv ./usr/share/applications/hqplayer4desktop-manual.desktop "$doc/share/applications"
mkdir -p "$doc/share/doc/hqplayer-desktop" "$doc/share/applications"
mv ./usr/share/doc/hqplayer5desktop/* "$doc/share/doc/hqplayer-desktop"
mv ./usr/share/applications/hqplayer5desktop-manual.desktop "$doc/share/applications"
# desktop files
mkdir -p "$out/share/applications"
Expand All @@ -83,25 +93,25 @@ mkDerivation rec {
outputs = [ "out" "doc" ];

postInstall = ''
for desktopFile in $out/share/applications/hqplayer4{desktop-nostyle,desktop-highdpi,-client,desktop}.desktop; do
for desktopFile in $out/share/applications/hqplayer5{client,desktop}.desktop; do
substituteInPlace "$desktopFile" \
--replace /usr/bin "$out"/bin
done
substituteInPlace "$doc/share/applications/hqplayer4desktop-manual.desktop" \
--replace /usr/share/doc/hqplayer4desktop "$doc/share/doc/${pname}" \
substituteInPlace "$doc/share/applications/hqplayer5desktop-manual.desktop" \
--replace /usr/share/doc/hqplayer5desktop "$doc/share/doc/hqplayer-desktop" \
--replace evince "${evince}/bin/evince"
'';

postFixup = ''
patchelf --replace-needed libomp.so.5 libomp.so "$out/bin/.hqplayer4desktop-wrapped"
patchelf --replace-needed libomp.so.5 libomp.so $out/bin/.hqplayer5*-wrapped
'';

meta = with lib; {
homepage = "https://www.signalyst.com/custom.html";
homepage = "https://www.signalyst.com";
description = "High-end upsampling multichannel software HD-audio player";
license = licenses.unfree;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
platforms = builtins.attrNames srcs;
maintainers = with maintainers; [ lovesegfault ];
};
}
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3855,7 +3855,7 @@ with pkgs;

hpccm = with python3Packages; toPythonApplication hpccm;

hqplayer-desktop = libsForQt5.callPackage ../applications/audio/hqplayer-desktop { };
hqplayer-desktop = qt6Packages.callPackage ../applications/audio/hqplayer-desktop { };

html-proofer = callPackage ../tools/misc/html-proofer { };

Expand Down

0 comments on commit 73da872

Please sign in to comment.