libstemmer: move recipe to meta-oe

Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Markus Volk
2022-12-19 22:09:55 +01:00
committed by Khem Raj
parent 4a3bf82ff1
commit d2ad9efcd7
2 changed files with 0 additions and 0 deletions
@@ -1,63 +0,0 @@
From eacc9e9c62a3857ce1e2e24b81fc22d8ae91f422 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Thu, 9 May 2019 22:06:48 +0200
Subject: [PATCH] Build so-lib
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Stolen from [1]
[1] https://aur.archlinux.org/cgit/aur.git/commit/dynamiclib.patch?h=snowball-git&id=a9cbf4f42f3661e4b8f791cd4374233821716ea1
Upstream-Status: Pending
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
GNUmakefile | 7 +++++--
libstemmer/symbol.map | 6 ++++++
2 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 libstemmer/symbol.map
diff --git a/GNUmakefile b/GNUmakefile
index cbd6ff7..a85230b 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -162,10 +162,10 @@ 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
+CFLAGS=-O2 -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 stemwords $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
clean:
rm -f $(COMPILER_OBJECTS) $(RUNTIME_OBJECTS) \
@@ -212,6 +212,9 @@ libstemmer/libstemmer.o: libstemmer/modules.h $(C_LIB_HEADERS)
libstemmer.o: 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,libstemmer.so.0,-version-script,libstemmer/symbol.map -o $@.0.0.0 $^
+
stemwords: $(STEMWORDS_OBJECTS) libstemmer.o
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
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:
+ *;
+};
--
2.20.1
@@ -1,38 +0,0 @@
SUMMARY = "Snowball compiler and stemming algorithms"
HOMEPAGE = "https://snowballstem.org/"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=19139aaf3c8c8fa1ca6edd59c072fb9f"
DEPENDS:class-target = "${BPN}-native"
SRC_URI = "\
git://github.com/snowballstem/snowball.git;branch=master;protocol=https \
file://0001-Build-so-lib.patch \
"
SRCREV = "4764395431c8f2a0b4fe18b816ab1fc966a45837"
S = "${WORKDIR}/git"
PV = "2.1.0"
LIBVER = "0.0.0"
inherit lib_package
BBCLASSEXTEND = "native"
do_compile:prepend:class-target() {
# use native tools
sed -i 's:./snowball :snowball :g' ${S}/GNUmakefile
}
do_install() {
install -d ${D}${bindir}
install -m 755 ${S}/snowball ${D}${bindir}
install -m 755 ${S}/stemwords ${D}${bindir}
install -d ${D}${libdir}
install -m 755 ${S}/libstemmer.so.${LIBVER} ${D}${libdir}/
ln -s libstemmer.so.${LIBVER} ${D}${libdir}/libstemmer.so.0
ln -s libstemmer.so.${LIBVER} ${D}${libdir}/libstemmer.so
install -d ${D}${includedir}
install -m 644 ${S}/include/*.h ${D}${includedir}
}