[arch-commits] Commit in gimagereader/repos (5 files)

Antonio Rojas arojas at archlinux.org
Mon Oct 5 18:49:06 UTC 2020


    Date: Monday, October 5, 2020 @ 18:49:06
  Author: arojas
Revision: 718910

archrelease: copy trunk to community-staging-x86_64

Added:
  gimagereader/repos/community-staging-x86_64/
  gimagereader/repos/community-staging-x86_64/PKGBUILD
    (from rev 718909, gimagereader/trunk/PKGBUILD)
  gimagereader/repos/community-staging-x86_64/gimagereader-automoc.patch
    (from rev 718909, gimagereader/trunk/gimagereader-automoc.patch)
  gimagereader/repos/community-staging-x86_64/gimagereader-quazip1.patch
    (from rev 718909, gimagereader/trunk/gimagereader-quazip1.patch)
  gimagereader/repos/community-staging-x86_64/openmp.patch
    (from rev 718909, gimagereader/trunk/openmp.patch)

----------------------------+
 PKGBUILD                   |   84 +++++++++++++++++++++++++++++++++++++++++++
 gimagereader-automoc.patch |   12 ++++++
 gimagereader-quazip1.patch |   15 +++++++
 openmp.patch               |   26 +++++++++++++
 4 files changed, 137 insertions(+)

Copied: gimagereader/repos/community-staging-x86_64/PKGBUILD (from rev 718909, gimagereader/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2020-10-05 18:49:06 UTC (rev 718910)
@@ -0,0 +1,84 @@
+# Maintainer: Balló György <ballogyor+arch at gmail dot com>
+
+pkgbase=gimagereader
+pkgname=(gimagereader-gtk gimagereader-qt gimagereader-common)
+pkgver=3.3.1
+pkgrel=2
+url="https://github.com/manisandro/gImageReader"
+pkgdesc="Gtk/Qt front-end to tesseract-ocr"
+arch=(x86_64)
+license=(GPL3)
+depends=(desktop-file-utils djvulibre gtksourceviewmm gtkspellmm libxml++ libzip podofo
+         poppler-glib poppler-qt5 qt5-imageformats qtspell quazip sane tesseract)
+makedepends=(cmake intltool python-gobject)
+source=(https://github.com/manisandro/gImageReader/releases/download/v$pkgver/$pkgbase-$pkgver.tar.xz
+        openmp.patch
+        gimagereader-quazip1.patch
+        gimagereader-qt5.14.patch::"https://github.com/manisandro/gImageReader/commit/6209e25d.patch"
+        gimagereader-automoc.patch)
+sha256sums=('7688c9c20cbf2fa4f5b6ba0a8d77bd8d2e5929882ed965c7c07ccc529673f0dd'
+            'ee84de7fee390ee54152b4e332e50d8f585b0c9a3aa8b40a04f865b5250607c2'
+            'c693f97984667bff435af2ba1028b44e9dffaac957d0e39bc454c097bfc3ed21'
+            '5e213cde5d5078c18031dfd0922c5399e387303cfca12b421e220c1dad07a506'
+            '37668af2c039d756b1661078610aed07120d88441cc38851a2563dc2f8fac4a5')
+
+prepare() {
+  [[ -d build-gtk ]] || mkdir build-gtk
+  [[ -d build-qt ]] || mkdir build-qt
+  [[ -d gimagereader-common ]] || mkdir gimagereader-common
+
+  cd $pkgbase-$pkgver
+
+  # Run OpenMP once before calling tesseract
+  # https://github.com/manisandro/gImageReader/issues/285
+  patch -Np1 -i ../openmp.patch
+
+  patch -p1 -i ../gimagereader-quazip1.patch # Fix build with quazip 1.0
+  patch -p1 -i ../gimagereader-qt5.14.patch # Fix build with Qt 5.14
+  patch -p1 -i ../gimagereader-automoc.patch # Fix linking errors (Fedora)
+}
+
+build() {
+  cd build-gtk
+  cmake -G "Unix Makefiles" ../$pkgbase-$pkgver/ \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DINTERFACE_TYPE=gtk
+  make
+
+  cd ../build-qt
+  cmake -G "Unix Makefiles" ../$pkgbase-$pkgver/ \
+    -DCMAKE_INSTALL_PREFIX=/usr \
+    -DINTERFACE_TYPE=qt5
+  make
+}
+
+package_gimagereader-gtk() {
+  pkgdesc="Gtk front-end to tesseract-ocr"
+  depends=(gimagereader-common djvulibre gtksourceviewmm gtkspellmm libxml++ libzip podofo poppler-glib sane tesseract)
+
+  cd build-gtk
+  make DESTDIR="$pkgdir" install
+
+  # Split gimagereader-common
+  mv "$pkgdir"/usr/share/{doc,icons,locale} \
+     "$srcdir/gimagereader-common/"
+}
+
+package_gimagereader-qt() {
+  pkgdesc="Qt front-end to tesseract-ocr"
+  depends=(gimagereader-common desktop-file-utils djvulibre podofo poppler-qt5 qt5-imageformats qtspell quazip sane tesseract)
+
+  cd build-qt
+  make DESTDIR="$pkgdir" install
+
+  # Split gimagereader-common
+  rm -r "$pkgdir"/usr/share/{doc,icons,locale}
+}
+
+package_gimagereader-common() {
+  pkgdesc="Common files for gImageReader"
+  depends=(hicolor-icon-theme)
+
+  mkdir -p "$pkgdir"/usr/share
+  mv gimagereader-common/* "$pkgdir/usr/share"
+}

Copied: gimagereader/repos/community-staging-x86_64/gimagereader-automoc.patch (from rev 718909, gimagereader/trunk/gimagereader-automoc.patch)
===================================================================
--- community-staging-x86_64/gimagereader-automoc.patch	                        (rev 0)
+++ community-staging-x86_64/gimagereader-automoc.patch	2020-10-05 18:49:06 UTC (rev 718910)
@@ -0,0 +1,12 @@
+diff -rupN gimagereader-3.3.1/CMakeLists.txt gimagereader-3.3.1-new/CMakeLists.txt
+--- gimagereader-3.3.1/CMakeLists.txt	2019-07-28 22:59:40.000000000 +0200
++++ gimagereader-3.3.1-new/CMakeLists.txt	2020-07-29 10:33:51.491682621 +0200
+@@ -1,4 +1,8 @@
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
++IF(${CMAKE_VERSION} VERSION_GREATER "3.17.0")
++CMAKE_POLICY(SET CMP0100 NEW)
++ENDIF()
++
+ LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+ INCLUDE(GSettings)
+ SET(ENV{LC_ALL} "C")

Copied: gimagereader/repos/community-staging-x86_64/gimagereader-quazip1.patch (from rev 718909, gimagereader/trunk/gimagereader-quazip1.patch)
===================================================================
--- community-staging-x86_64/gimagereader-quazip1.patch	                        (rev 0)
+++ community-staging-x86_64/gimagereader-quazip1.patch	2020-10-05 18:49:06 UTC (rev 718910)
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 397e5dc..93a7693 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -178,8 +178,8 @@ ELSEIF("${INTERFACE_TYPE}" STREQUAL "qt5")
+     FIND_PACKAGE(Qt5PrintSupport REQUIRED)
+     FIND_PACKAGE(QuaZip5)
+     IF(NOT QUAZIP_FOUND)
+-        FIND_PATH(QUAZIP_INCLUDE_DIR NAME quazipfile.h PATH_SUFFIXES quazip5)
+-        FIND_LIBRARY(QUAZIP_LIBRARIES quazip5)
++        FIND_PATH(QUAZIP_INCLUDE_DIR NAME quazipfile.h PATH_SUFFIXES quazip5 QuaZip-Qt5-1.0/quazip)
++        FIND_LIBRARY(QUAZIP_LIBRARIES NAMES quazip5 quazip1-qt5)
+         IF(NOT QUAZIP_INCLUDE_DIR OR NOT QUAZIP_LIBRARIES)
+             MESSAGE(FATAL_ERROR "QuaZip5 is required but was not found")
+         ENDIF()

Copied: gimagereader/repos/community-staging-x86_64/openmp.patch (from rev 718909, gimagereader/trunk/openmp.patch)
===================================================================
--- community-staging-x86_64/openmp.patch	                        (rev 0)
+++ community-staging-x86_64/openmp.patch	2020-10-05 18:49:06 UTC (rev 718910)
@@ -0,0 +1,26 @@
+From 122ed08d72265e3abb02c48c4be804d793058fc9 Mon Sep 17 00:00:00 2001
+From: Philip Rinn <rinni at inventati.org>
+Date: Fri, 5 Jan 2018 15:22:47 +0100
+Subject: [PATCH] Run OpenMP once before calling tesseract (fixes: #285)
+
+---
+ gtk/src/main.cc | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gtk/src/main.cc b/gtk/src/main.cc
+index a2668e4..9fec77a 100644
+--- a/gtk/src/main.cc
++++ b/gtk/src/main.cc
+@@ -94,6 +94,12 @@ int main (int argc, char *argv[]) {
+ 	}
+ #endif
+ 
++    // Run OpenMP once before tesseract is called, otherwise it might be
++    // _very_ slow, see https://github.com/manisandro/gImageReader/issues/285
++    // Sleep 1 millisecond to prevent being optimized out.
++    #pragma omp parallel for schedule(static)
++    for(int i = 0; i < 1; i++) { sleep(1); }
++
+ 	std::string localeDir = Glib::build_filename(pkgDir, "share", "locale");
+ 
+ 	bindtextdomain(GETTEXT_PACKAGE, localeDir.c_str());



More information about the arch-commits mailing list