diff --git a/pkgs/applications/misc/masterpdfeditor/default.nix b/pkgs/applications/misc/masterpdfeditor/default.nix index ac6cf2b91c69..3155ab678d86 100644 --- a/pkgs/applications/misc/masterpdfeditor/default.nix +++ b/pkgs/applications/misc/masterpdfeditor/default.nix @@ -1,11 +1,14 @@ { stdenv, fetchurl, sane-backends, qtbase, qtsvg, nss, autoPatchelfHook }: + let - version = "5.1.00"; + version = "5.1.12"; + in stdenv.mkDerivation { name = "masterpdfeditor-${version}"; + src = fetchurl { url = "https://code-industry.net/public/master-pdf-editor-${version}_qt5.amd64.tar.gz"; - sha256 = "1s2zhx9xr1ny5s8hmlb99v3z1v26vmx87iixk8cdgndz046p9bg9"; + sha256 = "1i3pdrhnlj06phm36gs42s6b94pigcfb8wa5dhmplxn0dqp434hq"; }; nativeBuildInputs = [ autoPatchelfHook ]; @@ -15,21 +18,24 @@ in stdenv.mkDerivation { dontStrip = true; installPhase = '' - p=$out/opt/masterpdfeditor - mkdir -p $out/bin $p $out/share/applications $out/share/pixmaps + runHook preInstall - substituteInPlace masterpdfeditor5.desktop \ - --replace 'Exec=/opt/master-pdf-editor-5' "Exec=$out/bin" \ - --replace 'Path=/opt/master-pdf-editor-5' "Path=$out/bin" \ - --replace 'Icon=/opt/master-pdf-editor-5' "Icon=$out/share/pixmaps" - cp -v masterpdfeditor5.png $out/share/pixmaps/ - cp -v masterpdfeditor5.desktop $out/share/applications + p=$out/opt/masterpdfeditor + mkdir -p $out/bin - cp -v masterpdfeditor5 $p/ - ln -s $p/masterpdfeditor5 $out/bin/masterpdfeditor5 - cp -v -r stamps templates lang fonts $p + substituteInPlace masterpdfeditor5.desktop \ + --replace 'Exec=/opt/master-pdf-editor-5' "Exec=$out/bin" \ + --replace 'Path=/opt/master-pdf-editor-5' "Path=$out/bin" \ + --replace 'Icon=/opt/master-pdf-editor-5' "Icon=$out/share/pixmaps" - install -D license.txt $out/share/$name/LICENSE + install -Dm644 -t $out/share/pixmaps masterpdfeditor5.png + install -Dm644 -t $out/share/applications masterpdfeditor5.desktop + install -Dm755 -t $p masterpdfeditor5 + install -Dm644 license.txt $out/share/$name/LICENSE + ln -s $p/masterpdfeditor5 $out/bin/masterpdfeditor5 + cp -v -r stamps templates lang fonts $p + + runHook postInstall ''; meta = with stdenv.lib; {