2024-02-07 01:22:34 +00:00
|
|
|
{ lib
|
|
|
|
, fetchpatch
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gtk3
|
|
|
|
, pythonPackages
|
|
|
|
, glibcLocales
|
|
|
|
, intltool
|
|
|
|
, gexiv2
|
|
|
|
, pango
|
|
|
|
, gobject-introspection
|
|
|
|
, wrapGAppsHook
|
|
|
|
, gettext
|
|
|
|
, # Optional packages:
|
|
|
|
enableOSM ? true
|
|
|
|
, osm-gps-map
|
|
|
|
, glib-networking
|
|
|
|
, enableGraphviz ? true
|
|
|
|
, graphviz
|
|
|
|
, enableGhostscript ? true
|
|
|
|
, ghostscript
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pythonPackages) python buildPythonApplication;
|
2024-02-07 01:22:34 +00:00
|
|
|
in
|
|
|
|
buildPythonApplication rec {
|
|
|
|
version = "5.1.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gramps";
|
2024-02-07 01:22:34 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
wrapGAppsHook
|
|
|
|
intltool
|
|
|
|
gettext
|
|
|
|
gobject-introspection
|
|
|
|
pythonPackages.setuptools
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
glibcLocales
|
|
|
|
pythonPackages.jsonschema
|
|
|
|
pythonPackages.mock
|
|
|
|
pythonPackages.lxml
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
buildInputs = [ gtk3 pango gexiv2 ]
|
2020-04-24 23:36:52 +00:00
|
|
|
# Map support
|
2021-12-30 13:39:12 +00:00
|
|
|
++ lib.optionals enableOSM [ osm-gps-map glib-networking ]
|
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}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-BerkDXdFYfZ3rV5AeMo/uk53IN2U5z4GFs757Ar26v0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
pythonPath = with pythonPackages; [
|
|
|
|
bsddb3
|
|
|
|
pyicu
|
|
|
|
pygobject3
|
|
|
|
pycairo
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# fix for running tests with a temporary home - remove next release
|
|
|
|
# https://gramps-project.org/bugs/view.php?id=12577
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gramps-project/gramps/commit/1e95d8a6b5193d655d8caec1e6ab13628ad123db.patch";
|
|
|
|
hash = "sha256-2riWB13Yl+tk9+Tuo0YDLoxY2Rc0xrJKfb+ZU7Puzxk=";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Same installPhase as in buildPythonApplication but without --old-and-unmanageble
|
|
|
|
# install flag.
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
mkdir -p "$out/${python.sitePackages}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
${python}/bin/${python.executable} setup.py install \
|
2024-02-07 01:22:34 +00:00
|
|
|
--install-lib=$out/${python.sitePackages} \
|
2020-04-24 23:36:52 +00:00
|
|
|
--prefix="$out"
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
eapth="$out/${python.sitePackages}/easy-install.pth"
|
2020-04-24 23:36:52 +00:00
|
|
|
if [ -e "$eapth" ]; then
|
|
|
|
# move colliding easy_install.pth to specifically named one
|
|
|
|
mv "$eapth" $(dirname "$eapth")/${pname}-${version}.pth
|
|
|
|
fi
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
rm -f "$out/${python.sitePackages}"/site.py*
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
# https://github.com/NixOS/nixpkgs/issues/149812
|
|
|
|
# https://nixos.org/manual/nixpkgs/stable/#ssec-gnome-hooks-gobject-introspection
|
|
|
|
strictDeps = false;
|
|
|
|
|
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";
|
2024-02-07 01:22:34 +00:00
|
|
|
maintainers = with maintainers; [ jk pinpox ];
|
|
|
|
changelog = "https://github.com/gramps-project/gramps/blob/v${version}/ChangeLog";
|
|
|
|
longDescription = ''
|
|
|
|
Every person has their own story but they are also part of a collective
|
|
|
|
family history. Gramps gives you the ability to record the many details of
|
|
|
|
an individual's life as well as the complex relationships between various
|
|
|
|
people, places and events. All of your research is kept organized,
|
|
|
|
searchable and as precise as you need it to be.
|
|
|
|
'';
|
|
|
|
license = licenses.gpl2Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|