projects/guix·blob python-team · refs

173 lines · 6.9 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Guillaume Le Vaillant <[email protected]>
3;;; Copyright © 2020, 2021 Tobias Geerinckx-Rice <[email protected]>
4;;; Copyright © 2026 Sharlatan Hellseher <[email protected]>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages genealogy)
22 #:use-module ((guix licenses) #:prefix license:)
23 #:use-module (guix build-system glib-or-gtk)
24 #:use-module (guix build-system pyproject)
25 #:use-module (guix gexp)
26 #:use-module (guix git-download)
27 #:use-module (guix packages)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages bash)
30 #:use-module (gnu packages check)
31 #:use-module (gnu packages fonts)
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages geo)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages ghostscript)
36 #:use-module (gnu packages glib)
37 #:use-module (gnu packages gnome)
38 #:use-module (gnu packages graphviz)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages iso-codes)
41 #:use-module (gnu packages python)
42 #:use-module (gnu packages python-build)
43 #:use-module (gnu packages python-xyz)
44 #:use-module (gnu packages sqlite)
45 #:use-module (gnu packages version-control)
46 #:use-module (gnu packages xml))
47
48(define-public gramps
49 (package
50 (name "gramps")
51 (version "6.0.8")
52 (source
53 (origin
54 (method git-fetch)
55 (uri (git-reference
56 (url "https://github.com/gramps-project/gramps")
57 (commit (string-append "v" version))))
58 (file-name (git-file-name name version))
59 (sha256
60 (base32 "06kdcf6h9rqdcsx097a3n2z4q8yvln20ja7ajwrna1i133591bra"))))
61 (build-system pyproject-build-system)
62 (arguments
63 (list
64 #:imported-modules (append %glib-or-gtk-build-system-modules
65 %pyproject-build-system-modules)
66 #:modules
67 `((ice-9 match)
68 (srfi srfi-1)
69 (guix build pyproject-build-system)
70 ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
71 (guix build utils))
72 ;; tests: 32408 passed, 44 skipped, 9 deselected, 1 warning, 65730 subtests passed
73 #:test-flags
74 ;; Tests failing during collection.
75 #~(list "--ignore=gramps/gen/merge/test/merge_ref_test.py"
76 "--ignore=po/test/po_test.py"
77 "--ignore=test/LosHawlos_db_test.py"
78 "--ignore=test/blob_to_json_test.py"
79 ;; Assertions are not equal for these tests.
80 #$@(map (lambda (ls) (string-append "--deselect=gramps/"
81 (string-join ls "::")))
82 '(("gen/proxy/test/proxies_test.py"
83 "LivingProxyTest" "test_person_count")
84 ("gen/proxy/test/proxies_test.py"
85 "LivingPrivateProxyTest" "test_person_count")
86 ("plugins/test/reports_test.py"
87 "TestDynamic" "test_export_gedcom")
88 ("plugins/test/reports_test.py"
89 "TestDynamic" "test_export_gpkg")
90 ("plugins/test/reports_test.py"
91 "TestDynamic" "test_indiv_complete")
92 ("plugins/test/reports_test.py"
93 "TestDynamic" "test_navwebpage")
94 ("plugins/test/reports_test.py"
95 "TestDynamic" "test_tool_check")
96 ("plugins/test/tools_test.py"
97 "ToolControl" "test_tcg_and_check_and_repair")
98 ("plugins/test/db_undo_and_signals_test.py"
99 "TestSQLite" "test_one"))))
100 #:phases
101 #~(modify-phases %standard-phases
102 (add-before 'build 'fix-gexiv2-dependency
103 (lambda _
104 ;; Use our own version
105 (substitute* (find-files "." ".*\\.py$")
106 (("\"GExiv2\", \"0.10\"") "\"GExiv2\", \"0.16\""))))
107 (add-after 'unpack 'swap-bsddb3-with-berkeleydb
108 ;; bsddb3 was renamed upstream to berkeleydb.
109 (lambda _
110 (substitute* (find-files "." ".*\\.py")
111 (("bsddb3") "berkeleydb"))))
112 (add-before 'check 'prepare-tests
113 (lambda _
114 (setenv "GDK_BACKEND" "-")
115 (setenv "HOME" "/tmp")
116 ;; Presence of .git directory is used to determine whether this
117 ;; is a final installation. Without it, tests fail to determine
118 ;; resource path.
119 (mkdir ".git")))
120 (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
121 (lambda* (#:key inputs #:allow-other-keys)
122 (wrap-program (string-append #$output "/bin/gramps")
123 `("GI_TYPELIB_PATH" ":" prefix
124 ,(filter-map
125 (match-lambda
126 ((output . directory)
127 (let ((girepodir (string-append
128 directory
129 "/lib/girepository-1.0")))
130 (and (file-exists? girepodir)
131 girepodir))))
132 inputs)))))
133 (add-after 'wrap 'glib-or-gtk-wrap
134 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
135 (native-inputs
136 (list gettext-minimal
137 intltool
138 python-jsonschema
139 python-mock
140 python-pytest
141 python-setuptools))
142 (inputs
143 (list bash-minimal
144 cairo
145 font-gnu-freefont
146 geocode-glib
147 gexiv2
148 ghostscript
149 gobject-introspection
150 gtk+
151 gtkspell3
152 graphviz
153 (librsvg-for-system)
154 osm-gps-map
155 pango
156 python-berkeleydb
157 python-imagesize
158 python-orjson
159 python-pillow
160 python-pycairo
161 python-pycountry
162 python-pygobject
163 python-pyicu
164 rcs
165 sqlite
166 xdg-utils))
167 (home-page "https://gramps-project.org")
168 (synopsis "Genealogical research software")
169 (description
170 "Gramps is a free software project and community striving to produce
171a genealogy program that is both intuitive for hobbyists and feature-complete
172for professional genealogists.")
173 (license license:gpl2+)))