clucene: fixed build

This commit is contained in:
Tim Biermann 2022-11-19 16:58:43 +00:00
parent dd4b5e00e3
commit 5a324dad0a
3 changed files with 57 additions and 7 deletions

View File

@ -1,6 +1,6 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF32YShWD6rWLj/EOArdtePQoAypE47TECPxdq+GTO39iMPBs7s7D6JaGNwBAYMsmZN5AK9qB2DqBbF4HmhCr4Tgg=
SHA256 (Pkgfile) = 007d2dbe76fbd40631572660ba32e394c0d0b6efbe9e7c4acfe21487509d8fb9
RWSagIOpLGJF3/wbJn9ccjvDLDG9ie+S/yMjkQrSK/wH0OrQbiIWuA0ChTyfbgvpRBcUqADiiEA/gl0/m+snvpaH+cZtW4WE9ww=
SHA256 (Pkgfile) = 970a9888b93697afa354c153dc56fd98b81e39b088b19a15d41785491d9c2895
SHA256 (.footprint) = a90f1fa99e0d767eabd4549e23d941298085272b3cb5e0a93f0f2b267befd22f
SHA256 (clucene-core-2.3.3.4.tar.gz) = ddfdc433dd8ad31b5c5819cc4404a8d2127472a3b720d3e744e8c51d79732eab
SHA256 (fix_zlib_detections.diff) = e1a6a58dc344d8d5e3218137a5e7a689900eb6ea4cce1dc426e861706ab78889
@ -13,3 +13,4 @@ SHA256 (clucene-multimap-put.patch) = 917c8bfc1dd3313a716ecacf398dbcaf0aa02ce61b
SHA256 (clucene-2.3.3.4-contribs_lib-1.patch) = a0751acfa848ec96ee5755d970fe0812651650c99e3fd0c8e7a85bc1e9e9677f
SHA256 (cmake.patch) = 5477082c112f41bef7bbe2205aaa86eb5e2f2b92d3eb2c4b46733b1f1a5a7335
SHA256 (contribs-lib-makefile.patch) = f92063b9a1e85754548f8116569128c3ef259544ed371c74cd3692b4bac2ed30
SHA256 (0001-Fix-missing-include-time.h.patch) = 58aef53902d194d07ac956d465d409311e67a04d3e1b1a0d9d8d0a37e5ecdf9c

View File

@ -0,0 +1,49 @@
From c1c2000c35ff39b09cb70fbdf66a107d3b17a674 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Wed, 12 Oct 2022 08:40:49 +0200
Subject: [PATCH] Fix missing #include <time.h>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
At least on recent Fedora 37 beta, building now failed with
> CLucene/document/DateTools.cpp:26:19: error: gmtime was not declared in this scope
> 26 | tm *ptm = gmtime(&secs);
> | ^~~~~~
etc.
As it turns out, after 22f9d40320e3deeaa8d6aaa7a770077c20a21dae "git-svn-id:
https://clucene.svn.sourceforge.net/svnroot/clucene/branches/lucene2_3_2@2672
20ef185c-fe11-0410-a618-ba9304b01011" on 2008-06-26 had commented out
_CL_TIME_WITH_SYS_TIME in clucene-config.h.cmake as "not actually used for
anything", then cceccfb52917b5f4da447f1cf20c135952d41442 "Presenting DateTools
and deprecating DateField. DateTools still requires some testing and its own
unit testing" on 2008-06-29 had introduced this use of it (into then
src/CLucene/document/DateTools.H). And apparently most build environments have
silently been happy ever since when the dead leading check for
_CL_TIME_WITH_SYS_TIME didn't include both <sys/time.h> and <time.h>, but the
following check for _CL_HAVE_SYS_TIME_H only included <sys/time.h> but not
<time.h>.
---
src/shared/CLucene/clucene-config.h.cmake | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/shared/CLucene/clucene-config.h.cmake b/src/shared/CLucene/clucene-config.h.cmake
index bd8683a5..6fe0f92b 100644
--- a/src/shared/CLucene/clucene-config.h.cmake
+++ b/src/shared/CLucene/clucene-config.h.cmake
@@ -100,8 +100,7 @@ ${SYMBOL__T}
//#cmakedefine _CL_STAT_MACROS_BROKEN
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-//not actually used for anything...
-//#cmakedefine _CL_TIME_WITH_SYS_TIME 1
+#cmakedefine _CL_TIME_WITH_SYS_TIME 1
/* Define that we will be using -fvisibility=hidden, and
* make public classes visible using __attribute__ ((visibility("default")))
--
2.37.3

View File

@ -6,15 +6,14 @@
name=clucene
version=2.3.3.4
release=1
release=2
source=(https://downloads.sourceforge.net/project/clucene/clucene-core-unstable/2.3/$name-core-$version.tar.gz
fix_zlib_detections.diff clucene-core-2.3.3.4-install_contribs_lib.patch clucene-narrowing-conversions.patch
clucene-warnings.patch clucene-debug.patch clucene-gcc-atomics.patch clucene-multimap-put.patch
clucene-2.3.3.4-contribs_lib-1.patch cmake.patch contribs-lib-makefile.patch)
clucene-2.3.3.4-contribs_lib-1.patch cmake.patch contribs-lib-makefile.patch
0001-Fix-missing-include-time.h.patch)
build() {
[[ -e /usr/bin/ninja ]] && PKGMK_CLUCENE=' -G Ninja'
patch -Np1 -d $name-core-$version -i $SRC/cmake.patch
patch -Np1 -d $name-core-$version -i $SRC/clucene-2.3.3.4-contribs_lib-1.patch
patch -Np1 -d $name-core-$version -i $SRC/fix_zlib_detections.diff
@ -24,8 +23,9 @@ build() {
patch -Np0 -d $name-core-$version -i $SRC/clucene-debug.patch
patch -Np0 -d $name-core-$version -i $SRC/clucene-narrowing-conversions.patch
patch -Np0 -d $name-core-$version -i $SRC/clucene-multimap-put.patch
patch -Np1 -d $name-core-$version -i $SRC/0001-Fix-missing-include-time.h.patch
cmake -S $name-core-$version -B build $PKGMK_CLUCENE \
cmake -S $name-core-$version -B build -G Ninja $PKGMK_CLUCENE \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \