summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2025-09-27 15:08:44 +0200
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-09-28 21:27:30 +0100
commit37ba8866362c3c1861aa8f70a86f81657d3e3902 (patch)
tree1e9ffb39647b03c8c3deb50f1eb5432b79b2c093 /gnu
parent4a39d264681daa48c5aca8166e422425c73b8469 (diff)
gnu: gramps: Switch to pyproject.
* gnu/packages/genealogy.scm (gramps): [build-system]: Switch to pyproject-build-system. [arguments]: Relocate, improve style. <#:phases>: Refresh phase 'wrap-with-GI_TYPELIB_PATH. Merge phases 'prepare-tests and 'set-home-for-tests. [native-inputs]: Add python-setuptools. Change-Id: I889bde2a6db4ed249c1e9137fc0274bb44e87f47 Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/genealogy.scm85
1 files changed, 44 insertions, 41 deletions
diff --git a/gnu/packages/genealogy.scm b/gnu/packages/genealogy.scm
index 668505a71a9..f244b5db6c9 100644
--- a/gnu/packages/genealogy.scm
+++ b/gnu/packages/genealogy.scm
@@ -18,9 +18,10 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages genealogy)
- #:use-module (guix build-system python)
+ #:use-module (guix build-system pyproject)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix gexp)
#:use-module (guix packages)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
@@ -34,6 +35,7 @@
#:use-module (gnu packages graphviz)
#:use-module (gnu packages gtk)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-build)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages version-control)
@@ -52,11 +54,48 @@
(file-name (git-file-name name version))
(sha256
(base32 "1gzhi5hxpgc6pxs40xsxf67hndjifnfhm89s3ly68c70x83qmwhd"))))
- (build-system python-build-system)
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:imported-modules
+ `((guix build glib-or-gtk-build-system)
+ ,@%pyproject-build-system-modules)
+ #:modules
+ `((ice-9 match)
+ (srfi srfi-1)
+ (guix build pyproject-build-system)
+ ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
+ (guix build utils))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-before 'check 'prepare-tests
+ (lambda _
+ (setenv "HOME" (getenv "TMPDIR"))
+ ;; Presence of .git directory is used to determine whether this
+ ;; is a final installation. Without it, tests fail to determine
+ ;; resource path.
+ (mkdir ".git")
+ ;; Test is failing
+ (delete-file "gramps/gen/utils/test/file_test.py")))
+ (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (wrap-program (string-append #$output "/bin/gramps")
+ `("GI_TYPELIB_PATH" ":" prefix
+ ,(filter-map
+ (match-lambda
+ ((output . directory)
+ (let ((girepodir (string-append
+ directory
+ "/lib/girepository-1.0")))
+ (and (file-exists? girepodir)
+ girepodir))))
+ inputs)))))
+ (add-after 'wrap 'glib-or-gtk-wrap
+ (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
(native-inputs
- `(("gettext" ,gettext-minimal)
- ("intltool" ,intltool)
- ("glibc-utf8-locales" ,glibc-utf8-locales))) ;; for one test
+ (list gettext-minimal intltool
+ glibc-utf8-locales ;for one test
+ python-setuptools))
(inputs
(list bash-minimal
cairo
@@ -81,42 +120,6 @@
rcs
sqlite
xdg-utils))
- (arguments
- `(#:imported-modules ((guix build glib-or-gtk-build-system)
- ,@%python-build-system-modules)
- #:modules ((ice-9 match)
- (guix build python-build-system)
- ((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
- (guix build utils))
- #:phases
- (modify-phases %standard-phases
- (add-before 'check 'set-home-for-tests
- (lambda _
- (setenv "HOME" (getenv "TMPDIR"))))
- (add-before 'check 'prepare-tests
- (lambda _
- ;; Presence of .git directory is used to determine whether this
- ;; is a final installation. Without it, tests fail to determine
- ;; resource path.
- (mkdir ".git")
- ;; Test is failing
- (delete-file "gramps/gen/utils/test/file_test.py")))
- (add-before 'wrap 'wrap-with-GI_TYPELIB_PATH
- (lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (paths (map (match-lambda
- ((output . directory)
- (let ((girepodir (string-append
- directory
- "/lib/girepository-1.0")))
- (if (file-exists? girepodir)
- girepodir
- #f))))
- inputs)))
- (wrap-program (string-append out "/bin/gramps")
- `("GI_TYPELIB_PATH" ":" prefix ,(filter identity paths))))))
- (add-after 'wrap 'glib-or-gtk-wrap
- (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
(home-page "https://gramps-project.org")
(synopsis "Genealogical research software")
(description