gscan2pdf: fix dependencies (switched to gtk3 with 2.0) plus patch to detect tesseract-ocr

Closes: #12718 [via git-merge-pr]
This commit is contained in:
newbluemoon 2018-03-20 10:44:08 +01:00 committed by lemmi
parent 81fcf978df
commit c3bd99703b
2 changed files with 67 additions and 4 deletions

View File

@ -0,0 +1,63 @@
--- lib/Gscan2pdf/Tesseract.pm.orig
+++ lib/Gscan2pdf/Tesseract.pm
@@ -23,14 +23,14 @@
return $installed if $setup;
( undef, my $exe ) =
- Gscan2pdf::Document::exec_command( [ 'which', 'tesseract' ] );
+ Gscan2pdf::Document::exec_command( [ 'which', 'tesseract-ocr' ] );
return if ( not defined $exe or $exe eq $EMPTY );
$installed = 1;
# if we have 3.02.01 or better,
# we can use --list-langs and not bother with tessdata
( undef, my $out, my $err ) =
- Gscan2pdf::Document::exec_command( [ 'tesseract', '-v' ] );
+ Gscan2pdf::Document::exec_command( [ 'tesseract-ocr', '-v' ] );
if ( $err =~ /^tesseract[ ]([\d.]+)/xsm ) {
$version = $1;
}
@@ -44,7 +44,7 @@
}
( $out, $err ) =
- Gscan2pdf::Document::exec_command( ["tesseract '' '' -l ''"] );
+ Gscan2pdf::Document::exec_command( ["tesseract-ocr '' '' -l ''"] );
( $tessdata, $version, $datasuffix ) = parse_tessdata( $out . $err );
if ( not defined $tessdata ) {
@@ -162,7 +162,7 @@
if ( version->parse("v$version") > version->parse('v3.02') ) {
my ( undef, $out, $err ) =
Gscan2pdf::Document::exec_command(
- [ 'tesseract', '--list-langs' ] );
+ [ 'tesseract-ocr', '--list-langs' ] );
@codes = split /\n/xsm, $err ? $err : $out;
if ( $codes[0] =~ /^List[ ]of[ ]available[ ]languages/xsm ) {
shift @codes;
@@ -246,21 +246,21 @@
}
if ( version->parse("v$version") >= version->parse('v3.02.02') ) {
$cmd = [
- 'tesseract', $tif, $path . $name, '-l',
+ 'tesseract-ocr', $tif, $path . $name, '-l',
$options{language}, '-c', 'tessedit_create_hocr=1'
];
}
elsif ( version->parse("v$version") >= version->parse('v3') ) {
$cmd =
[
-"echo tessedit_create_hocr 1 > hocr.config;tesseract $tif $path$name -l $options{language} +hocr.config;rm hocr.config"
+"echo tessedit_create_hocr 1 > hocr.config;tesseract-ocr $tif $path$name -l $options{language} +hocr.config;rm hocr.config"
];
}
elsif ( $options{language} ) {
- $cmd = [ 'tesseract', $tif, $path . $name, '-l', $options{language} ];
+ $cmd = [ 'tesseract-ocr', $tif, $path . $name, '-l', $options{language} ];
}
else {
- $cmd = [ 'tesseract', $tif, $path . $name ];
+ $cmd = [ 'tesseract-ocr', $tif, $path . $name ];
}
my ( undef, $out, $err ) =

View File

@ -1,14 +1,14 @@
# Template file for 'gscan2pdf'
pkgname=gscan2pdf
version=2.0.1
revision=1
revision=2
build_style=perl-module
maintainer="Orphaned <orphan@voidlinux.eu>"
hostmakedepends="perl"
makedepends="perl ImageMagick perl-Try-Tiny libmagick-perl perl-Gtk2 perl-Readonly
makedepends="perl ImageMagick perl-Try-Tiny libmagick-perl perl-Gtk3 perl-Readonly
perl-Config-General perl-List-MoreUtils perl-PDF-API2 perl-Linux-Distribution
perl-Image-Sane perl-Goo-Canvas perl-HTML-Parser perl-Proc-ProcessTable
perl-Set-IntSpan perl-Gtk2-Ex-Simple-List perl-Exporter-Tiny perl-Gtk2-ImageView
perl-Image-Sane perl-GooCanvas2 perl-HTML-Parser perl-Proc-ProcessTable
perl-Set-IntSpan perl-Gtk3-SimpleList perl-Exporter-Tiny perl-Pango
perl-Log-Log4perl perl-Filesys-Df djvulibre unpaper perl-Font-TTF perl-IO-String
perl-Data-UUID xdg-utils perl-Locale-gettext perl-Date-Calc perl-Image-Sane"
depends="${makedepends}"