diff options
author | pacien <pacien.trangirard@pacien.net> | 2019-01-22 01:45:53 +0100 |
---|---|---|
committer | pacien <pacien.trangirard@pacien.net> | 2019-02-06 22:57:48 +0100 |
commit | b73c416470438d75d30f3ab697531dce8d7848cb (patch) | |
tree | 28df0c545ec7b99deb531216d634b6bda756b76a | |
parent | 45fa569222a4a7800373c08742e2398ae7a86194 (diff) | |
download | nixpkgs-b73c416470438d75d30f3ab697531dce8d7848cb.tar nixpkgs-b73c416470438d75d30f3ab697531dce8d7848cb.tar.gz nixpkgs-b73c416470438d75d30f3ab697531dce8d7848cb.tar.bz2 nixpkgs-b73c416470438d75d30f3ab697531dce8d7848cb.tar.lz nixpkgs-b73c416470438d75d30f3ab697531dce8d7848cb.tar.xz nixpkgs-b73c416470438d75d30f3ab697531dce8d7848cb.tar.zst nixpkgs-b73c416470438d75d30f3ab697531dce8d7848cb.zip |
gscan2pdf: init at 2.3.0
based on github issue #34744 closes #34744
-rw-r--r-- | pkgs/applications/graphics/gscan2pdf/default.nix | 103 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 2 | ||||
-rw-r--r-- | pkgs/top-level/perl-packages.nix | 94 |
3 files changed, 199 insertions, 0 deletions
diff --git a/pkgs/applications/graphics/gscan2pdf/default.nix b/pkgs/applications/graphics/gscan2pdf/default.nix new file mode 100644 index 00000000000..9ec82ea2a94 --- /dev/null +++ b/pkgs/applications/graphics/gscan2pdf/default.nix @@ -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 ]; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fafe7e9e09..e5582f28862 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 24ff673b8fa..bb482e53ae4 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -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 { |