gscan2pdf: init at 2.3.0

based on github issue #34744
closes #34744
This commit is contained in:
pacien 2019-01-22 01:45:53 +01:00
parent 45fa569222
commit b73c416470
3 changed files with 199 additions and 0 deletions

View File

@ -0,0 +1,103 @@
{ stdenv, fetchurl, perlPackages, makeWrapper, wrapGAppsHook,
librsvg, sane-backends, sane-frontends,
imagemagick, libtiff, djvulibre, poppler_utils, ghostscript, unpaper,
xvfb_run, hicolor-icon-theme, liberation_ttf, file, pdftk }:
with stdenv.lib;
perlPackages.buildPerlPackage rec {
name = "gscan2pdf-${version}";
version = "2.3.0";
src = fetchurl {
url = "mirror://sourceforge/gscan2pdf/${version}/${name}.tar.xz";
sha256 = "0mcsmly0j9pmyzh6py8r6sfa30hc6gv300hqq3dxj4hv653vhkk9";
};
nativeBuildInputs = [ wrapGAppsHook ];
buildInputs =
[ librsvg sane-backends sane-frontends ] ++
(with perlPackages; [
Gtk3
Gtk3SimpleList
Cairo
CairoGObject
Glib
GlibObjectIntrospection
GooCanvas2
LocaleGettext
PDFAPI2
ImageSane
SetIntSpan
PerlMagick
ConfigGeneral
ListMoreUtils
HTMLParser
ProcProcessTable
Log4Perl
TryTiny
DataUUID
DateCalc
IOString
FilesysDf
SubOverride
]);
postPatch = let
fontSubstitute = "${liberation_ttf}/share/fonts/truetype/LiberationSans-Regular.ttf";
in ''
# Required for the program to properly load its SVG assets
substituteInPlace bin/gscan2pdf \
--replace "/usr/share" "$out/share"
# Substitute the non-free Helvetica font in the tests
sed -i 's|-pointsize|-font ${fontSubstitute} -pointsize|g' t/*.t
'';
postInstall = ''
# Remove impurity
find $out -type f -name "*.pod" -delete
# Add runtime dependencies
wrapProgram "$out/bin/gscan2pdf" \
--prefix PATH : "${imagemagick}/bin" \
--prefix PATH : "${libtiff}/bin" \
--prefix PATH : "${djvulibre}/bin" \
--prefix PATH : "${poppler_utils}/bin" \
--prefix PATH : "${ghostscript}/bin" \
--prefix PATH : "${unpaper}/bin"
'';
enableParallelBuilding = true;
installTargets = [ "install" ];
outputs = [ "out" "man" ];
checkInputs = [
xvfb_run
hicolor-icon-theme
imagemagick
libtiff
djvulibre
poppler_utils
ghostscript
file
pdftk
unpaper
];
checkPhase = ''
xvfb-run -s '-screen 0 800x600x24' \
make test
'';
meta = {
description = "A GUI to produce PDFs or DjVus from scanned documents";
homepage = http://gscan2pdf.sourceforge.net/;
license = licenses.gpl3;
maintainers = [ maintainers.pacien ];
};
}

View File

@ -1446,6 +1446,8 @@ in
grobi = callPackage ../tools/X11/grobi { };
gscan2pdf = callPackage ../applications/graphics/gscan2pdf { };
gti = callPackage ../tools/misc/gti { };
hdate = callPackage ../applications/misc/hdate { };

View File

@ -1023,6 +1023,19 @@ let
propagatedBuildInputs = [ ExtUtilsDepends ExtUtilsPkgConfig ];
};
CairoGObject = buildPerlPackage rec {
name = "Cairo-GObject-1.004";
src = fetchurl {
url = "mirror://cpan/authors/id/X/XA/XAOC/${name}.tar.gz";
sha256 = "1m896j0xdfhldsx8abf10cc16ll1fm9wbav42dpzal9fh07d9f9v";
};
buildInputs = [ pkgs.cairo Cairo Glib ExtUtilsDepends ExtUtilsPkgConfig ];
meta = {
description = "Integrate Cairo into the Glib type system";
license = stdenv.lib.licenses.lgpl21Plus;
};
};
cam_pdf = buildPerlModule rec {
name = "CAM-PDF-1.60";
src = fetchurl {
@ -5897,6 +5910,18 @@ let
};
};
FilesysDf = buildPerlPackage rec {
name = "Filesys-Df-0.92";
src = fetchurl {
url = "mirror://cpan/authors/id/I/IG/IGUTHRIE/${name}.tar.gz";
sha256 = "fe89cbb427e0e05f1cd97c2dd6d3866ac6b21bc7a85734ede159bdc35479552a";
};
meta = {
description = "Perl extension for filesystem disk space information.";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
FilesysNotifySimple = buildPerlPackage {
name = "Filesys-Notify-Simple-0.13";
src = fetchurl {
@ -6302,6 +6327,20 @@ let
propagatedBuildInputs = [ ExtUtilsDepends ExtUtilsPkgConfig ];
};
GlibObjectIntrospection = buildPerlPackage rec {
name = "Glib-Object-Introspection-0.046";
src = fetchurl {
url = "mirror://cpan/authors/id/X/XA/XAOC/${name}.tar.gz";
sha256 = "1d3gl943p27gd42kxc1i9sp5z55gpgcslz1jvx7cxd6mflhdlck6";
};
buildInputs = [ Glib ExtUtilsDepends ExtUtilsPkgConfig ];
propagatedBuildInputs = [ pkgs.gobject-introspection ];
meta = {
description = "Dynamically create Perl language bindings";
license = stdenv.lib.licenses.lgpl2Plus;
};
};
Gnome2 = buildPerlPackage rec {
name = "Gnome2-1.047";
src = fetchurl {
@ -6407,6 +6446,20 @@ let
};
};
GooCanvas2 = buildPerlPackage rec {
name = "GooCanvas2-0.06";
src = fetchurl {
url = "mirror://cpan/authors/id/P/PE/PERLMAX/${name}.tar.gz";
sha256 = "0l1vsvyv9hjxhsxrahq4h64axh7qmk50kiz2spa3s1hr7s3qfk72";
};
buildInputs = [ pkgs.gtk3 GlibObjectIntrospection Glib ];
propagatedBuildInputs = [ pkgs.goocanvas2 ];
meta = {
description = "Perl binding for GooCanvas2 widget using Glib::Object::Introspection";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
GoogleProtocolBuffers = buildPerlPackage rec {
name = "Google-ProtocolBuffers-0.12";
src = fetchurl {
@ -6575,6 +6628,33 @@ let
};
};
Gtk3 = buildPerlPackage rec {
name = "Gtk3-0.034";
src = fetchurl {
url = "mirror://cpan/authors/id/X/XA/XAOC/${name}.tar.gz";
sha256 = "0baxyhlzdf7avka40h1niiir8vz4nilqkiwh876i0hv0f8xj3nqa";
};
buildInputs = [ Cairo CairoGObject Glib GlibObjectIntrospection ];
propagatedBuildInputs = [ pkgs.gtk3 ];
meta = {
description = "Perl interface to the 3.x series of the gtk+ toolkit";
license = stdenv.lib.licenses.lgpl21Plus;
};
};
Gtk3SimpleList = buildPerlPackage rec {
name = "Gtk3-SimpleList-0.18";
src = fetchurl {
url = "mirror://cpan/authors/id/T/TV/TVIGNAUD/${name}.tar.gz";
sha256 = "09azmc7miyvw7q21rz8cxw16zbd5i1j5hpakxy376f5vmhqqjyhp";
};
buildInputs = [ Gtk3 Glib GlibObjectIntrospection Cairo CairoGObject ];
meta = {
description = "A simple interface to Gtk3's complex MVC list widget";
license = stdenv.lib.licenses.lgpl21Plus;
};
};
Guard = buildPerlPackage rec {
name = "Guard-1.023";
src = fetchurl {
@ -7319,6 +7399,20 @@ let
};
};
ImageSane = buildPerlPackage rec {
name = "Image-Sane-0.14";
src = fetchurl {
url = "mirror://cpan/authors/id/R/RA/RATCLIFFE/${name}.tar.gz";
sha256 = "a4b027c9b7650291f1acb0eb93861a7fc45aef4e08f6726843f174fa113c8ba5";
};
buildInputs = [ pkgs.sane-backends ExtUtilsDepends ExtUtilsPkgConfig TestRequires TryTiny ];
propagatedBuildInputs = [ ExceptionClass Readonly ];
meta = {
description = "Perl extension for the SANE (Scanner Access Now Easy) Project";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
ImageScale = buildPerlPackage rec {
name = "Image-Scale-0.14";
src = fetchurl {