about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/xapian
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/xapian')
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix21
3 files changed, 95 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/xapian/default.nix b/nixpkgs/pkgs/development/libraries/xapian/default.nix
new file mode 100644
index 000000000000..ef50bf31a367
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xapian/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, autoreconfHook
+, libuuid, zlib }:
+
+let
+  generic = version: sha256: stdenv.mkDerivation {
+    pname = "xapian";
+    inherit version;
+    passthru = { inherit version; };
+
+    src = fetchurl {
+      url = "https://oligarchy.co.uk/xapian/${version}/xapian-core-${version}.tar.xz";
+      inherit sha256;
+    };
+
+    outputs = [ "out" "man" "doc" ];
+
+    buildInputs = [ libuuid zlib ];
+    nativeBuildInputs = [ autoreconfHook ];
+
+    doCheck = true;
+
+    patches = stdenv.lib.optionals stdenv.isDarwin [ ./skip-flaky-darwin-test.patch ];
+
+    # the configure script thinks that Darwin has ___exp10
+    # but it’s not available on my systems (or hydra apparently)
+    postConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+      substituteInPlace config.h \
+        --replace "#define HAVE___EXP10 1" "#undef HAVE___EXP10"
+    '';
+
+    meta = with stdenv.lib; {
+      description = "Search engine library";
+      homepage = "https://xapian.org/";
+      license = licenses.gpl2Plus;
+      maintainers = with maintainers; [ ];
+      platforms = platforms.unix;
+    };
+  };
+in {
+  xapian_1_4 = generic "1.4.15" "1sjhz6vgql801rdgl6vrsjj0vy1mwlkcxjx6nr7h27m031cyjs5i";
+}
diff --git a/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch b/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch
new file mode 100644
index 000000000000..d763a2a2b434
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch
@@ -0,0 +1,33 @@
+diff -Naur xapian-core.old/tests/api_db.cc xapian-core.new/tests/api_db.cc
+--- xapian-core.old/tests/api_db.cc
++++ xapian-core.new/tests/api_db.cc
+@@ -1020,6 +1020,7 @@
+ 
+ // test for keepalives
+ DEFINE_TESTCASE(keepalive1, remote) {
++    SKIP_TEST("Fails in darwin nix build environment");
+     Xapian::Database db(get_remote_database("apitest_simpledata", 5000));
+ 
+     /* Test that keep-alives work */
+diff -Naur xapian-core.old/tests/api_scalability.cc xapian-core.new/tests/api_scalability.cc
+--- xapian-core.old/tests/api_scalability.cc
++++ xapian-core.new/tests/api_scalability.cc
+@@ -53,6 +53,7 @@
+ }
+ 
+ DEFINE_TESTCASE(bigoaddvalue1, writable) {
++    SKIP_TEST("Fails in darwin nix build environment");
+     // O(n*n) is bad, but O(n*log(n)) is acceptable.
+     test_scalability(bigoaddvalue1_helper, 5000, O_N_LOG_N);
+     return true;
+diff -Naur xapian-core.old/tests/api_serialise.cc xapian-core.new/tests/api_serialise.cc
+--- xapian-core.old/tests/api_serialise.cc
++++ xapian-core.new/tests/api_serialise.cc
+@@ -110,6 +110,7 @@
+ 
+ // Test for serialising a document obtained from a database.
+ DEFINE_TESTCASE(serialise_document2, writable) {
++    SKIP_TEST("Fails in darwin nix build environment");
+     Xapian::Document origdoc;
+     origdoc.add_term("foo", 2);
+     origdoc.add_posting("foo", 10);
diff --git a/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix b/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix
new file mode 100644
index 000000000000..6c8eda6358b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pkgconfig, xapian, perl, pcre, zlib, libmagic }:
+
+stdenv.mkDerivation rec {
+  pname = "xapian-omega";
+  inherit (xapian) version;
+
+  src = fetchurl {
+    url = "https://oligarchy.co.uk/xapian/${version}/xapian-omega-${version}.tar.xz";
+    sha256 = "0zji8ckp4h5xdy2wbir3lvk680w1g1l4h5swmaxsx7ah12lkrjcr";
+  };
+
+  buildInputs = [ xapian perl pcre zlib libmagic ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "Indexer and CGI search front-end built on Xapian library";
+    homepage = https://xapian.org/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}