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