1{ lib, buildPythonPackage, fetchurl, python
2, sphinx
3, xapian
4}:
5
6let
7 pythonSuffix = lib.optionalString python.isPy3k "3";
8in
9buildPythonPackage rec {
10 pname = "xapian";
11 inherit (xapian) version;
12 format = "other";
13
14 src = fetchurl {
15 url = "https://oligarchy.co.uk/xapian/${version}/xapian-bindings-${version}.tar.xz";
16 hash = "sha256-UT1XhIgnkZis4TrUl1ENKyIgTV15S2QUPQW3vpdOts8=";
17 };
18
19 configureFlags = [
20 "--with-python${pythonSuffix}"
21 "PYTHON${pythonSuffix}_LIB=${placeholder "out"}/${python.sitePackages}"
22 ];
23
24 preConfigure = ''
25 export XAPIAN_CONFIG=${xapian}/bin/xapian-config
26 '';
27
28 buildInputs = [ sphinx xapian ];
29
30 doCheck = true;
31
32 checkPhase = ''
33 ${python.interpreter} python${pythonSuffix}/pythontest.py
34 '';
35
36 meta = with lib; {
37 description = "Python Bindings for Xapian";
38 homepage = "https://xapian.org/";
39 changelog = "https://xapian.org/docs/xapian-bindings-${version}/NEWS";
40 license = licenses.gpl2Plus;
41 maintainers = with maintainers; [ jonringer ];
42 };
43}