diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 70 |
1 files changed, 46 insertions, 24 deletions
@@ -1,42 +1,64 @@ -# Maintainer: lilydjwg <lilydjwg@gmail.com> +# Maintainer: Beini <bane at iki dot fi> +# Contributor: lilydjwg <lilydjwg@gmail.com> _pkgname=cld2 pkgname=${_pkgname}-git -pkgver=20150820 -pkgrel=3 -pkgdesc='Compact Language Detector 2' +pkgver=r152.b56fa78 +pkgrel=1 +epoch=1 +pkgdesc='Probabilistically detects over 80 languages in Unicode UTF-8 text, either plain text or HTML/XML' arch=('x86_64') url='https://github.com/CLD2Owners/cld2' license=('Apache') -provides=('cld2' 'cld2-hg' 'cld2-svn') +provides=('cld2') +conflicts=('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') +depends=('glibc' 'gcc-libs') +makedepends=('git' 'cmake') +source=('git+https://github.com/CLD2Owners/cld2.git' + 'CMakeLists.txt') +b2sums=('SKIP' + '1e5d8282a8a88735cb2114766efbee1747fe3817fcfae48c74366f3094c348c9850fa89bc6f94e4a009b01de8b3256a974d652694206e2e6d691dcef6334a0ee') + +prepare() { + cp "$srcdir/CMakeLists.txt" "$srcdir/$_pkgname/" +} pkgver() { cd "$srcdir/$_pkgname" - git log -1 --pretty='%cd' --date=short | tr -d '-' + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" } 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 + # -std=c++98 is needed for gcc-6 + # https://github.com/CLD2Owners/cld2/issues/47 + CXXFLAGS="$CXXFLAGS -std=c++98 -Wl,--as-needed" cmake \ + -B build \ + -S "$_pkgname" \ + -DCMAKE_BUILD_TYPE:STRING='None' \ + -DCMAKE_INSTALL_PREFIX:PATH='/usr' \ + -DCMAKE_INSTALL_LIBDIR:PATH='lib' + cmake --build build } -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" +check() { + cd build + # Tests from: internal/compile_and_test_all.sh + echo "this is some english text" | ./compact_lang_det_test_chrome_2 + echo "this is some english text" | ./compact_lang_det_test_chrome_16 + ./cld2_unittest_chrome_2 > /dev/null + ./cld2_unittest_avoid_chrome_2 > /dev/null + echo "this is some english text" | ./compact_lang_det_test_full + ./cld2_unittest_full > /dev/null + ./cld2_unittest_full_avoid > /dev/null + ./cld2_dynamic_data_tool --dump cld2_data.bin + ./cld2_dynamic_data_tool --verify cld2_data.bin + echo "this is some english text" | ./compact_lang_det_dynamic_test_chrome --data-file cld2_data.bin + ./cld2_dynamic_unittest --data-file cld2_data.bin > /dev/null +} - for header in internal/*.h public/*.h; do - install -Dm644 "$header" "${pkgdir}/usr/include/cld2/$header" - done +package() { + DESTDIR="$pkgdir" cmake --install build - install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 "$srcdir/$_pkgname/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } - |