summaryrefslogtreecommitdiff
path: root/libre/cuneiform/PKGBUILD
blob: c40bf92977d437141cad28a0c856c2fda903d07f (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
# $Id: PKGBUILD 148996 2015-12-06 17:43:52Z bpiotrowski $
# Maintainer (Arch): Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor (Arch): Maxim Vuets <maxim.vuets@gmail.com>
# Maintainer: André Silva <emulatorman@parabola.nu>

pkgname=cuneiform
pkgver=1.1.0
_dpkgver=1.1
pkgrel=14.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=('imagemagick')
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"
        'libre.patch')
mkmd5sums=('09fd160cdfc512f26442a7e91246598d')
md5sums=('88416aca3998ea61cc800874bab945bd'
         '6d1ad29ec454de83622b6b044f6cfb67')

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

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  patch -p1 -i ../libre.patch
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  sed -i 's#lib64#lib#' install_files.cmake
  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"
}