2021-02-05 17:12:51 +00:00
|
|
|
{ lib, fetchFromGitHub, gtk3, pythonPackages, intltool, gexiv2,
|
2020-04-24 23:36:52 +00:00
|
|
|
pango, gobject-introspection, wrapGAppsHook, gettext,
|
|
|
|
# Optional packages:
|
|
|
|
enableOSM ? true, osm-gps-map,
|
|
|
|
enableGraphviz ? true, graphviz,
|
|
|
|
enableGhostscript ? true, ghostscript
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pythonPackages) python buildPythonApplication;
|
|
|
|
in buildPythonApplication rec {
|
2021-08-05 21:33:18 +00:00
|
|
|
version = "5.1.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gramps";
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook intltool gettext ];
|
|
|
|
buildInputs = [ gtk3 gobject-introspection pango gexiv2 ]
|
2020-04-24 23:36:52 +00:00
|
|
|
# Map support
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional enableOSM osm-gps-map
|
2020-04-24 23:36:52 +00:00
|
|
|
# Graphviz support
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional enableGraphviz graphviz
|
2020-04-24 23:36:52 +00:00
|
|
|
# Ghostscript support
|
2021-01-15 22:18:51 +00:00
|
|
|
++ lib.optional enableGhostscript ghostscript
|
2020-04-24 23:36:52 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gramps-project";
|
|
|
|
repo = "gramps";
|
|
|
|
rev = "v${version}";
|
2021-08-05 21:33:18 +00:00
|
|
|
sha256 = "00358nzyw686ypqv45imc5k9frcqnhla0hpx9ynna3iy6iz5006x";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
pythonPath = with pythonPackages; [ bsddb3 PyICU pygobject3 pycairo ];
|
|
|
|
|
|
|
|
# Same installPhase as in buildPythonApplication but without --old-and-unmanageble
|
|
|
|
# install flag.
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p "$out/lib/${python.libPrefix}/site-packages"
|
|
|
|
|
|
|
|
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
|
|
|
|
|
|
|
${python}/bin/${python.executable} setup.py install \
|
|
|
|
--install-lib=$out/lib/${python.libPrefix}/site-packages \
|
|
|
|
--prefix="$out"
|
|
|
|
|
|
|
|
eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth
|
|
|
|
if [ -e "$eapth" ]; then
|
|
|
|
# move colliding easy_install.pth to specifically named one
|
|
|
|
mv "$eapth" $(dirname "$eapth")/${pname}-${version}.pth
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Genealogy software";
|
|
|
|
homepage = "https://gramps-project.org";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|