1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com>
5 pkgname=('marisa' 'perl-marisa' 'python-marisa' 'ruby-marisa')
9 url="https://github.com/s-yata/marisa-trie"
10 license=('BSD' 'LGPL')
11 makedepends=('python' 'ruby' 'perl' 'swig')
12 source=("marisa-trie-$pkgver.tar.gz::https://github.com/s-yata/marisa-trie/archive/v$pkgver.tar.gz"
13 fix-format-security.patch)
14 sha512sums=('c094e4b22e1457efdd20f2b978ee421b53e36ed94e4fdbd8944136c0ba23da4f6ba9fe3a2c64729c1426aee4dbe8098bfa5eebb943ae7fdaa4eec760485c564d'
15 '3583f23c55ccd46cefbd757ef3f82dc7a90f14c64ecf69a99ab3467ca1e6aeddf9822be4c4dffcdbb8841d79fe116cfb8eff0e9b44abaadbcbf8d50a10ab1ec9')
18 cd marisa-trie-$pkgver
21 # https://github.com/s-yata/marisa-trie/pull/45
22 patch -Np1 -i ../fix-format-security.patch
26 cd marisa-trie-$pkgver
27 # sse2 is part of amd64
28 ./configure --prefix=/usr --disable-static --enable-sse2
39 # Regenerate swig bindings
40 # remove ruby because it's broken for now
41 make -C bindings -j1 swig-perl swig-python
44 cd "$srcdir"/marisa-trie-$pkgver/bindings/perl
46 INC=-I"$srcdir"/marisa-trie-$pkgver/include \
47 LIBS=-L"$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs \
52 cd "$srcdir"/marisa-trie-$pkgver/bindings/python
53 python setup.py build_ext \
54 --include-dirs="$srcdir"/marisa-trie-$pkgver/include \
55 --library-dirs="$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs
59 cd "$srcdir"/marisa-trie-$pkgver/bindings/ruby
61 --with-opt-include="$srcdir"/marisa-trie-$pkgver/include \
62 --with-opt-lib="$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs \
68 pkgdesc="Static and space-efficient trie data structure library"
71 cd marisa-trie-$pkgver
72 make DESTDIR="$pkgdir" install
74 install -d "$pkgdir"/usr/share/doc/$pkgbase-$pkgver
75 install -m 644 docs/* "$pkgdir"/usr/share/doc/$pkgbase-$pkgver/
77 install -d "$pkgdir"/usr/share/licenses/$pkgname
78 install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/
81 package_perl-marisa() {
82 pkgdesc="Perl language binding for marisa"
83 depends=('perl' 'marisa')
85 cd marisa-trie-$pkgver/bindings/perl
86 make DESTDIR="$pkgdir" install
89 install -d "$pkgdir"/usr/share/licenses/$pkgname
90 install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/
93 package_python-marisa() {
94 pkgdesc="Python language binding for marisa"
95 depends=('python' 'marisa')
97 cd marisa-trie-$pkgver/bindings/python
98 python setup.py install -O1 --root="$pkgdir"
101 install -d "$pkgdir"/usr/share/licenses/$pkgname
102 install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/
105 package_ruby-marisa() {
106 pkgdesc="Ruby language binding for marisa"
107 depends=('ruby' 'marisa')
109 # ruby version without the patch number, e.g. 2.4
110 local _rubyver=$(ruby -e"puts Gem.ruby_version.to_s.split('.')[0..1].join('.')")
112 cd marisa-trie-$pkgver/bindings/ruby
113 _hdrdir=$(pkg-config --variable=rubyhdrdir ruby-$_rubyver)
114 _arch=$(pkg-config --variable=arch ruby-$_rubyver)
115 make DESTDIR="$pkgdir" install \
117 arch_hdrdir="${_hdrdir}/${_arch}" \
118 rubyhdrdir="$_hdrdir"
121 install -d "$pkgdir"/usr/share/licenses/$pkgname
122 install -m 644 AUTHORS COPYING.md "$pkgdir"/usr/share/licenses/$pkgname/