public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/snowball-stemmer/, dev-libs/snowball-stemmer/files/
@ 2021-08-27  8:41 Hans de Graaff
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Graaff @ 2021-08-27  8:41 UTC (permalink / raw
  To: gentoo-commits

commit:     3a9fd14fdf6bab2122e4a55d6e6030bdd6fd5ef7
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Sun Aug 22 10:07:09 2021 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Fri Aug 27 08:40:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a9fd14f

dev-libs/snowball-stemmer: add 2.1.0

This version bump reworks the original ebuild, with following list of
changes:
- use EAPI 8
- append github to HOMEPAGE
- change DESCRIPTION to one used in github
- change license to BSD, this one is used in upstream
- use new shared library patch based on alpinelinux patch
- enable testing

Closes: https://bugs.gentoo.org/719402
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-libs/snowball-stemmer/Manifest                 |  2 +
 .../snowball-stemmer-2.1.0-shared-library.patch    | 58 ++++++++++++++++++++++
 .../snowball-stemmer/snowball-stemmer-2.1.0.ebuild | 54 ++++++++++++++++++++
 3 files changed, 114 insertions(+)

diff --git a/dev-libs/snowball-stemmer/Manifest b/dev-libs/snowball-stemmer/Manifest
index fbb928ad499..c119bfe7fd7 100644
--- a/dev-libs/snowball-stemmer/Manifest
+++ b/dev-libs/snowball-stemmer/Manifest
@@ -1 +1,3 @@
+DIST snowball-data-887fb7a3e006f32b4979e0d55f2543abe78a42f1.tar.gz 33063750 BLAKE2B bffc7e9f8fadbaecf9a7d1a2b8ee7a9db0b1dc1d5a6304a9c8d60b6c24a0947307b8780a99d2349b19e5fbcdfe819cc400ffb0b8b1df9748bb401ae1dec7b9aa SHA512 b68567d3e59aaa870251f682988b52a89d82767e954adea6b7f6247a6d432c29c8373c95a5e49df07110d4cb396aafa64ee6c71af2c0680d383ffe22491e50dd
 DIST libstemmer_c-20140325.tgz 129506 BLAKE2B 46040a864b8111bcca1c858a16081542a9900e435e6154582e422e1687b8230b0a5f63c7e349e1ef47128eaa898891df7b87fd2a4d97d0c1304fb8af7ebb627b SHA512 938eb12d4fe9e229f21536a6cb8a4322e0b664a7fbc15685e7ad46b4a6ccdfbefc55cc484f86bc738791d6f3e6d1b61ba777a4332a62cf76a8b0a5efd2c2762b
+DIST snowball-stemmer-2.1.0.tar.gz 220324 BLAKE2B 3d92a2f5b4bd633932d681f2555cf1cc1a2c1a1c71fd0272f09bee17628d034a20649450dd90242c155ab7b262e685913d5ad4034bce6e7a41d76f0dfc724137 SHA512 1efd7d8ab58852987e83247048244882c517e32237c8cb3c0558b66ecfb075733ce8805ebb76041e6e7d6664c236054effe66838e7c524ee529ce869aa8134f0

diff --git a/dev-libs/snowball-stemmer/files/snowball-stemmer-2.1.0-shared-library.patch b/dev-libs/snowball-stemmer/files/snowball-stemmer-2.1.0-shared-library.patch
new file mode 100644
index 00000000000..20c7a386b43
--- /dev/null
+++ b/dev-libs/snowball-stemmer/files/snowball-stemmer-2.1.0-shared-library.patch
@@ -0,0 +1,58 @@
+This is based on a patch taken from alpinelinux, however, duplicated
+libstemmer.o and stemwords targets were removed.
+
+Created shared library contains a lot of relocations, which slow down loading.
+It is known issue and probably the main reason why upstream does not support
+shared library yet [1].
+
+[1] https://github.com/snowballstem/snowball/issues/34#issuecomment-203200078
+
+Alpinelinux-patch: https://git.alpinelinux.org/aports/tree/community/snowball/libstemmer-library.patch?id=28f9d9e192876c43fd96bc5856cd9d8a50dd49c0
+Upstream-issue: https://github.com/snowballstem/snowball/issues/34
+
+diff --git a/GNUmakefile b/GNUmakefile
+index 5cb2179..d1ef193 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -3,6 +3,7 @@
+ # After changing this, run `make update_version` to update various sources
+ # which hard-code it.
+ SNOWBALL_VERSION = 2.1.0
++MAJOR_VERSION := $(shell echo $(SNOWBALL_VERSION) | cut -d. -f1)
+ 
+ c_src_dir = src_c
+ 
+@@ -162,10 +163,18 @@ C_OTHER_OBJECTS = $(C_OTHER_SOURCES:.c=.o)
+ JAVA_CLASSES = $(JAVA_SOURCES:.java=.class)
+ JAVA_RUNTIME_CLASSES=$(JAVARUNTIME_SOURCES:.java=.class)
+ 
+-CFLAGS=-O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations
+-CPPFLAGS=-Iinclude
++CFLAGS+=-fPIC -W -Wall -Wmissing-prototypes -Wmissing-declarations
++CPPFLAGS+=-Iinclude
+ 
+-all: snowball libstemmer.o stemwords $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
++all: snowball libstemmer.o libstemmer.so libstemmer.a stemwords $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
++
++libstemmer.so: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
++	$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,$@.$(MAJOR_VERSION),-version-script,libstemmer/symbol.map -o $@.$(SNOWBALL_VERSION) $^
++	ln -s $@.$(SNOWBALL_VERSION) $@.$(MAJOR_VERSION)
++	ln -s $@.$(SNOWBALL_VERSION) $@
++
++libstemmer.a: libstemmer.o
++	$(AR) -crs $@ $^
+ 
+ clean:
+ 	rm -f $(COMPILER_OBJECTS) $(RUNTIME_OBJECTS) \
+diff --git a/libstemmer/symbol.map b/libstemmer/symbol.map
+new file mode 100644
+index 0000000..7a3d423
+--- /dev/null
++++ b/libstemmer/symbol.map
+@@ -0,0 +1,6 @@
++SB_STEMMER_0 {
++    global:
++        sb_stemmer_*;
++    local:
++        *;
++};

diff --git a/dev-libs/snowball-stemmer/snowball-stemmer-2.1.0.ebuild b/dev-libs/snowball-stemmer/snowball-stemmer-2.1.0.ebuild
new file mode 100644
index 00000000000..c486383408f
--- /dev/null
+++ b/dev-libs/snowball-stemmer/snowball-stemmer-2.1.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+MY_TESTDATA_COMMIT="887fb7a3e006f32b4979e0d55f2543abe78a42f1"
+
+DESCRIPTION="Snowball compiler and stemming algorithms"
+HOMEPAGE="https://snowballstem.org/ https://github.com/snowballstem/snowball/"
+SRC_URI="https://github.com/snowballstem/snowball/archive/v${PV}.tar.gz -> ${P}.tar.gz
+	test? ( https://github.com/snowballstem/snowball-data/archive/${MY_TESTDATA_COMMIT}.tar.gz -> snowball-data-${MY_TESTDATA_COMMIT}.tar.gz )"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~ppc-macos ~sparc-solaris ~sparc64-solaris"
+IUSE="static-libs test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+BDEPEND="dev-lang/perl
+	test? ( virtual/libiconv )"
+RESTRICT="!test? ( test )"
+
+S="${WORKDIR}/snowball-${PV}"
+
+PATCHES=(
+	"${FILESDIR}/${P}-shared-library.patch"
+)
+
+src_compile() {
+	export CC=$(tc-getCC)
+	export AR=$(tc-getAR)
+	default
+}
+
+src_install() {
+	dodoc README.rst NEWS
+
+	dobin stemwords
+
+	doheader include/libstemmer.h
+
+	dolib.so libstemmer.so.${PV}
+	dolib.so libstemmer.so.$(ver_cut 1)
+	dolib.so libstemmer.so
+
+	use static-libs && dolib.a libstemmer.a
+}
+
+src_test() {
+	emake -j1 STEMMING_DATA="${WORKDIR}/snowball-data-${MY_TESTDATA_COMMIT}" check
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/snowball-stemmer/, dev-libs/snowball-stemmer/files/
@ 2021-11-22 10:11 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2021-11-22 10:11 UTC (permalink / raw
  To: gentoo-commits

commit:     12db61e29d3ac4fba3cedd40acc98144d59119dd
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Wed Nov 10 09:43:54 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 22 10:09:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12db61e2

dev-libs/snowball-stemmer: add 2.2.0

It was necessary to rebase shared-library patch due to changes in
snowball-stemmer GNUmakefile.

Upstream-issue: https://github.com/snowballstem/snowball/issues/34
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Closes: https://github.com/gentoo/gentoo/pull/22880
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/snowball-stemmer/Manifest                 |  2 +
 .../snowball-stemmer-2.2.0-shared-library.patch    | 59 ++++++++++++++++++++++
 .../snowball-stemmer/snowball-stemmer-2.2.0.ebuild | 53 +++++++++++++++++++
 3 files changed, 114 insertions(+)

diff --git a/dev-libs/snowball-stemmer/Manifest b/dev-libs/snowball-stemmer/Manifest
index e388935a8378..b3ba23854621 100644
--- a/dev-libs/snowball-stemmer/Manifest
+++ b/dev-libs/snowball-stemmer/Manifest
@@ -1,2 +1,4 @@
+DIST snowball-data-0703f1d6a21802c3ff00c2c8b31bd255b74b2aec.tar.gz 33063873 BLAKE2B d4222f2dbf681c670017596c2510ca389a33c736e2b4deeda3f33559e9fdda7c86bd528f4b56fc124ef5c08818739576ef28b93b326505b6ad77259c4b638a4c SHA512 a5b3eb0d73dbefd243e6f5964071c83823e4b367b5a24a660aadffe6bcd3c2e855d5cc5edcd382a88e0edd270a7576388a04fb9141ae888776824c5a74b2beef
 DIST snowball-data-887fb7a3e006f32b4979e0d55f2543abe78a42f1.tar.gz 33063750 BLAKE2B bffc7e9f8fadbaecf9a7d1a2b8ee7a9db0b1dc1d5a6304a9c8d60b6c24a0947307b8780a99d2349b19e5fbcdfe819cc400ffb0b8b1df9748bb401ae1dec7b9aa SHA512 b68567d3e59aaa870251f682988b52a89d82767e954adea6b7f6247a6d432c29c8373c95a5e49df07110d4cb396aafa64ee6c71af2c0680d383ffe22491e50dd
 DIST snowball-stemmer-2.1.0.tar.gz 220324 BLAKE2B 3d92a2f5b4bd633932d681f2555cf1cc1a2c1a1c71fd0272f09bee17628d034a20649450dd90242c155ab7b262e685913d5ad4034bce6e7a41d76f0dfc724137 SHA512 1efd7d8ab58852987e83247048244882c517e32237c8cb3c0558b66ecfb075733ce8805ebb76041e6e7d6664c236054effe66838e7c524ee529ce869aa8134f0
+DIST snowball-stemmer-2.2.0.tar.gz 223846 BLAKE2B ac06a603ab21dfe5508c1a51419568c15d61ad079a3cded98ca6a47716f4119e480b109756a107da1e6c9994062073cbfb29ac4feb3e5e4ffab6feb4db2b9930 SHA512 02c43313de9de2518ea51cfb11f1c29145fc046c7838329bfdefd70b604009ad44b6db8175c25b0db31f03db30a6aec5857aa35775a9c204ec976df9cae62957

diff --git a/dev-libs/snowball-stemmer/files/snowball-stemmer-2.2.0-shared-library.patch b/dev-libs/snowball-stemmer/files/snowball-stemmer-2.2.0-shared-library.patch
new file mode 100644
index 000000000000..4baa2281216c
--- /dev/null
+++ b/dev-libs/snowball-stemmer/files/snowball-stemmer-2.2.0-shared-library.patch
@@ -0,0 +1,59 @@
+This is based on a patch taken from alpinelinux, however, duplicated
+libstemmer.o and stemwords targets were removed and the patch was
+rebased on top of v2.2.0 tag.
+
+Created shared library contains a lot of relocations, which slow down loading.
+It is known issue and probably the main reason why upstream does not support
+shared library yet [1].
+
+[1] https://github.com/snowballstem/snowball/issues/34#issuecomment-203200078
+
+Alpinelinux-patch: https://git.alpinelinux.org/aports/tree/community/snowball/libstemmer-library.patch?id=28f9d9e192876c43fd96bc5856cd9d8a50dd49c0
+Upstream-issue: https://github.com/snowballstem/snowball/issues/34
+
+diff --git a/GNUmakefile b/GNUmakefile
+index 98eb1fa..9b539ec 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -4,6 +4,8 @@
+ # which hard-code it.
+ SNOWBALL_VERSION = 2.2.0
+ 
++MAJOR_VERSION := $(shell echo $(SNOWBALL_VERSION) | cut -d. -f1)
++
+ ifeq ($(OS),Windows_NT)
+ EXEEXT = .exe
+ endif
+@@ -170,12 +172,17 @@ C_OTHER_OBJECTS = $(C_OTHER_SOURCES:.c=.o)
+ JAVA_CLASSES = $(JAVA_SOURCES:.java=.class)
+ JAVA_RUNTIME_CLASSES=$(JAVARUNTIME_SOURCES:.java=.class)
+ 
+-CFLAGS=-O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations
+-CPPFLAGS=
++CFLAGS+=-fPIC -W -Wall -Wmissing-prototypes -Wmissing-declarations
++CPPFLAGS+=
+ 
+ INCLUDES=-Iinclude
+ 
+-all: snowball$(EXEEXT) libstemmer.a stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
++all: snowball$(EXEEXT) libstemmer.a libstemmer.so stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
++
++libstemmer.so: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
++	$(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,$@.$(MAJOR_VERSION),-version-script,libstemmer/symbol.map -o $@.$(SNOWBALL_VERSION) $^
++	ln -s $@.$(SNOWBALL_VERSION) $@.$(MAJOR_VERSION)
++	ln -s $@.$(SNOWBALL_VERSION) $@
+ 
+ algorithms.mk: libstemmer/mkalgorithms.pl libstemmer/modules.txt
+ 	libstemmer/mkalgorithms.pl algorithms.mk libstemmer/modules.txt
+diff --git a/libstemmer/symbol.map b/libstemmer/symbol.map
+new file mode 100644
+index 0000000..7a3d423
+--- /dev/null
++++ b/libstemmer/symbol.map
+@@ -0,0 +1,6 @@
++SB_STEMMER_0 {
++    global:
++        sb_stemmer_*;
++    local:
++        *;
++};

diff --git a/dev-libs/snowball-stemmer/snowball-stemmer-2.2.0.ebuild b/dev-libs/snowball-stemmer/snowball-stemmer-2.2.0.ebuild
new file mode 100644
index 000000000000..64f05cff45c2
--- /dev/null
+++ b/dev-libs/snowball-stemmer/snowball-stemmer-2.2.0.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+MY_TESTDATA_COMMIT="0703f1d6a21802c3ff00c2c8b31bd255b74b2aec"
+
+DESCRIPTION="Snowball compiler and stemming algorithms"
+HOMEPAGE="https://snowballstem.org/ https://github.com/snowballstem/snowball/"
+SRC_URI="https://github.com/snowballstem/snowball/archive/v${PV}.tar.gz -> ${P}.tar.gz
+	test? ( https://github.com/snowballstem/snowball-data/archive/${MY_TESTDATA_COMMIT}.tar.gz -> snowball-data-${MY_TESTDATA_COMMIT}.tar.gz )"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1)"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~ppc-macos ~sparc-solaris ~sparc64-solaris"
+IUSE="static-libs test"
+
+DEPEND=""
+RDEPEND="${DEPEND}"
+BDEPEND="dev-lang/perl
+	test? ( virtual/libiconv )"
+RESTRICT="!test? ( test )"
+
+S="${WORKDIR}/snowball-${PV}"
+
+PATCHES=(
+	"${FILESDIR}/${P}-shared-library.patch"
+)
+
+src_compile() {
+	tc-export CC AR
+	default
+}
+
+src_test() {
+	emake -j1 STEMMING_DATA="${WORKDIR}/snowball-data-${MY_TESTDATA_COMMIT}" check
+}
+
+src_install() {
+	dodoc README.rst NEWS
+
+	dobin stemwords
+
+	doheader include/libstemmer.h
+
+	dolib.so libstemmer.so.${PV}
+	dolib.so libstemmer.so.$(ver_cut 1)
+	dolib.so libstemmer.so
+
+	use static-libs && dolib.a libstemmer.a
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-22 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-27  8:41 [gentoo-commits] repo/gentoo:master commit in: dev-libs/snowball-stemmer/, dev-libs/snowball-stemmer/files/ Hans de Graaff
  -- strict thread matches above, loose matches on Subject: below --
2021-11-22 10:11 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox