aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2021-01-15 03:07:13 -0300
committerLeo <thinkabit.ukim@gmail.com>2021-01-15 06:39:41 +0000
commitd2575b85e896947c3b985707529c1bb74f24fbdc (patch)
treef072caebac0c5393f009738c67480046ede7c19b
parent888bdca89d5944e6917e405d2b923dadda03aecc (diff)
downloadaports-d2575b85e896947c3b985707529c1bb74f24fbdc.tar.gz
aports-d2575b85e896947c3b985707529c1bb74f24fbdc.tar.bz2
aports-d2575b85e896947c3b985707529c1bb74f24fbdc.tar.xz
community/lucene++: fix packaging
This buildsystem is so easy to get wrong and so hard to get right, just import all the work done by Debian.
-rw-r--r--community/lucene++/160.patch72
-rw-r--r--community/lucene++/161.patch24
-rw-r--r--community/lucene++/162.patch49
-rw-r--r--community/lucene++/163.patch147
-rw-r--r--community/lucene++/APKBUILD32
5 files changed, 319 insertions, 5 deletions
diff --git a/community/lucene++/160.patch b/community/lucene++/160.patch
new file mode 100644
index 0000000000..d41106ccc0
--- /dev/null
+++ b/community/lucene++/160.patch
@@ -0,0 +1,72 @@
+From fd9eaf10c49239d700af848062acc1d5efd54aa8 Mon Sep 17 00:00:00 2001
+From: liuzhangjian <liuzhangjian@uniontech.com>
+Date: Fri, 4 Dec 2020 15:41:31 +0800
+Subject: [PATCH] Title:fix a bug of ChineseTokenizer
+
+Description:When I use ChineseAnalyzer for Chinese word segmentation, I find that English and numbers are treated as one word and I think they should be separated.
+
+RootCause:Null
+
+Solution:
+---
+ .../common/analysis/cn/ChineseFilter.cpp | 2 +-
+ .../common/analysis/cn/ChineseTokenizer.cpp | 22 ++++++++++++++++++-
+ 2 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp b/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp
+index d2a19f3f..83134454 100644
+--- a/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp
++++ b/src/contrib/analyzers/common/analysis/cn/ChineseFilter.cpp
+@@ -38,7 +38,7 @@ bool ChineseFilter::incrementToken() {
+ if (text.length() > 1) {
+ return true;
+ }
+- } else if (UnicodeUtil::isOther(text[0])) {
++ } else if (UnicodeUtil::isOther(text[0]) || UnicodeUtil::isDigit(text[0])) {
+ // One Chinese character as one Chinese word.
+ // Chinese word extraction to be added later here.
+ return true;
+diff --git a/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp b/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp
+index 38bf9875..3b4de742 100644
+--- a/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp
++++ b/src/contrib/analyzers/common/analysis/cn/ChineseTokenizer.cpp
+@@ -65,6 +65,7 @@ bool ChineseTokenizer::incrementToken() {
+
+ length = 0;
+ start = offset;
++ bool last_is_en = false, last_is_num = false;
+
+ while (true) {
+ wchar_t c;
+@@ -82,11 +83,30 @@ bool ChineseTokenizer::incrementToken() {
+ c = ioBuffer[bufferIndex++];
+ }
+
+- if (UnicodeUtil::isDigit(c) || UnicodeUtil::isLower(c) || UnicodeUtil::isUpper(c)) {
++ if (UnicodeUtil::isLower(c) || UnicodeUtil::isUpper(c)) {
++ if (last_is_num) {
++ --bufferIndex;
++ --offset;
++ return flush();
++ }
++
++ push(c);
++ if (length == MAX_WORD_LEN) {
++ return flush();
++ }
++ last_is_en = true;
++ } else if (UnicodeUtil::isDigit(c)) {
++ if (last_is_en) {
++ --bufferIndex;
++ --offset;
++ return flush();
++ }
++
+ push(c);
+ if (length == MAX_WORD_LEN) {
+ return flush();
+ }
++ last_is_num = true;
+ } else if (UnicodeUtil::isOther(c)) {
+ if (length > 0) {
+ --bufferIndex;
diff --git a/community/lucene++/161.patch b/community/lucene++/161.patch
new file mode 100644
index 0000000000..8f2ada224a
--- /dev/null
+++ b/community/lucene++/161.patch
@@ -0,0 +1,24 @@
+From 5c06dc53560668606b72fa0e673c9eb96948ff39 Mon Sep 17 00:00:00 2001
+From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
+Date: Mon, 4 Jan 2021 15:47:21 +0100
+Subject: [PATCH] CMakeLists.txt: fix typo preventing lucene++-contrib library
+ symlink from being created correctly
+
+The SONAME/SOVERSION weren't evaluated and set correctly because of the wrong target name.
+---
+ src/contrib/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/contrib/CMakeLists.txt b/src/contrib/CMakeLists.txt
+index 46ed8a24..afeccb4e 100644
+--- a/src/contrib/CMakeLists.txt
++++ b/src/contrib/CMakeLists.txt
+@@ -77,7 +77,7 @@ endif()
+ ####################################
+ target_compile_options(lucene++-contrib PRIVATE -DLPP_BUILDING_LIB)
+
+-set_target_properties(lucene++
++set_target_properties(lucene++-contrib
+ PROPERTIES
+ COTIRE_CXX_PREFIX_HEADER_INIT "include/ContribInc.h"
+ CXX_VISIBILITY_PRESET hidden
diff --git a/community/lucene++/162.patch b/community/lucene++/162.patch
new file mode 100644
index 0000000000..b32fd4368b
--- /dev/null
+++ b/community/lucene++/162.patch
@@ -0,0 +1,49 @@
+From 39cd44bd54e918d25ee464477992ad0dc234dcba Mon Sep 17 00:00:00 2001
+From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
+Date: Mon, 4 Jan 2021 16:29:25 +0100
+Subject: [PATCH] pkgconfig: use correct LIBDIR for destination library
+
+---
+ src/config/contrib/liblucene++-contrib.pc.in | 4 ++--
+ src/config/core/liblucene++.pc.in | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/config/contrib/liblucene++-contrib.pc.in b/src/config/contrib/liblucene++-contrib.pc.in
+index 21026e0a..64c3acac 100644
+--- a/src/config/contrib/liblucene++-contrib.pc.in
++++ b/src/config/contrib/liblucene++-contrib.pc.in
+@@ -1,13 +1,13 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}/bin
+-libdir=@LIB_DESTINATION@
++libdir=${prefix}/@LIB_DESTINATION@
+ includedir=${prefix}/include/lucene++
+ lib=lucene++-contrib
+
+ Name: liblucene++-contrib
+ Description: Contributions for Lucene++ - a C++ search engine, ported from the popular Apache Lucene
+ Version: @lucene++_VERSION@
+-Libs: -L@LIB_DESTINATION@ -l${lib}
++Libs: -L${libdir} -l${lib}
+ Cflags: -I${includedir}
+ Requires: liblucene++ = @lucene++_VERSION@
+
+diff --git a/src/config/core/liblucene++.pc.in b/src/config/core/liblucene++.pc.in
+index 32d16ad7..690f7d24 100644
+--- a/src/config/core/liblucene++.pc.in
++++ b/src/config/core/liblucene++.pc.in
+@@ -1,12 +1,12 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=${prefix}/bin
+-libdir=@LIB_DESTINATION@
++libdir=${prefix}/@LIB_DESTINATION@
+ includedir=${prefix}/include/lucene++
+ lib=lucene++
+
+ Name: liblucene++
+ Description: Lucene++ - a C++ search engine, ported from the popular Apache Lucene
+ Version: @lucene++_VERSION@
+-Libs: -L@LIB_DESTINATION@ -l${lib}
++Libs: -L${libdir} -l${lib}
+ Cflags: -I${includedir}
+
diff --git a/community/lucene++/163.patch b/community/lucene++/163.patch
new file mode 100644
index 0000000000..3025b326b7
--- /dev/null
+++ b/community/lucene++/163.patch
@@ -0,0 +1,147 @@
+From 1cd2509ed74ae47965006d16de3c09db029b4efe Mon Sep 17 00:00:00 2001
+From: Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
+Date: Mon, 4 Jan 2021 23:45:13 +0100
+Subject: [PATCH] Fix various cmake issues: "CMAKE_INSTALL_FULL_LIBDIR" not
+ being correctly evaluated and used pkgconfig directory wrongly set to include
+ instead of lib cmake directory wrongly set to include instead of lib
+ core_libname contrib_libname PACKAGE_CMAKE_INSTALL_INCLUDEDIR
+ PACKAGE_CMAKE_INSTALL_LIBDIR variables not being substituted to cmake.in
+ files cmake helpers not being correctly set
+
+---
+ CMakeLists.txt | 2 +-
+ src/config/CMakeLists.txt | 12 ++++++------
+ src/config/contrib/CMakeLists.txt | 7 ++++---
+ .../contrib/liblucene++-contribConfig.cmake.in | 6 +++---
+ src/config/core/CMakeLists.txt | 7 ++++---
+ src/config/core/liblucene++Config.cmake.in | 6 +++---
+ 6 files changed, 21 insertions(+), 19 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 41de688b..71dbbd56 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -21,7 +21,7 @@ if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ endif()
+
+ set(LIB_DESTINATION
+- "${CMAKE_INSTALL_FULL_LIBDIR}" CACHE STRING "Define lib output directory name")
++ "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "Define lib output directory name")
+
+
+ ####################################
+diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt
+index e5e66240..fe8e8b89 100644
+--- a/src/config/CMakeLists.txt
++++ b/src/config/CMakeLists.txt
+@@ -1,16 +1,16 @@
+ ####################################
+ # Set config vars
+ ####################################
+-set(core_libname, "lucene++")
+-set(contrib_libname, "lucene++-contrib")
++set(core_libname "lucene++")
++set(contrib_libname "lucene++-contrib")
+
+ set(
+- PACKAGE_CMAKE_INSTALL_INCLUDEDIR,
+- "${lucene++_INCLUDE_DIR}/lucene++/")
++ PACKAGE_CMAKE_INSTALL_INCLUDEDIR
++ "${CMAKE_INSTALL_INCLUDEDIR}/lucene++/")
+
+ set(
+- PACKAGE_CMAKE_INSTALL_LIBDIR,
+- "${LIB_INSTALL_DIR}/cmake")
++ PACKAGE_CMAKE_INSTALL_LIBDIR
++ "${LIB_DESTINATION}")
+
+
+ ####################################
+diff --git a/src/config/contrib/CMakeLists.txt b/src/config/contrib/CMakeLists.txt
+index c0dd86fc..b4a4391c 100644
+--- a/src/config/contrib/CMakeLists.txt
++++ b/src/config/contrib/CMakeLists.txt
+@@ -9,7 +9,7 @@ if(NOT WIN32)
+ install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contrib.pc"
+- DESTINATION "include/pkgconfig")
++ DESTINATION "${LIB_DESTINATION}/pkgconfig")
+ endif()
+
+
+@@ -19,7 +19,8 @@ endif()
+ configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/liblucene++-contribConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfig.cmake"
+- INSTALL_DESTINATION "${LIB_DESTINATION}/cmake")
++ INSTALL_DESTINATION "${LIB_DESTINATION}/cmake/liblucene++-contrib"
++ PATH_VARS contrib_libname PACKAGE_CMAKE_INSTALL_INCLUDEDIR PACKAGE_CMAKE_INSTALL_LIBDIR)
+
+ write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfigVersion.cmake"
+@@ -30,4 +31,4 @@ install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfig.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contribConfigVersion.cmake"
+- DESTINATION "include/cmake")
++ DESTINATION "${LIB_DESTINATION}/cmake/liblucene++-contrib")
+diff --git a/src/config/contrib/liblucene++-contribConfig.cmake.in b/src/config/contrib/liblucene++-contribConfig.cmake.in
+index f92f6830..85fdfd2e 100644
+--- a/src/config/contrib/liblucene++-contribConfig.cmake.in
++++ b/src/config/contrib/liblucene++-contribConfig.cmake.in
+@@ -20,6 +20,6 @@ if (NOT DEFINED set_and_check)
+ endif()
+
+
+-set_and_check(liblucene++-contrib_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/@contrib_libname@")
+-set_and_check(liblucene++-contrib_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
+-set(liblucene++-contrib_LIBRARIES "@PACKAGE_CMAKE_INSTALL_LIBDIR@/@contrib_libname@")
++set_and_check(liblucene++-contrib_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
++set_and_check(liblucene++-contrib_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_LIBDIR@")
++set(liblucene++-contrib_LIBRARIES "@contrib_libname@")
+diff --git a/src/config/core/CMakeLists.txt b/src/config/core/CMakeLists.txt
+index a3eb17a1..65376f55 100644
+--- a/src/config/core/CMakeLists.txt
++++ b/src/config/core/CMakeLists.txt
+@@ -9,7 +9,7 @@ if(NOT WIN32)
+ install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++.pc"
+- DESTINATION "include/pkgconfig")
++ DESTINATION "${LIB_DESTINATION}/pkgconfig")
+ endif()
+
+
+@@ -19,7 +19,8 @@ endif()
+ configure_package_config_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/liblucene++Config.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++Config.cmake"
+- INSTALL_DESTINATION "${LIB_DESTINATION}/cmake")
++ INSTALL_DESTINATION "${LIB_DESTINATION}/cmake/liblucene++"
++ PATH_VARS core_libname PACKAGE_CMAKE_INSTALL_INCLUDEDIR PACKAGE_CMAKE_INSTALL_LIBDIR)
+
+ write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/liblucene++ConfigVersion.cmake
+@@ -30,4 +31,4 @@ install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++Config.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/liblucene++ConfigVersion.cmake"
+- DESTINATION "include/cmake")
++ DESTINATION "${LIB_DESTINATION}/cmake/liblucene++")
+diff --git a/src/config/core/liblucene++Config.cmake.in b/src/config/core/liblucene++Config.cmake.in
+index 89b48a3d..574f8129 100644
+--- a/src/config/core/liblucene++Config.cmake.in
++++ b/src/config/core/liblucene++Config.cmake.in
+@@ -20,8 +20,8 @@ if (NOT DEFINED set_and_check)
+ endif()
+
+
+-set_and_check(liblucene++_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@/@core_libname@")
+-set_and_check(liblucene++_LIBRARY_DIRS "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
+-set(liblucene++_LIBRARIES "@PACKAGE_CMAKE_INSTALL_LIBDIR@/@core_libname@")
++set_and_check(liblucene++_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
++set_and_check(liblucene++_LIBRARY_DIRS "${PACKAGE_PREFIX_DIR}/@PACKAGE_CMAKE_INSTALL_LIBDIR@")
++set(liblucene++_LIBRARIES "@core_libname@")
+
+
diff --git a/community/lucene++/APKBUILD b/community/lucene++/APKBUILD
index 89462ac17c..f9d98fa9ec 100644
--- a/community/lucene++/APKBUILD
+++ b/community/lucene++/APKBUILD
@@ -2,22 +2,27 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=lucene++
pkgver=3.0.8
-pkgrel=1
+pkgrel=2
pkgdesc="C++ port of the popular Java Lucene library"
url="https://github.com/luceneplusplus/LucenePlusPlus"
arch="all"
license="LGPL-3.0-or-later OR Apache-2.0"
depends_dev="boost-dev zlib-dev"
-makedepends="$depends_dev cmake linux-headers"
+makedepends="$depends_dev cmake linux-headers gtest-dev"
subpackages="$pkgname-dev"
-source="$pkgname-$pkgver.tar.gz::https://github.com/luceneplusplus/LucenePlusPlus/archive/rel_3.0.8.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/luceneplusplus/LucenePlusPlus/archive/rel_3.0.8.tar.gz
+ 160.patch
+ 161.patch
+ 162.patch
+ 163.patch
+ "
builddir="$srcdir/LucenePlusPlus-rel_$pkgver"
build() {
cmake -B build . \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DLIB_DESTINATION=/usr/lib \
+ -DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_CXX_FLAGS='-DBOOST_VARIANT_USE_RELAXED_GET_BY_DEFAULT' \
-DCOTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH=/usr/include/fortify
make -C build
@@ -25,6 +30,23 @@ build() {
package() {
make -C build DESTDIR="$pkgdir" install
+
+ # Remove vendored gtest that lucene++'s buildsystem insists on installing
+ # together with it
+ rm -rf "$pkgdir"/usr/include/gmock
+ rm -rf "$pkgdir"/usr/include/gtest
+
+ rm -rf "$pkgdir"/usr/lib/cmake/GTest
+
+ rm -rf "$pkgdir"/usr/lib/libgmock*
+ rm -rf "$pkgdir"/usr/lib/libgtest*
+
+ rm -rf "$pkgdir"/usr/lib/pkgconfig/gmock*
+ rm -rf "$pkgdir"/usr/lib/pkgconfig/gtest*
}
-sha512sums="fdc4ce5d55b05d8a1fa62bf749e2e428b8beec66847524f632b806d10ec7c969ca7d3c556804d2ce4b7cdf05db4f3c5613bde41aae53df9fe574d3046d448bf1 lucene++-3.0.8.tar.gz"
+sha512sums="fdc4ce5d55b05d8a1fa62bf749e2e428b8beec66847524f632b806d10ec7c969ca7d3c556804d2ce4b7cdf05db4f3c5613bde41aae53df9fe574d3046d448bf1 lucene++-3.0.8.tar.gz
+76f8a8b29902f654c247ce025d3682ed828ff962143c333f36fabdaacc19fd94a8316e2f8418f7bd52a896bc7df24bf29209a68addc5521d3113e6c5bd817a95 160.patch
+ca8d2d413a1ceb5387f8f9163503fe29adb746a2b2dba4cf923e7d69365322a2be64a7a69bcc9bdd9988f5632ef02390bd34cb53c2452d7c95ce53ddf9a86b76 161.patch
+79936f34024701c65064eb6043ebddb05a7453fbc4d323487595eb75c9573eb999ae1e9c6b48c55ea4477b52bf24a914218250a8ab8423ba0c22be93ed97aa3f 162.patch
+4332bd418f81675ad17f9e8e91831031100c04f19f676a501e06a69c086e69dbe348b82a89f8d79aba165f0bff29837184902c82d5e0e547de4603c4b27d1ab8 163.patch"