aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpsykose <alice@ayaya.dev>2023-02-01 08:45:55 +0000
committerpsykose <alice@ayaya.dev>2023-02-01 09:45:55 +0100
commit025968418c2008aee7fcda46d9de5a1cd9c953ff (patch)
treeb9acd72f62bf1be2b9d458e7a4dc8778928aeb26
parentb61e2a5556fcbbb6d3b2b14591c68a23b891f4e1 (diff)
downloadaports-025968418c2008aee7fcda46d9de5a1cd9c953ff.tar.gz
aports-025968418c2008aee7fcda46d9de5a1cd9c953ff.tar.bz2
aports-025968418c2008aee7fcda46d9de5a1cd9c953ff.tar.xz
community/libmarisa: add py subpackage
-rw-r--r--community/libmarisa/APKBUILD41
-rw-r--r--community/libmarisa/format-sec.patch23
2 files changed, 55 insertions, 9 deletions
diff --git a/community/libmarisa/APKBUILD b/community/libmarisa/APKBUILD
index 3d1c64ad405..865245aa782 100644
--- a/community/libmarisa/APKBUILD
+++ b/community/libmarisa/APKBUILD
@@ -2,14 +2,16 @@
# Maintainer: Eric Tian <thxdaemon+gitlab.alpine@gmail.com>
pkgname=libmarisa
pkgver=0.2.6
-pkgrel=1
+pkgrel=2
pkgdesc="MARISA: Matching Algorithm with Recursively Implemented StorAge"
url="https://github.com/s-yata/marisa-trie"
arch="all"
license="BSD-2-Clause OR LGPL-2.1-or-later"
-makedepends="autoconf automake libtool"
-subpackages="$pkgname-dev"
-source="$pkgname-$pkgver.tar.gz::https://github.com/s-yata/marisa-trie/archive/v$pkgver.tar.gz"
+makedepends="autoconf automake libtool python3-dev swig"
+subpackages="$pkgname-dev py3-marisa:py"
+source="$pkgname-$pkgver.tar.gz::https://github.com/s-yata/marisa-trie/archive/v$pkgver.tar.gz
+ format-sec.patch
+ "
builddir="$srcdir/marisa-trie-$pkgver"
prepare() {
@@ -18,14 +20,25 @@ prepare() {
}
build() {
- local configure_options=
-
case "$CARCH" in
- x86_64) configure_options="$configure_options --enable-sse2" ;;
+ x86_64)
+ local configure_options="$configure_options --enable-sse2" ;;
esac
- ./configure --prefix=/usr $configure_options
+ ./configure \
+ --prefix=/usr \
+ --host=$CHOST \
+ --build=$CBUILD \
+ $configure_options
make
+
+ make -j1 -C bindings swig-python
+
+ cd bindings/python
+ python3 setup.py build_ext \
+ --include-dirs="$builddir"/include \
+ --library-dirs="$builddir"/lib/marisa/.libs
+ python3 setup.py build
}
check() {
@@ -34,6 +47,16 @@ check() {
package() {
make DESTDIR="$pkgdir" install
+ cd bindings/python
+ python3 setup.py install --skip-build --root="$pkgdir"
+}
+
+py() {
+ pkgdesc="$pkgdesc (python module)"
+ amove usr/lib/python3*
}
-sha512sums="c094e4b22e1457efdd20f2b978ee421b53e36ed94e4fdbd8944136c0ba23da4f6ba9fe3a2c64729c1426aee4dbe8098bfa5eebb943ae7fdaa4eec760485c564d libmarisa-0.2.6.tar.gz"
+sha512sums="
+c094e4b22e1457efdd20f2b978ee421b53e36ed94e4fdbd8944136c0ba23da4f6ba9fe3a2c64729c1426aee4dbe8098bfa5eebb943ae7fdaa4eec760485c564d libmarisa-0.2.6.tar.gz
+778486421fcda6fbbfb4c61b48ed64f1166ab937361098b405a798b88ce27ad2169c7a5be9d2e66de042bf5a65b5a332183a32a42fd31fbeecb679671c4ab929 format-sec.patch
+"
diff --git a/community/libmarisa/format-sec.patch b/community/libmarisa/format-sec.patch
new file mode 100644
index 00000000000..821606aaf98
--- /dev/null
+++ b/community/libmarisa/format-sec.patch
@@ -0,0 +1,23 @@
+Patch-Source: https://github.com/archlinux/svntogit-community/blob/packages/marisa/trunk/fix-format-security.patch
+From 5813d3b189512202b698aa4851e21b382acd003b Mon Sep 17 00:00:00 2001
+From: Xeonacid <h.dwwwwww@gmail.com>
+Date: Sat, 5 Feb 2022 08:51:43 +0800
+Subject: [PATCH] Fix format security
+
+---
+ bindings/ruby/marisa-swig_wrap.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/bindings/ruby/marisa-swig_wrap.cxx b/bindings/ruby/marisa-swig_wrap.cxx
+index eae2304..ddc346d 100644
+--- a/bindings/ruby/marisa-swig_wrap.cxx
++++ b/bindings/ruby/marisa-swig_wrap.cxx
+@@ -1402,7 +1402,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
+ /* Error manipulation */
+
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
+-#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
++#define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
+ #define SWIG_fail goto fail
+
+