groonga: 12.0.7 -> 13.0.9

This commit is contained in:
Mario Rodas 2023-11-25 04:20:00 +00:00
parent a6ef1c48d9
commit 76bfb73528
3 changed files with 78 additions and 30 deletions

View file

@ -1,54 +1,66 @@
{ lib, stdenv, fetchurl, autoreconfHook, mecab, kytea, libedit, pkg-config, libxcrypt
{ lib, stdenv, cmake, fetchurl, kytea, mecab, pkg-config, rapidjson, testers, xxHash, zstd, postgresqlPackages
, suggestSupport ? false, zeromq, libevent, msgpack, openssl
, lz4Support ? false, lz4
, zlibSupport ? true, zlib
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "groonga";
version = "12.0.7";
version = "13.0.9";
src = fetchurl {
url = "https://packages.groonga.org/source/groonga/${pname}-${version}.tar.gz";
sha256 = "sha256-Eaei4Zi0Rg9zu7DInLAcaRo8Fyu2mqBblcYNRaS46c8=";
url = "https://packages.groonga.org/source/groonga/groonga-${finalAttrs.version}.tar.gz";
hash = "sha256-ZmeOYwrd1Xvwqq565zOtcDv6heOLVVaF04M1jEtjDO8=";
};
preConfigure = ''
# To avoid problems due to libc++abi 11 using `#include <version>`.
rm version
'';
patches = [
./fix-cmake-install-path.patch
./do-not-use-vendored-libraries.patch
];
buildInputs = with lib;
[ mecab kytea libedit openssl libxcrypt ]
++ optional lz4Support lz4
++ optional zlibSupport zlib
++ optionals suggestSupport [ zeromq libevent msgpack ];
nativeBuildInputs = [
cmake
pkg-config
];
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [
rapidjson
xxHash
zstd
mecab
kytea
] ++ lib.optionals lz4Support [
lz4
] ++ lib.optional zlibSupport [
zlib
] ++ lib.optionals suggestSupport [
zeromq
libevent
msgpack
];
configureFlags = with lib;
optional zlibSupport "--with-zlib"
++ optional lz4Support "--with-lz4";
env.NIX_CFLAGS_COMPILE = lib.optionalString zlibSupport "-I${zlib.dev}/include";
env = lib.optionalAttrs stdenv.cc.isClang {
# Prevent warning about using a GNU extension from being promoted to an error.
NIX_CFLAGS_COMPILE = "-Wno-error=gnu-folding-constant";
passthru.tests = {
inherit (postgresqlPackages) pgroonga;
version = testers.testVersion {
package = finalAttrs.finalPackage;
};
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
moduleNames = [ "groonga" ];
};
};
doInstallCheck = true;
installCheckPhase = "$out/bin/groonga --version";
meta = with lib; {
homepage = "https://groonga.org/";
homepage = "https://groonga.org/";
description = "An open-source fulltext search engine and column store";
license = licenses.lgpl21;
license = licenses.lgpl21;
maintainers = [ maintainers.ericsagnes ];
platforms = platforms.unix;
platforms = platforms.all;
longDescription = ''
Groonga is an open-source fulltext search engine and column store.
It lets you write high-performance applications that requires fulltext search.
'';
};
}
})

View file

@ -0,0 +1,15 @@
Do not use vendored libraries
--- a/vendor/CMakeLists.txt
+++ b/vendor/CMakeLists.txt
@@ -14,10 +14,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
add_subdirectory(onigmo)
-add_subdirectory(mruby)
-add_subdirectory(mecab)
-add_subdirectory(message_pack)
if(GRN_WITH_MRUBY)
add_subdirectory(groonga-log)
endif()

View file

@ -0,0 +1,21 @@
Fix CMake install path
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1141,11 +1141,11 @@
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "\${prefix}")
-set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
-set(sbindir "\${exec_prefix}/${CMAKE_INSTALL_SBINDIR}")
-set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
-set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
-set(datarootdir "\${prefix}/${CMAKE_INSTALL_DATAROOTDIR}")
+set(bindir "${CMAKE_INSTALL_FULL_BINDIR}")
+set(sbindir "${CMAKE_INSTALL_FULL_SBINDIR}")
+set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
+set(datarootdir "${CMAKE_INSTALL_FULL_DATAROOTDIR}")
set(datadir "\${datarootdir}")
set(expanded_pluginsdir "${GRN_PLUGINS_DIR}")
set(GRN_EXPANDED_DEFAULT_DOCUMENT_ROOT "${GRN_DEFAULT_DOCUMENT_ROOT}")