Unverified Commit b4d76b8d authored by Mario Rodas's avatar Mario Rodas Committed by GitHub
Browse files

Merge pull request #270032 from marsam/update-groonga

groonga: 12.0.7 -> 13.0.9
parents deb11327 76bfb735
Loading
Loading
Loading
Loading
+42 −30
Original line number Diff line number Diff line
{ 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/";
    description = "An open-source fulltext search engine and column store";
    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.
    '';
  };

}
})
+15 −0
Original line number Diff line number Diff line
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()
+21 −0
Original line number Diff line number Diff line
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}")