Skip to content

Commit

Permalink
pdfstudio: init at 2021.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippWoelfel authored and Philipp Woelfel committed Dec 21, 2021
1 parent 19790c4 commit edc4698
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion maintainers/maintainer-list.nix
Expand Up @@ -13430,6 +13430,6 @@
name = "Philipp Woelfel";
email = "philipp.woelfel@gmail.com";
github = "PhilippWoelfel";
githubID = 19400064;
githubId = 19400064;
};
}
34 changes: 16 additions & 18 deletions pkgs/applications/misc/pdfstudio/default.nix
Expand Up @@ -12,20 +12,20 @@
gnome2,
alsa-lib,
libgccjit,
jdk11
}:

let
year = "2021";
rel = "1";
subrel = "1";
in
stdenv.mkDerivation rec {
major = "1";
minor = "1";
in stdenv.mkDerivation rec {
pname = "pdfstudio";
version = "${year}.${rel}.${subrel}";
autoPatchelfIgnoreMissingDeps=true;
version = "${year}.${major}.${minor}";
autoPatchelfIgnoreMissingDeps = true;

src = fetchurl {
url = "https://download.qoppa.com/${pname}/v${year}/PDFStudio_v${year}_${rel}_${subrel}_linux64.deb";
url = "https://download.qoppa.com/${pname}/v${year}/PDFStudio_v${year}_${major}_${minor}_linux64.deb";
sha256 = "089jfpbsxwjhx245g8svlmg213kny3z5nl6ra1flishnrsfjjcxb";
};

Expand All @@ -41,9 +41,10 @@ stdenv.mkDerivation rec {
makeWrapper
dpkg
copyDesktopItems
jdk11 # only for unpacking .jar.pack files
];

desktopItems = lib.singleton (makeDesktopItem {
desktopItems = [(makeDesktopItem {
name = "${pname}${year}";
desktopName = "PDF Studio";
genericName = "View and edit PDF files";
Expand All @@ -54,7 +55,7 @@ stdenv.mkDerivation rec {
categories = "Office";
type = "Application";
terminal = false;
});
})];

unpackPhase = "dpkg-deb -x $src .";
dontConfigure = true;
Expand All @@ -71,16 +72,13 @@ stdenv.mkDerivation rec {
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
'';
#Unpack jar files. Otherwise pdfstudio does this and fails due to read-only FS.
for pfile in $out/share/${pname}${year}/jre/lib/{,ext/}*.jar.pack; do
jar_file=`echo "$pfile" | awk '{ print substr($0,1,length($0)-5) }'`
unpack200 -r "$pfile" "$jar_file"
done
# 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}
runHook postInstall
'';

meta = with lib; {
Expand Down

0 comments on commit edc4698

Please sign in to comment.