2021-01-25 08:26:54 +00:00
|
|
|
{ lib, fetchFromGitHub, gtk3, pythonPackages, intltool, gexiv2,
|
2019-04-05 10:28:06 +01:00
|
|
|
pango, gobject-introspection, wrapGAppsHook, gettext,
|
2017-10-07 19:37:09 +01:00
|
|
|
# Optional packages:
|
2021-12-27 22:48:28 +00:00
|
|
|
enableOSM ? true, osm-gps-map, glib-networking,
|
2018-10-07 17:37:59 +01:00
|
|
|
enableGraphviz ? true, graphviz,
|
|
|
|
enableGhostscript ? true, ghostscript
|
2017-10-07 19:37:09 +01:00
|
|
|
}:
|
2014-11-23 03:24:00 +00:00
|
|
|
|
2016-08-14 12:52:23 +01:00
|
|
|
let
|
|
|
|
inherit (pythonPackages) python buildPythonApplication;
|
|
|
|
in buildPythonApplication rec {
|
2021-07-27 04:03:42 +01:00
|
|
|
version = "5.1.4";
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gramps";
|
2014-11-23 03:24:00 +00:00
|
|
|
|
2021-01-03 13:34:37 +00:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook intltool gettext ];
|
|
|
|
buildInputs = [ gtk3 gobject-introspection pango gexiv2 ]
|
2017-10-07 19:37:09 +01:00
|
|
|
# Map support
|
2021-12-27 22:48:28 +00:00
|
|
|
++ lib.optionals enableOSM [ osm-gps-map glib-networking ]
|
2018-10-07 17:37:59 +01:00
|
|
|
# Graphviz support
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optional enableGraphviz graphviz
|
2018-10-07 17:37:59 +01:00
|
|
|
# Ghostscript support
|
2021-01-15 05:42:41 +00:00
|
|
|
++ lib.optional enableGhostscript ghostscript
|
2017-10-07 19:37:09 +01:00
|
|
|
;
|
2014-11-23 03:24:00 +00:00
|
|
|
|
2017-10-07 19:37:09 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gramps-project";
|
|
|
|
repo = "gramps";
|
|
|
|
rev = "v${version}";
|
2021-07-27 04:03:42 +01:00
|
|
|
sha256 = "00358nzyw686ypqv45imc5k9frcqnhla0hpx9ynna3iy6iz5006x";
|
2014-11-23 03:24:00 +00:00
|
|
|
};
|
|
|
|
|
2018-04-05 15:48:48 +01:00
|
|
|
pythonPath = with pythonPackages; [ bsddb3 PyICU pygobject3 pycairo ];
|
2014-11-23 03:24:00 +00:00
|
|
|
|
2016-02-19 12:12:11 +00:00
|
|
|
# Same installPhase as in buildPythonApplication but without --old-and-unmanageble
|
2014-11-23 03:24:00 +00:00
|
|
|
# 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
|
2019-08-15 13:41:18 +01:00
|
|
|
mv "$eapth" $(dirname "$eapth")/${pname}-${version}.pth
|
2014-11-23 03:24:00 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-02-24 19:21:11 +00:00
|
|
|
# https://github.com/NixOS/nixpkgs/issues/149812
|
|
|
|
# https://nixos.org/manual/nixpkgs/stable/#ssec-gnome-hooks-gobject-introspection
|
|
|
|
strictDeps = false;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-11-23 03:24:00 +00:00
|
|
|
description = "Genealogy software";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://gramps-project.org";
|
2014-11-23 16:49:38 +00:00
|
|
|
license = licenses.gpl2;
|
2014-11-23 03:24:00 +00:00
|
|
|
};
|
|
|
|
}
|