about summary refs log tree commit diff
path: root/pkgs/servers/search
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2023-11-25 04:20:00 +0000
committerMario Rodas <marsam@users.noreply.github.com>2023-11-25 04:20:00 +0000
commit76bfb735286b0fa4d6ada23f919276d73766260f (patch)
treeccd1ac31c14cfc7486f2ff3d13615740884d2885 /pkgs/servers/search
parenta6ef1c48d9cf1ba1049bf17f5734e21a97c3273b (diff)
downloadnixlib-76bfb735286b0fa4d6ada23f919276d73766260f.tar
nixlib-76bfb735286b0fa4d6ada23f919276d73766260f.tar.gz
nixlib-76bfb735286b0fa4d6ada23f919276d73766260f.tar.bz2
nixlib-76bfb735286b0fa4d6ada23f919276d73766260f.tar.lz
nixlib-76bfb735286b0fa4d6ada23f919276d73766260f.tar.xz
nixlib-76bfb735286b0fa4d6ada23f919276d73766260f.tar.zst
nixlib-76bfb735286b0fa4d6ada23f919276d73766260f.zip
groonga: 12.0.7 -> 13.0.9
Diffstat (limited to 'pkgs/servers/search')
-rw-r--r--pkgs/servers/search/groonga/default.nix72
-rw-r--r--pkgs/servers/search/groonga/do-not-use-vendored-libraries.patch15
-rw-r--r--pkgs/servers/search/groonga/fix-cmake-install-path.patch21
3 files changed, 78 insertions, 30 deletions
diff --git a/pkgs/servers/search/groonga/default.nix b/pkgs/servers/search/groonga/default.nix
index fbf9f06cff72..49cc74bafc2a 100644
--- a/pkgs/servers/search/groonga/default.nix
+++ b/pkgs/servers/search/groonga/default.nix
@@ -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.
     '';
   };
-
-}
+})
diff --git a/pkgs/servers/search/groonga/do-not-use-vendored-libraries.patch b/pkgs/servers/search/groonga/do-not-use-vendored-libraries.patch
new file mode 100644
index 000000000000..8729031f14cb
--- /dev/null
+++ b/pkgs/servers/search/groonga/do-not-use-vendored-libraries.patch
@@ -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()
diff --git a/pkgs/servers/search/groonga/fix-cmake-install-path.patch b/pkgs/servers/search/groonga/fix-cmake-install-path.patch
new file mode 100644
index 000000000000..5b00cd42404c
--- /dev/null
+++ b/pkgs/servers/search/groonga/fix-cmake-install-path.patch
@@ -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}")