Merge pull request #230019 from Et7f3/repair_hqplayer-desktop
This commit is contained in:
commit
6e500cb14c
|
@ -1,11 +1,13 @@
|
|||
{ mkDerivation
|
||||
, alsa-lib
|
||||
, autoPatchelfHook
|
||||
, evince
|
||||
, fetchurl
|
||||
, flac
|
||||
, gcc11
|
||||
, gcc12
|
||||
, lib
|
||||
, libmicrohttpd
|
||||
, libusb-compat-0_1
|
||||
, llvmPackages_10
|
||||
, qtcharts
|
||||
, qtdeclarative
|
||||
|
@ -18,15 +20,15 @@
|
|||
|
||||
mkDerivation rec {
|
||||
pname = "hqplayer-desktop";
|
||||
version = "4.13.1-38";
|
||||
version = "4.22.0-65";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.signalyst.eu/bins/hqplayer/fc34/hqplayer4desktop-${version}.fc34.x86_64.rpm";
|
||||
sha256 = "sha256-DEZWEGk5SfhcNQddehCBVbfeTH8KfVCdaxQ+F3MrRe8=";
|
||||
url = "https://www.signalyst.eu/bins/hqplayer4desktop-${version}.fc36.x86_64.rpm";
|
||||
sha256 = "sha256-PA8amsqy4O9cMruNYVhG+uBiUGQ5WfnZC2ARppmZd7g=";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
${rpmextract}/bin/rpmextract $src
|
||||
${rpmextract}/bin/rpmextract "$src"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook rpmextract ];
|
||||
|
@ -34,8 +36,9 @@ mkDerivation rec {
|
|||
buildInputs = [
|
||||
alsa-lib
|
||||
flac
|
||||
gcc11.cc.lib
|
||||
gcc12.cc.lib
|
||||
libmicrohttpd
|
||||
libusb-compat-0_1
|
||||
llvmPackages_10.openmp
|
||||
qtcharts
|
||||
qtdeclarative
|
||||
|
@ -45,41 +48,52 @@ mkDerivation rec {
|
|||
wavpack
|
||||
];
|
||||
|
||||
dontPatch = true;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# main executable
|
||||
mkdir -p $out/bin
|
||||
cp ./usr/bin/* $out/bin
|
||||
# additional library
|
||||
mkdir -p "$out"/lib
|
||||
mv ./opt/hqplayer4desktop/lib/* "$out"/lib
|
||||
|
||||
# desktop files
|
||||
mkdir -p $out/share/applications
|
||||
cp ./usr/share/applications/* $out/share/applications
|
||||
# main executable
|
||||
mkdir -p "$out"/bin
|
||||
mv ./usr/bin/* "$out"/bin
|
||||
|
||||
# documentation
|
||||
mkdir -p $out/share/doc/${pname}
|
||||
cp ./usr/share/doc/hqplayer4desktop/* $out/share/doc/${pname}
|
||||
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"
|
||||
|
||||
# desktop files
|
||||
mkdir -p "$out/share/applications"
|
||||
mv ./usr/share/applications/* "$out/share/applications"
|
||||
|
||||
# pixmaps
|
||||
mkdir -p $out/share/pixmaps
|
||||
cp ./usr/share/pixmaps/* $out/share/pixmaps
|
||||
mkdir -p "$out/share/pixmaps"
|
||||
mv ./usr/share/pixmaps/* "$out/share/pixmaps"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
# doc has dependencies on evince that is not required by main app
|
||||
outputs = [ "out" "doc" ];
|
||||
|
||||
postInstall = ''
|
||||
for desktopFile in $out/share/applications/*; do
|
||||
for desktopFile in $out/share/applications/hqplayer4{desktop-nostyle,desktop-highdpi,-client,desktop}.desktop; do
|
||||
substituteInPlace "$desktopFile" \
|
||||
--replace /usr/bin/ $out/bin/ \
|
||||
--replace /usr/share/doc/ $out/share/doc/
|
||||
--replace /usr/bin "$out"/bin
|
||||
done
|
||||
substituteInPlace "$doc/share/applications/hqplayer4desktop-manual.desktop" \
|
||||
--replace /usr/share/doc/hqplayer4desktop "$doc/share/doc/${pname}" \
|
||||
--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/.hqplayer4desktop-wrapped"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -89,7 +103,5 @@ mkDerivation rec {
|
|||
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ lovesegfault ];
|
||||
# src link returns 403
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue