[arch-commits] Commit in marisa/repos (3 files)

Felix Yan felixonmars at gemini.archlinux.org
Sun May 29 16:18:54 UTC 2022


    Date: Sunday, May 29, 2022 @ 16:18:54
  Author: felixonmars
Revision: 1214766

archrelease: copy trunk to community-staging-x86_64

Added:
  marisa/repos/community-staging-x86_64/
  marisa/repos/community-staging-x86_64/PKGBUILD
    (from rev 1214765, marisa/trunk/PKGBUILD)
  marisa/repos/community-staging-x86_64/fix-format-security.patch
    (from rev 1214765, marisa/trunk/fix-format-security.patch)

---------------------------+
 PKGBUILD                  |  123 ++++++++++++++++++++++++++++++++++++++++++++
 fix-format-security.patch |   22 +++++++
 2 files changed, 145 insertions(+)

Copied: marisa/repos/community-staging-x86_64/PKGBUILD (from rev 1214765, marisa/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2022-05-29 16:18:54 UTC (rev 1214766)
@@ -0,0 +1,123 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: ponsfoot <cabezon dot hashimoto at gmail dot com>
+
+pkgbase=marisa
+pkgname=('marisa' 'perl-marisa' 'python-marisa' 'ruby-marisa')
+pkgver=0.2.6
+pkgrel=9
+arch=('x86_64')
+url="https://github.com/s-yata/marisa-trie"
+license=('BSD' 'LGPL')
+makedepends=('python' 'ruby' 'perl' 'swig')
+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')
+
+prepare() {
+  cd marisa-trie-$pkgver
+  autoreconf -i
+
+  # https://github.com/s-yata/marisa-trie/pull/45
+  patch -Np1 -i ../fix-format-security.patch
+}
+
+build() {
+  cd marisa-trie-$pkgver
+  # sse2 is part of amd64
+  ./configure --prefix=/usr --disable-static --enable-sse2
+    # --enable-popcnt
+    # --enable-sse3
+    # --enable-ssse3
+    # --enable-sse4.1
+    # --enable-sse4.2
+    # --enable-sse4
+    # --enable-sse4a
+
+  make
+
+  # Regenerate swig bindings
+  # remove ruby because it's broken for now
+  make -C bindings -j1 swig-perl swig-python
+
+  # Perl bindings
+  cd "$srcdir"/marisa-trie-$pkgver/bindings/perl
+  perl Makefile.PL \
+    INC=-I"$srcdir"/marisa-trie-$pkgver/include \
+    LIBS=-L"$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs \
+    INSTALLDIRS=vendor
+  make
+
+  # Python bindings
+  cd "$srcdir"/marisa-trie-$pkgver/bindings/python
+  python setup.py build_ext \
+    --include-dirs="$srcdir"/marisa-trie-$pkgver/include \
+    --library-dirs="$srcdir"/marisa-trie-$pkgver/lib/marisa/.libs
+  python setup.py build
+
+  # 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/
+}
+
+package_python-marisa() {
+  pkgdesc="Python language binding for marisa"
+  depends=('python' 'marisa')
+
+  cd marisa-trie-$pkgver/bindings/python
+  python setup.py install -O1 --root="$pkgdir"
+
+  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/
+}

Copied: marisa/repos/community-staging-x86_64/fix-format-security.patch (from rev 1214765, marisa/trunk/fix-format-security.patch)
===================================================================
--- community-staging-x86_64/fix-format-security.patch	                        (rev 0)
+++ community-staging-x86_64/fix-format-security.patch	2022-05-29 16:18:54 UTC (rev 1214766)
@@ -0,0 +1,22 @@
+From 5813d3b189512202b698aa4851e21b382acd003b Mon Sep 17 00:00:00 2001
+From: Xeonacid <h.dwwwwww at 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				 
+ 
+ 



More information about the arch-commits mailing list