qpdfview: refactor

This commit is contained in:
Felix Buehler 2022-01-13 00:22:37 +01:00
parent 5321a6b82a
commit ebbbd42140

View file

@ -1,30 +1,40 @@
{lib, mkDerivation, fetchurl, qmake, qtbase, qtsvg, pkg-config, poppler, djvulibre, libspectre, cups { lib
, file, ghostscript , mkDerivation
, fetchurl
, qmake
, qtbase
, qtsvg
, pkg-config
, poppler
, djvulibre
, libspectre
, cups
, file
, ghostscript
}: }:
let mkDerivation rec {
s = # Generated upstream information pname = "qpdfview";
rec { version = "0.4.18";
baseName="qpdfview";
version = "0.4.18"; src = fetchurl {
name="${baseName}-${version}"; url = "https://launchpad.net/qpdfview/trunk/${version}/+download/qpdfview-${version}.tar.gz";
url="https://launchpad.net/qpdfview/trunk/${version}/+download/qpdfview-${version}.tar.gz";
sha256 = "0v1rl126hvblajnph2hkansgi0s8vjdc5yxrm4y3faa0lxzjwr6c"; sha256 = "0v1rl126hvblajnph2hkansgi0s8vjdc5yxrm4y3faa0lxzjwr6c";
}; };
nativeBuildInputs = [ qmake pkg-config ];
buildInputs = [
qtbase qtsvg poppler djvulibre libspectre cups file ghostscript
];
# apply upstream fix for qt5.15 https://bazaar.launchpad.net/~adamreichold/qpdfview/trunk/revision/2104 # apply upstream fix for qt5.15 https://bazaar.launchpad.net/~adamreichold/qpdfview/trunk/revision/2104
patches = [ ./qpdfview-qt515-compat.patch ]; patches = [ ./qpdfview-qt515-compat.patch ];
in
mkDerivation {
pname = s.baseName;
inherit (s) version;
inherit nativeBuildInputs buildInputs patches;
src = fetchurl {
inherit (s) url sha256;
};
nativeBuildInputs = [ qmake pkg-config ];
buildInputs = [
qtbase
qtsvg
poppler
djvulibre
libspectre
cups
file
ghostscript
];
preConfigure = '' preConfigure = ''
qmakeFlags+=(*.pro) qmakeFlags+=(*.pro)
''; '';
@ -39,13 +49,11 @@ mkDerivation {
"APPDATA_INSTALL_PATH=${placeholder "out"}/share/appdata" "APPDATA_INSTALL_PATH=${placeholder "out"}/share/appdata"
]; ];
meta = { meta = with lib; {
inherit (s) version;
description = "A tabbed document viewer"; description = "A tabbed document viewer";
license = lib.licenses.gpl2Plus; license = licenses.gpl2Plus;
maintainers = [lib.maintainers.raskin]; maintainers = with maintainers; [ raskin ];
platforms = lib.platforms.linux; platforms = platforms.linux;
homepage = "https://launchpad.net/qpdfview"; homepage = "https://launchpad.net/qpdfview";
updateWalker = true;
}; };
} }