pdfstudio: merge with package pdfstudioviewer (#156274)
* pdfstudio: merge with pdfstudioviewer and use FHS sandbox to fix printing Co-authored-by: Ivv <41924494+IvarWithoutBones@users.noreply.github.com>
This commit is contained in:
parent
7f9c0d1683
commit
e79bb564af
4 changed files with 140 additions and 162 deletions
98
pkgs/applications/misc/pdfstudio/common.nix
Normal file
98
pkgs/applications/misc/pdfstudio/common.nix
Normal file
|
@ -0,0 +1,98 @@
|
|||
{ pname
|
||||
, src
|
||||
, year
|
||||
, version
|
||||
, desktopName
|
||||
, longDescription
|
||||
, buildFHSUserEnv
|
||||
, extraBuildInputs ? []
|
||||
, stdenv
|
||||
, lib
|
||||
, dpkg
|
||||
, makeDesktopItem
|
||||
, copyDesktopItems
|
||||
, autoPatchelfHook
|
||||
, sane-backends
|
||||
, cups
|
||||
, jdk11
|
||||
}:
|
||||
let
|
||||
thisPackage = stdenv.mkDerivation rec {
|
||||
inherit pname src version;
|
||||
strictDeps = true;
|
||||
|
||||
buildInputs = [
|
||||
sane-backends #for libsane.so.1
|
||||
jdk11
|
||||
] ++ extraBuildInputs;
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
dpkg
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
desktopItems = [
|
||||
(makeDesktopItem {
|
||||
name = "${pname}${year}";
|
||||
desktopName = desktopName;
|
||||
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;
|
||||
})
|
||||
];
|
||||
|
||||
unpackCmd = "dpkg-deb -x $src ./${pname}-${version}";
|
||||
dontBuild = true;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace opt/${pname}${year}/${pname}${year} --replace "# INSTALL4J_JAVA_HOME_OVERRIDE=" "INSTALL4J_JAVA_HOME_OVERRIDE=${jdk11.out}"
|
||||
substituteInPlace opt/${pname}${year}/updater --replace "# INSTALL4J_JAVA_HOME_OVERRIDE=" "INSTALL4J_JAVA_HOME_OVERRIDE=${jdk11.out}"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{bin,share/pixmaps}
|
||||
rm -rf opt/${pname}${year}/jre
|
||||
cp -r opt/${pname}${year} $out/share/
|
||||
ln -s $out/share/${pname}${year}/.install4j/${pname}${year}.png $out/share/pixmaps/
|
||||
ln -s $out/share/${pname}${year}/${pname}${year} $out/bin/${pname}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
|
||||
in
|
||||
# Package with cups in FHS sandbox, because JAVA bin expects "/usr/bin/lpr" for printing.
|
||||
buildFHSUserEnv {
|
||||
name = pname;
|
||||
targetPkgs = pkgs: [
|
||||
cups
|
||||
thisPackage
|
||||
];
|
||||
runScript = pname;
|
||||
|
||||
# link desktop item and icon into FHS user environment
|
||||
extraInstallCommands = ''
|
||||
mkdir -p "$out/share/applications"
|
||||
mkdir -p "$out/share/pixmaps"
|
||||
ln -s ${thisPackage}/share/applications/*.desktop "$out/share/applications/"
|
||||
ln -s ${thisPackage}/share/pixmaps/*.png "$out/share/pixmaps/"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.qoppa.com/${pname}/";
|
||||
description = "An easy to use, full-featured PDF editing software";
|
||||
longDescription = longDescription;
|
||||
license = licenses.unfree;
|
||||
platforms = platforms.linux;
|
||||
mainProgram = pname;
|
||||
maintainers = [ maintainers.pwoelfel ];
|
||||
};
|
||||
}
|
|
@ -1,87 +1,42 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
{ program ? "pdfstudioviewer"
|
||||
, fetchurl
|
||||
, libgccjit
|
||||
, dpkg
|
||||
, makeDesktopItem
|
||||
, copyDesktopItems
|
||||
, autoPatchelfHook
|
||||
, sane-backends
|
||||
, jdk11
|
||||
, callPackage
|
||||
}:
|
||||
|
||||
# See also package 'pdfstudioviewer'
|
||||
# Differences are ${pname}, Download directory name (PDFStudio / PDFStudioViewer),
|
||||
# sha256, and libgccjit (not needed for PDFStudioViewer)
|
||||
let year = "2021";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "pdfstudio";
|
||||
version = "${year}.1.2";
|
||||
strictDeps = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.qoppa.com/${pname}/v${year}/PDFStudio_v${
|
||||
{
|
||||
pdfstudio = callPackage ./common.nix rec {
|
||||
pname = program;
|
||||
year = "2021";
|
||||
version = "${year}.1.2";
|
||||
desktopName = "PDF Studio";
|
||||
longDescription = ''
|
||||
PDF Studio is an easy to use, full-featured PDF editing software. This is the standard/pro edition, which requires a license. For the free PDF Studio Viewer see the package pdfstudioviewer.
|
||||
'';
|
||||
extraBuildInputs = [
|
||||
libgccjit #for libstdc++.so.6 and libgomp.so.1
|
||||
];
|
||||
src = fetchurl {
|
||||
url = "https://download.qoppa.com/${pname}/v${year}/PDFStudio_v${
|
||||
builtins.replaceStrings [ "." ] [ "_" ] version
|
||||
}_linux64.deb";
|
||||
sha256 = "1188ll2qz58rr2slavqxisbz4q3fdzidpasb1p33926z0ym3rk45";
|
||||
}_linux64.deb";
|
||||
sha256 = "1188ll2qz58rr2slavqxisbz4q3fdzidpasb1p33926z0ym3rk45";
|
||||
};
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
libgccjit #for libstdc++.so.6 and libgomp.so.1
|
||||
sane-backends #for libsane.so.1
|
||||
jdk11
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
dpkg
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
desktopItems = [
|
||||
(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 .";
|
||||
dontBuild = true;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace opt/${pname}${year}/${pname}${year} --replace "# INSTALL4J_JAVA_HOME_OVERRIDE=" "INSTALL4J_JAVA_HOME_OVERRIDE=${jdk11.out}"
|
||||
substituteInPlace opt/${pname}${year}/updater --replace "# INSTALL4J_JAVA_HOME_OVERRIDE=" "INSTALL4J_JAVA_HOME_OVERRIDE=${jdk11.out}"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share
|
||||
mkdir -p $out/share/pixmaps
|
||||
cp -r opt/${pname}${year} $out/share/
|
||||
rm -rf $out/share/${pname}${year}/jre
|
||||
ln -s $out/share/${pname}${year}/.install4j/${pname}${year}.png $out/share/pixmaps/
|
||||
ln -s $out/share/${pname}${year}/${pname}${year} $out/bin/${pname}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
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;
|
||||
mainProgram = pname;
|
||||
maintainers = [ maintainers.pwoelfel ];
|
||||
pdfstudioviewer = callPackage ./common.nix rec {
|
||||
pname = program;
|
||||
year = "2021";
|
||||
version = "${year}.1.2";
|
||||
desktopName = "PDF Studio Viewer";
|
||||
longDescription = ''
|
||||
PDF Studio Viewer is an easy to use, full-featured PDF editing software. This is the free edition. For the standard/pro edition, see the package pdfstudio.
|
||||
'';
|
||||
src = fetchurl {
|
||||
url = "https://download.qoppa.com/${pname}/v${year}/PDFStudioViewer_v${
|
||||
builtins.replaceStrings [ "." ] [ "_" ] version
|
||||
}_linux64.deb";
|
||||
sha256 = "128k3fm8m8zdykx4s30g5m2zl7cgmvs4qinf1w525zh84v56agz6";
|
||||
};
|
||||
};
|
||||
}
|
||||
}.${program}
|
||||
|
|
|
@ -1,81 +0,0 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, dpkg
|
||||
, makeDesktopItem
|
||||
, copyDesktopItems
|
||||
, autoPatchelfHook
|
||||
, sane-backends
|
||||
, jdk11
|
||||
}:
|
||||
|
||||
let year = "2021";
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "pdfstudioviewer";
|
||||
version = "${year}.1.2";
|
||||
autoPatchelfIgnoreMissingDeps = false;
|
||||
strictDeps = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://download.qoppa.com/${pname}/v${year}/PDFStudioViewer_v${
|
||||
builtins.replaceStrings [ "." ] [ "_" ] version
|
||||
}_linux64.deb";
|
||||
sha256 = "128k3fm8m8zdykx4s30g5m2zl7cgmvs4qinf1w525zh84v56agz6";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
sane-backends
|
||||
jdk11
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
dpkg
|
||||
copyDesktopItems
|
||||
];
|
||||
|
||||
desktopItems = [
|
||||
(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 .";
|
||||
dontBuild = true;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace opt/${pname}${year}/${pname}${year} --replace "# INSTALL4J_JAVA_HOME_OVERRIDE=" "INSTALL4J_JAVA_HOME_OVERRIDE=${jdk11.out}"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/share
|
||||
mkdir -p $out/share/pixmaps
|
||||
cp -r opt/${pname}${year} $out/share/
|
||||
rm -rf $out/share/${pname}${year}/jre
|
||||
ln -s $out/share/${pname}${year}/.install4j/${pname}${year}.png $out/share/pixmaps/
|
||||
ln -s $out/share/${pname}${year}/${pname}${year} $out/bin/${pname}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
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;
|
||||
mainProgram = pname;
|
||||
maintainers = [ maintainers.pwoelfel ];
|
||||
};
|
||||
}
|
|
@ -24263,9 +24263,15 @@ with pkgs;
|
|||
|
||||
foxitreader = libsForQt512.callPackage ../applications/misc/foxitreader { };
|
||||
|
||||
pdfstudio = callPackage ../applications/misc/pdfstudio { };
|
||||
pdfstudio = import ../applications/misc/pdfstudio {
|
||||
program = "pdfstudio";
|
||||
inherit callPackage fetchurl libgccjit;
|
||||
};
|
||||
|
||||
pdfstudioviewer = callPackage ../applications/misc/pdfstudioviewer { };
|
||||
pdfstudioviewer = import ../applications/misc/pdfstudio {
|
||||
program = "pdfstudioviewer";
|
||||
inherit callPackage fetchurl libgccjit;
|
||||
};
|
||||
|
||||
aeolus = callPackage ../applications/audio/aeolus { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue