From 73da8726b34bc4489f86e4418c45ad8c5910850c Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 10 Nov 2024 04:12:36 +0100 Subject: [PATCH] hqplayer-desktop: 4.22.0-65 -> 5.8.2-25 --- .../audio/hqplayer-desktop/default.nix | 70 +++++++++++-------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 41 insertions(+), 31 deletions(-) diff --git a/pkgs/applications/audio/hqplayer-desktop/default.nix b/pkgs/applications/audio/hqplayer-desktop/default.nix index 7aeb55bfa712c..8f097ff235901 100644 --- a/pkgs/applications/audio/hqplayer-desktop/default.nix +++ b/pkgs/applications/audio/hqplayer-desktop/default.nix @@ -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 @@ -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" @@ -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 ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 16b6aa0958736..fb55c17dbfb87 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };