push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,103 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
cmake,
boost,
zlib,
}:
stdenv.mkDerivation rec {
pname = "clucene-core";
version = "2.3.3.4";
src = fetchurl {
url = "mirror://sourceforge/clucene/clucene-core-${version}.tar.gz";
sha256 = "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx";
};
nativeBuildInputs = [ cmake ];
buildInputs = [
boost
zlib
];
cmakeFlags = [
"-DBUILD_CONTRIBS=ON"
"-DBUILD_CONTRIBS_LIB=ON"
"-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
]
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"-D_CL_HAVE_GCC_ATOMIC_FUNCTIONS=0"
"-D_CL_HAVE_NAMESPACES_EXITCODE=0"
"-D_CL_HAVE_NAMESPACES_EXITCODE__TRYRUN_OUTPUT="
"-D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE=0"
"-D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE__TRYRUN_OUTPUT="
"-D_CL_HAVE_TRY_BLOCKS_EXITCODE=0"
"-D_CL_HAVE_TRY_BLOCKS_EXITCODE__TRYRUN_OUTPUT="
"-D_CL_HAVE_PTHREAD_MUTEX_RECURSIVE=0"
"-DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE=0"
"-DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE__TRYRUN_OUTPUT="
];
patches = [
# From debian
./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
./Install-contribs-lib.patch
# From arch
./fix-missing-include-time.patch
# required for darwin and linux-musl
./pthread-include.patch
# cmake 4 support
(fetchpatch {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-cpp/clucene/files/clucene-2.3.3.4-cmake4.patch?id=e06df280c75b0f0803954338466e5278d777f984";
hash = "sha256-e0u6J91bnuy24hIrSl+Ap5Xwds/nzzGiWpzskwaGx9o=";
})
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
./fix-darwin.patch
# see https://bugs.gentoo.org/869170
(fetchpatch {
url = "https://869170.bugs.gentoo.org/attachment.cgi?id=858825";
hash = "sha256-TbAfBKdXh+1HepZc8J6OhK1XGwhwBCMvO8QBDsad998=";
})
];
# see https://github.com/macports/macports-ports/commit/236d43f2450c6be52dc42fd3a2bbabbaa5136201
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace src/shared/CMakeLists.txt --replace 'fstati64;_fstati64;fstat64;fstat;_fstat' 'fstat;_fstat'
substituteInPlace src/shared/CMakeLists.txt --replace 'stati64;_stati64;stat64;stat;_stat' 'stat;_stat'
'';
# fails with "Unable to find executable:
# /build/clucene-core-2.3.3.4/build/bin/cl_test"
doCheck = false;
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
meta = with lib; {
description = "Core library for full-featured text search engine";
longDescription = ''
CLucene is a high-performance, scalable, cross platform, full-featured,
open-source indexing and searching API. Specifically, CLucene is the guts
of a search engine, the hard stuff. You write the easy stuff: the UI and
the process of selecting and parsing your data files to pump them into
the search engine yourself, and any specialized queries to pull it back
for display or further processing.
CLucene is a port of the very popular Java Lucene text search engine API.
'';
homepage = "https://clucene.sourceforge.net";
platforms = platforms.unix;
license = with licenses; [
asl20
lgpl2
];
};
}

View File

@@ -0,0 +1,19 @@
From 7be4a19b76d98260cf95040a47935f854a4ba7a4 Mon Sep 17 00:00:00 2001
From: Valentin Rusu <kde@rusu.info>
Date: Sat, 17 Dec 2011 13:47:58 +0100
Subject: [PATCH] Fix .pc file by adding clucene-shared library
---
src/core/libclucene-core.pc.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/core/libclucene-core.pc.cmake
+++ b/src/core/libclucene-core.pc.cmake
@@ -6,6 +6,6 @@ includedir=${prefix}/include:${prefix}/i
Name: libclucene
Description: CLucene - a C++ search engine, ported from the popular Apache Lucene
Version: @CLUCENE_VERSION_MAJOR@.@CLUCENE_VERSION_MINOR@.@CLUCENE_VERSION_REVISION@.@CLUCENE_VERSION_PATCH@
-Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core
+Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core -lclucene-shared
Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext
~

View File

@@ -0,0 +1,20 @@
From 772481ca94071ddfe65102a451926e4f9aeb4d2c Mon Sep 17 00:00:00 2001
From: Veit Jahns <idolum@users.sourceforge.net>
Date: Thu, 26 May 2011 13:35:28 +0200
Subject: [PATCH] Fixing ZLIB configuration in shared's CMakeLists
---
src/shared/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/shared/CMakeLists.txt
+++ b/src/shared/CMakeLists.txt
@@ -42,7 +42,7 @@ INCLUDE (CheckAtomicFunctions)
find_package(ZLIB)
IF ( ZLIB_FOUND )
SET ( EXTRA_LIBS ${EXTRA_LIBS} ${ZLIB_LIBRARY} )
-ELSEIF ( ZLIB_FOUND )
+ELSE ( ZLIB_FOUND )
MESSAGE( "ZLIB not found, using local: ${clucene-ext_SOURCE_DIR}/zlib" )
SET(ZLIB_INCLUDE_DIR ${clucene-ext_SOURCE_DIR}/zlib )
SET(ZLIB_LIBRARY ${clucene-ext_BINARY_DIR})

View File

@@ -0,0 +1,49 @@
Description: contribs-lib is not built and installed even with config
Author: Vitaliy Filippov
Bug: https://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
---
CMakeLists.txt | 2 +-
src/contribs-lib/CMakeLists.txt | 17 +++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,7 +163,7 @@ IF ( BUILD_CONTRIBS )
SET(BUILD_CONTRIBS_LIB 1)
ENDIF ( BUILD_CONTRIBS )
IF ( BUILD_CONTRIBS_LIB )
- ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL)
+ ADD_SUBDIRECTORY (src/contribs-lib)
ENDIF ( BUILD_CONTRIBS_LIB )
--- a/src/contribs-lib/CMakeLists.txt
+++ b/src/contribs-lib/CMakeLists.txt
@@ -106,9 +106,26 @@ add_library(clucene-contribs-lib SHARED
)
TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extra_libs})
+#install public headers.
+FOREACH(file ${HEADERS})
+ get_filename_component(apath ${file} PATH)
+ get_filename_component(aname ${file} NAME)
+ file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath})
+ IF ( NOT aname MATCHES "^_.*" )
+ install(FILES ${file}
+ DESTINATION include/${relpath}
+ COMPONENT development)
+ ENDIF ( NOT aname MATCHES "^_.*" )
+ENDFOREACH(file)
+
#set properties on the libraries
SET_TARGET_PROPERTIES(clucene-contribs-lib PROPERTIES
VERSION ${CLUCENE_VERSION}
SOVERSION ${CLUCENE_SOVERSION}
COMPILE_DEFINITIONS_DEBUG _DEBUG
)
+
+#and install library
+install(TARGETS clucene-contribs-lib
+ DESTINATION ${LIB_DESTINATION}
+ COMPONENT runtime )

View File

@@ -0,0 +1,62 @@
--- a/src/shared/CLucene/config/repl_tchar.h
+++ b/src/shared/CLucene/config/repl_tchar.h
@@ -28,26 +28,26 @@
#define _istdigit iswdigit //* digit char check
#define _totlower towlower //* convert char to lower case
#define _totupper towupper //* convert char to lower case
- #define _tcslwr wcslwr //* convert string to lower case
+ #define _tcslwr std::wcslwr //* convert string to lower case
//these are the string handling functions
//we may need to create wide-character/multi-byte replacements for these
- #define _tcscpy wcscpy //copy a string to another string
- #define _tcsncpy wcsncpy //copy a specified amount of one string to another string.
- #define _tcscat wcscat //copy a string onto the end of the other string
- #define _tcsncat wcsncat
- #define _tcschr wcschr //find location of one character
- #define _tcsstr wcsstr //find location of a string
- #define _tcslen wcslen //get length of a string
- #define _tcscmp wcscmp //case sensitive compare two strings
- #define _tcsncmp wcsncmp //case sensitive compare two strings
- #define _tcscspn wcscspn //location of any of a set of character in a string
+ #define _tcscpy std::wcscpy //copy a string to another string
+ #define _tcsncpy std::wcsncpy //copy a specified amount of one string to another string.
+ #define _tcscat std::wcscat //copy a string onto the end of the other string
+ #define _tcsncat std::wcsncat
+ #define _tcschr std::wcschr //find location of one character
+ #define _tcsstr std::wcsstr //find location of a string
+ #define _tcslen std::wcslen //get length of a string
+ #define _tcscmp std::wcscmp //case sensitive compare two strings
+ #define _tcsncmp std::wcsncmp //case sensitive compare two strings
+ #define _tcscspn std::wcscspn //location of any of a set of character in a string
//string compare
#ifdef _CL_HAVE_FUNCTION_WCSICMP
- #define _tcsicmp wcsicmp //* case insensitive compare two string
+ #define _tcsicmp std::wcsicmp //* case insensitive compare two string
#else
- #define _tcsicmp wcscasecmp //* case insensitive compare two string
+ #define _tcsicmp std::wcscasecmp //* case insensitive compare two string
#endif
#if defined(_CL_HAVE_FUNCTION_WCSDUP)
#define _tcsdup wcsdup
@@ -56,8 +56,8 @@
#endif
//conversion functions
- #define _tcstod wcstod //convert a string to a double
- #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
+ #define _tcstod std::wcstod //convert a string to a double
+ #define _tcstoi64 std::wcstoll //* convers a string to an 64bit bit integer
#define _itot _i64tot
#define _i64tot lltow //* converts a 64 bit integer to a string (with base)
#else //if defined(_ASCII)
@@ -105,7 +105,7 @@
//some tchar headers miss these...
#ifndef _tcstoi64
#if defined(_UCS2)
- #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
+ #define _tcstoi64 std::wcstoll //* convers a string to an 64bit bit integer
#else
#define _tcstoi64 strtoll
#endif

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

@@ -0,0 +1,14 @@
--- a/src/shared/CLucene/LuceneThreads.h
+++ b/src/shared/CLucene/LuceneThreads.h
@@ -7,6 +7,9 @@
#ifndef _LuceneThreads_h
#define _LuceneThreads_h
+#if defined(_CL_HAVE_PTHREAD)
+ #include <pthread.h>
+#endif
CL_NS_DEF(util)
class CLuceneThreadIdCompare;