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