summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8e2670ff7df56875ab8fbcbcc1ff9149b4252a05 (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
# Maintainer: lilydjwg <lilydjwg@gmail.com>

_pkgname=cld2
pkgname=${_pkgname}-git
pkgver=20150820
pkgrel=3
pkgdesc='Compact Language Detector 2'
arch=('x86_64')
url='https://github.com/CLD2Owners/cld2'
license=('Apache')
provides=('cld2' 'cld2-hg' 'cld2-svn')
replaces=('cld2-hg' 'cld2-svn')
conflicts=('cld2-hg' 'cld2' 'cld2-svn')
makedepends=('git')
source=('git+https://github.com/CLD2Owners/cld2.git')
md5sums=('SKIP')

pkgver() {
  cd "$srcdir/$_pkgname"
  git log -1 --pretty='%cd' --date=short | tr -d '-'
}

build() {
  cd "$srcdir/$_pkgname"
  cd internal
  # use C++98, or it won't compile; see
  # https://github.com/CLD2Owners/cld2/pull/52
  CXXFLAGS="-std=c++98 $CXXFLAGS" sh ./compile_libs.sh
}

package() {
  cd "$srcdir/$_pkgname"
  install -Dm755 internal/libcld2.so "${pkgdir}/usr/lib/libcld2.so"
  install -Dm755 internal/libcld2_full.so "${pkgdir}/usr/lib/libcld2_full.so"

  for header in internal/*.h public/*.h; do
    install -Dm644 "$header" "${pkgdir}/usr/include/cld2/$header"
  done

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}