PKGBUILDs/extra/marisa/PKGBUILD

127 lines
3.8 KiB
Bash
Raw Normal View History

2018-06-07 12:44:19 +00:00
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove --enable-sse2 from configure
pkgbase=marisa
2020-01-02 21:30:45 +00:00
pkgname=('marisa' 'perl-marisa' 'python-marisa' 'ruby-marisa')
2020-06-21 20:11:38 +00:00
pkgver=0.2.6
2024-09-04 20:57:36 +00:00
pkgrel=14
2018-06-07 12:44:19 +00:00
arch=('x86_64')
url="https://github.com/s-yata/marisa-trie"
license=('BSD' 'LGPL')
2024-04-27 15:38:22 +00:00
makedepends=('python' 'ruby' 'perl' 'swig' 'python-setuptools')
2022-05-31 23:47:52 +00:00
source=("marisa-trie-$pkgver.tar.gz::https://github.com/s-yata/marisa-trie/archive/v$pkgver.tar.gz"
fix-format-security.patch)
sha512sums=('c094e4b22e1457efdd20f2b978ee421b53e36ed94e4fdbd8944136c0ba23da4f6ba9fe3a2c64729c1426aee4dbe8098bfa5eebb943ae7fdaa4eec760485c564d'
'3583f23c55ccd46cefbd757ef3f82dc7a90f14c64ecf69a99ab3467ca1e6aeddf9822be4c4dffcdbb8841d79fe116cfb8eff0e9b44abaadbcbf8d50a10ab1ec9')
2018-06-07 12:44:19 +00:00
prepare() {
cd marisa-trie-$pkgver
autoreconf -i
2022-05-31 23:47:52 +00:00
# https://github.com/s-yata/marisa-trie/pull/45
patch -Np1 -i ../fix-format-security.patch
2018-06-07 12:44:19 +00:00
}
build() {
cd marisa-trie-$pkgver
# sse2 is part of amd64
./configure --prefix=/usr --disable-static
# --enable-popcnt
# --enable-sse3
# --enable-ssse3
# --enable-sse4.1
# --enable-sse4.2
# --enable-sse4
# --enable-sse4a
make
2020-01-02 21:30:45 +00:00
# Regenerate swig bindings
2020-01-07 19:00:45 +00:00
# remove ruby because it's broken for now
make -C bindings -j1 swig-perl swig-python
2020-01-02 21:30:45 +00:00
2018-06-07 12:44:19 +00:00
# Perl bindings
cd "$srcdir"/marisa-trie-$pkgver/bindings/perl
perl Makefile.PL \
INC=-I"$srcdir"/marisa-trie-$pkgver/include \
2021-03-19 17:04:01 +00:00
LIBS=-L"$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs \
INSTALLDIRS=vendor
2018-06-07 12:44:19 +00:00
make
# Python bindings
cd "$srcdir"/marisa-trie-$pkgver/bindings/python
2020-01-02 21:30:45 +00:00
python setup.py build_ext \
2018-06-07 12:44:19 +00:00
--include-dirs="$srcdir"/marisa-trie-$pkgver/include \
--library-dirs="$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs
2020-01-02 21:30:45 +00:00
python setup.py build
2018-06-07 12:44:19 +00:00
# Ruby bindings
cd "$srcdir"/marisa-trie-$pkgver/bindings/ruby
ruby extconf.rb \
--with-opt-include="$srcdir"/marisa-trie-$pkgver/include \
--with-opt-lib="$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs \
--vendor
make
}
package_marisa() {
pkgdesc="Static and space-efficient trie data structure library"
depends=('gcc-libs')
cd marisa-trie-$pkgver
make DESTDIR="$pkgdir" install
install -d "$pkgdir"/usr/share/doc/$pkgbase-$pkgver
install -m 644 docs/* "$pkgdir"/usr/share/doc/$pkgbase-$pkgver/
install -d "$pkgdir"/usr/share/licenses/$pkgname
install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/
}
package_perl-marisa() {
pkgdesc="Perl language binding for marisa"
depends=('perl' 'marisa')
cd marisa-trie-$pkgver/bindings/perl
make DESTDIR="$pkgdir" install
cd ../..
install -d "$pkgdir"/usr/share/licenses/$pkgname
install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/
}
2020-01-02 21:30:45 +00:00
package_python-marisa() {
pkgdesc="Python language binding for marisa"
depends=('python' 'marisa')
2018-06-07 12:44:19 +00:00
cd marisa-trie-$pkgver/bindings/python
2020-01-02 21:30:45 +00:00
python setup.py install -O1 --root="$pkgdir"
2018-06-07 12:44:19 +00:00
cd ../..
install -d "$pkgdir"/usr/share/licenses/$pkgname
install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/
}
package_ruby-marisa() {
pkgdesc="Ruby language binding for marisa"
depends=('ruby' 'marisa')
# ruby version without the patch number, e.g. 2.4
local _rubyver=$(ruby -e"puts Gem.ruby_version.to_s.split('.')[0..1].join('.')")
cd marisa-trie-$pkgver/bindings/ruby
_hdrdir=$(pkg-config --variable=rubyhdrdir ruby-$_rubyver)
_arch=$(pkg-config --variable=arch ruby-$_rubyver)
make DESTDIR="$pkgdir" install \
hdrdir="$_hdrdir" \
arch_hdrdir="${_hdrdir}/${_arch}" \
rubyhdrdir="$_hdrdir"
cd ../..
install -d "$pkgdir"/usr/share/licenses/$pkgname
install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/
}