diff options
author | Philipp Woelfel <woelfel@ucalgary.ca> | 2021-12-19 02:58:15 -0700 |
---|---|---|
committer | Philipp Woelfel <woelfel@ucalgary.ca> | 2021-12-21 00:51:51 -0700 |
commit | 19790c41226930713d08e88d4e61f012ed44d4d7 (patch) | |
tree | a3a6539048ee12984bbcc4d18c8bb678e1d3afcf /pkgs/applications/misc/pdfstudio | |
parent | 59969084c760623ab05d15b5dbcdcfcf02a14d82 (diff) |
maintainers: add pwoelfel
Diffstat (limited to 'pkgs/applications/misc/pdfstudio')
-rw-r--r-- | pkgs/applications/misc/pdfstudio/default.nix | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/pkgs/applications/misc/pdfstudio/default.nix b/pkgs/applications/misc/pdfstudio/default.nix new file mode 100644 index 0000000000000..59ad2f0a1b086 --- /dev/null +++ b/pkgs/applications/misc/pdfstudio/default.nix @@ -0,0 +1,93 @@ +{ stdenv, + lib, + makeWrapper, + fetchurl, + dpkg, + makeDesktopItem, + copyDesktopItems, + autoPatchelfHook, + gst_all_1, + sane-backends, + xorg, + gnome2, + alsa-lib, + libgccjit, + }: + +let + year = "2021"; + rel = "1"; + subrel = "1"; +in +stdenv.mkDerivation rec { + pname = "pdfstudio"; + version = "${year}.${rel}.${subrel}"; + autoPatchelfIgnoreMissingDeps=true; + + src = fetchurl { + url = "https://download.qoppa.com/${pname}/v${year}/PDFStudio_v${year}_${rel}_${subrel}_linux64.deb"; + sha256 = "089jfpbsxwjhx245g8svlmg213kny3z5nl6ra1flishnrsfjjcxb"; + }; + + nativeBuildInputs = [ + gst_all_1.gst-libav + sane-backends + xorg.libXxf86vm + xorg.libXtst + gnome2.libgtkhtml + alsa-lib + libgccjit + autoPatchelfHook + makeWrapper + dpkg + copyDesktopItems + ]; + + desktopItems = lib.singleton (makeDesktopItem { + name = "${pname}${year}"; + desktopName = "PDF Studio"; + genericName = "View and edit PDF files"; + exec = "${pname} %f"; + icon = "${pname}${year}"; + comment = "Views and edits PDF files"; + mimeType = "application/pdf"; + categories = "Office"; + type = "Application"; + terminal = false; + }); + + unpackPhase = "dpkg-deb -x $src ."; + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + mkdir -p $out/share + mkdir -p $out/share/applications + mkdir -p $out/share/pixmaps + cp -r opt/${pname}${year} $out/share/ + ln -s $out/share/${pname}${year}/.install4j/${pname}${year}.png $out/share/pixmaps/ + makeWrapper $out/share/${pname}${year}/${pname}${year} $out/bin/${pname} + + runHook postInstall + ''; + + # We need to run pdfstudio once. This will unpack some jre.pack files in jre/lib. + # We must do this after autoPatchelfHook, so we'll do this in preInstallCheck. + # An alternative would beo to patchelf manually, using this (e.g., in the fixup phase): + # find $out/share/${pname}${year}/jre/bin -type f -executable -exec patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) {} \; + doInstallCheck = true; + preInstallCheck = '' + $out/share/${pname}${year}/${pname}${year} + ''; + + meta = with lib; { + homepage = "https://www.qoppa.com/pdfstudio/"; + description = "An easy to use, full-featured PDF editing software"; + license = licenses.unfree; + platforms = platforms.linux; + maintainers = [ maintainers.pwoelfel ]; + }; +} |