summaryrefslogtreecommitdiff
path: root/libre/cuneiform/PKGBUILD
blob: f62c99b217a6ba4a47b6ce415e61b55f1abef9ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# $Id: PKGBUILD 200098 2016-12-18 10:27:54Z arojas $
# Maintainer (Arch): Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor (Arch): Maxim Vuets <maxim.vuets@gmail.com>
# Maintainer (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname=cuneiform
pkgver=1.1.0
_dpkgver=1.1
pkgrel=18.parabola1
pkgdesc="GNU/Linux port of an OCR system developed in Russia. Supports more than 20 languages, without nonfree data files"
arch=('i686' 'x86_64')
url="https://launchpad.net/cuneiform-linux"
license=('BSD')
depends=('libmagick6')
makedepends=('cmake')
mksource=(http://launchpad.net/cuneiform-linux/${_dpkgver}/${_dpkgver}/+download/cuneiform-linux-${pkgver}.tar.bz2)
source=("https://repo.parabola.nu/other/${pkgname}-libre/${pkgname}-libre-${pkgver}.tar.bz2"
        'build-fix.patch'
        'libre.patch')
mksha256sums=('577e0d054de72086c33b4e8ae15033657776509b9a7af6eb272888eefcbdbbad')
sha256sums=('714b740d79c4799ec1bd340e3721d17f6d0e09ae54cd5667a01eddc8c4b758b4'
            '3d9f4d923ec6ca5555550819096b7d66e364a8aeb74a9d1f0d961784d267642b'
            '9db29dcd11faf92ed68d4af35c659b6f5e96b0864c15342be8e014817af8be2d')

mksource() {
  mv "${srcdir}/${pkgname}-linux-${pkgver}" "${srcdir}/${pkgname}-${pkgver}"
  cd "${srcdir}/${pkgname}-${pkgver}"
  rm -rv datafiles
}

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  sed -i 's#lib64#lib#' install_files.cmake
  patch -p1 -i "$srcdir"/build-fix.patch
  patch -p1 -i ../libre.patch
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  mkdir -p builddir
  cd builddir

  LMAGICK=`ls -1 /usr/lib/libMagick++*.so.?`

  cmake \
	-DCMAKE_BUILD_TYPE=release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DImageMagick_Magick++_LIBRARY=$LMAGICK \
	-DImageMagick_Magick++_INCLUDE_DIR=/usr/include/ImageMagick-6 \
	..
  make
}

check() {
  ldd "${srcdir}/${pkgname}-${pkgver}/builddir/cuneiform" | grep Magick >/dev/null
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"/builddir
  make DESTDIR="${pkgdir}" install

  install -Dm644 "${srcdir}/${pkgname}-${pkgver}/cuneiform_src/Kern/license.txt" \
    "${pkgdir}/usr/share/licenses/cuneiform/license.txt"
}