2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-11-15 13:44:38 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, notmuch
|
|
|
|
, python
|
|
|
|
, cffi
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage {
|
|
|
|
pname = "notmuch2";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-11-15 13:44:38 +00:00
|
|
|
inherit (notmuch) version src;
|
|
|
|
|
2021-08-06 21:57:35 +00:00
|
|
|
sourceRoot = "notmuch-${notmuch.version}/bindings/python-cffi";
|
2020-11-15 13:44:38 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cffi
|
|
|
|
];
|
|
|
|
buildInputs = [
|
2023-11-16 04:20:00 +00:00
|
|
|
python notmuch
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
2020-11-15 13:44:38 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = [ cffi ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
# since notmuch 0.35, this package expects _notmuch_config.py that is
|
2023-10-09 19:29:22 +00:00
|
|
|
# generated by notmuch's configure script. We write one which references our
|
|
|
|
# built libraries.
|
2022-03-30 09:31:56 +00:00
|
|
|
postPatch = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
cat > _notmuch_config.py << EOF
|
|
|
|
import os
|
|
|
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
NOTMUCH_VERSION_FILE=os.path.join(dir_path, '../../version.txt')
|
|
|
|
NOTMUCH_INCLUDE_DIR='${notmuch.out}/lib'
|
|
|
|
NOTMUCH_LIB_DIR='${notmuch.out}/lib'
|
|
|
|
EOF
|
2022-03-30 09:31:56 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
# no tests
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "notmuch2" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-11-15 13:44:38 +00:00
|
|
|
description = "Pythonic bindings for the notmuch mail database using CFFI";
|
|
|
|
homepage = "https://notmuchmail.org/";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ teto ];
|
|
|
|
};
|
|
|
|
}
|