gscan2pdf: update to 2.8.1.
This commit is contained in:
parent
a810907ac7
commit
6d91851983
2 changed files with 30 additions and 61 deletions
|
@ -1,6 +1,6 @@
|
|||
--- lib/Gscan2pdf/Tesseract.pm.orig 2020-07-12 13:36:35.561949445 +0200
|
||||
+++ lib/Gscan2pdf/Tesseract.pm 2020-07-12 13:36:42.433470852 +0200
|
||||
@@ -23,28 +23,28 @@
|
||||
--- lib/Gscan2pdf/Tesseract.pm.orig 2020-07-12 21:27:40.576078589 +0200
|
||||
+++ lib/Gscan2pdf/Tesseract.pm 2020-07-12 21:27:58.302854959 +0200
|
||||
@@ -22,25 +22,25 @@
|
||||
return $installed if $setup;
|
||||
|
||||
( undef, my $exe ) =
|
||||
|
@ -9,7 +9,7 @@
|
|||
return if ( not defined $exe or $exe eq $EMPTY );
|
||||
$installed = 1;
|
||||
|
||||
# if we have 3.02.01 or better,
|
||||
# Only support 3.02.01 or better, so that
|
||||
# we can use --list-langs and not bother with tessdata
|
||||
( undef, my $out, my $err ) =
|
||||
- Gscan2pdf::Document::exec_command( [ 'tesseract', '-v' ] );
|
||||
|
@ -22,47 +22,24 @@
|
|||
+ elsif ( $out =~ /^tesseract-ocr[ ]([\d.]+)/xsm ) {
|
||||
$version = $1;
|
||||
}
|
||||
if ( $version and version->parse("v$version") > version->parse('v3.02') ) {
|
||||
if ( not $version ) { return }
|
||||
if ( $version !~ /^\d+[.]\d+$/xsm ) { $version = 'v' . $version }
|
||||
$version = version->parse($version);
|
||||
if ( $version > version->parse('v3.02.00') ) {
|
||||
- $logger->info("Found tesseract version $version.");
|
||||
+ $logger->info("Found tesseract-ocr version $version.");
|
||||
$setup = 1;
|
||||
return $installed;
|
||||
}
|
||||
@@ -101,14 +101,14 @@
|
||||
|
||||
( $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 ) {
|
||||
@@ -53,7 +53,7 @@
|
||||
{
|
||||
( undef, my $lib ) =
|
||||
Gscan2pdf::Document::exec_command( [ 'ldd', $exe ] );
|
||||
- if ( $lib =~ /libtesseract[.]so[.]\d+[ ]=>[ ]([\/\w\-.]+)[ ]/xsm ) {
|
||||
+ if ( $lib =~ /libtesseract-ocr[.]so[.]\d+[ ]=>[ ]([\/\w\-.]+)[ ]/xsm ) {
|
||||
( undef, $out ) =
|
||||
Gscan2pdf::Document::exec_command( [ 'strings', $1 ] );
|
||||
$tessdata = parse_strings($out);
|
||||
@@ -68,7 +68,7 @@
|
||||
}
|
||||
|
||||
$logger->info(
|
||||
- "Found tesseract version $version. Using tessdata at $tessdata");
|
||||
+ "Found tesseract-ocr version $version. Using tessdata at $tessdata");
|
||||
$setup = 1;
|
||||
return $installed;
|
||||
}
|
||||
@@ -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;
|
||||
@@ -181,7 +181,7 @@
|
||||
my @codes;
|
||||
my ( undef, $out, $err ) =
|
||||
- Gscan2pdf::Document::exec_command( [ 'tesseract', '--list-langs' ] );
|
||||
+ Gscan2pdf::Document::exec_command( [ 'tesseract-ocr', '--list-langs' ] );
|
||||
@codes = split /\n/xsm, $err ? $err : $out;
|
||||
if ( $codes[0] =~ /^List[ ]of[ ]available[ ]languages/xsm ) {
|
||||
shift @codes;
|
||||
}
|
||||
|
||||
for (@codes) {
|
||||
|
@ -71,29 +48,21 @@
|
|||
if ( defined $iso639{$_} ) {
|
||||
$languages{$_} = $iso639{$_};
|
||||
}
|
||||
@@ -246,21 +246,21 @@
|
||||
@@ -163,7 +163,7 @@
|
||||
}
|
||||
if ( version->parse("v$version") >= version->parse('v3.02.02') ) {
|
||||
if ( $version > version->parse('v3.05.00') ) {
|
||||
$cmd = [
|
||||
- 'tesseract', $tif,
|
||||
+ 'tesseract-ocr', $tif,
|
||||
$path . $name, '--dpi', $options{dpi}, '-l',
|
||||
$options{language}, '-c',
|
||||
'tessedit_create_hocr=1',
|
||||
@@ -172,7 +172,7 @@
|
||||
}
|
||||
else {
|
||||
$cmd = [
|
||||
- 'tesseract', $tif, $path . $name, '-l',
|
||||
+ 'tesseract-ocr', $tif, $path . $name, '-l',
|
||||
$options{language}, '-c', 'tessedit_create_hocr=1'
|
||||
$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 ) =
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Template file for 'gscan2pdf'.
|
||||
pkgname=gscan2pdf
|
||||
version=2.8.0
|
||||
version=2.8.1
|
||||
revision=1
|
||||
archs=noarch
|
||||
build_style=perl-module
|
||||
|
@ -17,7 +17,7 @@ maintainer="Helmut Pozimski <helmut@pozimski.eu>"
|
|||
license="GPL-3.0-or-later"
|
||||
homepage="http://gscan2pdf.sourceforge.net"
|
||||
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
|
||||
checksum=9c9a3edf4dcd07ecf355f4bfe91047974fb021e57dc2162e1d34de3b61201d67
|
||||
checksum=4149696eb9ed1f11294d2ff02d709e70b84af268a8a332b025cb8f4f0fdfe201
|
||||
nocross=yes
|
||||
|
||||
do_check() {
|
||||
|
|
Loading…
Reference in a new issue