void-packages/srcpkgs/snowball/patches/libstemmer-library.patch

34 lines
1.2 KiB
Diff

based on alpine patches which are based on gentoo patches
https://gitlab.alpinelinux.org/alpine/aports/-/blob/d16eed94064539a7a1f0242709e8d7b76448c51a/community/snowball/libstemmer-library.patch
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -175,7 +175,7 @@
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)
algorithms.mk: libstemmer/mkalgorithms.pl libstemmer/modules.txt
libstemmer/mkalgorithms.pl algorithms.mk libstemmer/modules.txt
@@ -225,6 +225,9 @@
libstemmer.a: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
$(AR) -cru $@ $^
+libstemmer.so: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
+ $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname,$@.$(shell echo $(SNOWBALL_VERSION) | cut -d. -f1),-version-script,libstemmer/symbol.map -o $@.$(SNOWBALL_VERSION) $^
+
examples/%.o: examples/%.c
$(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<
--- /dev/null
+++ b/libstemmer/symbol.map
@@ -0,0 +1,6 @@
+SB_STEMMER_0 {
+ global:
+ sb_stemmer_*;
+ local:
+ *;
+};