diff options
author | 2021-08-22 12:07:09 +0200 | |
---|---|---|
committer | 2021-08-27 10:40:41 +0200 | |
commit | 3a9fd14fdf6bab2122e4a55d6e6030bdd6fd5ef7 (patch) | |
tree | 0ec2bfcf50a830dc7e10d3a6a8b4f39edc24fb81 /dev-libs/snowball-stemmer/files | |
parent | dev-util/jenkins-bin: allow java 11 and add 2.308 (diff) | |
download | gentoo-3a9fd14fdf6bab2122e4a55d6e6030bdd6fd5ef7.tar.gz gentoo-3a9fd14fdf6bab2122e4a55d6e6030bdd6fd5ef7.tar.bz2 gentoo-3a9fd14fdf6bab2122e4a55d6e6030bdd6fd5ef7.zip |
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@atlas.cz>
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'dev-libs/snowball-stemmer/files')
-rw-r--r-- | dev-libs/snowball-stemmer/files/snowball-stemmer-2.1.0-shared-library.patch | 58 |
1 files changed, 58 insertions, 0 deletions
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 000000000000..20c7a386b430 --- /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: ++ *; ++}; |