summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2023-01-04 14:08:58 +0100
committerRicardo Wurmus <rekado@elephly.net>2023-01-04 14:08:58 +0100
commite1e76b7ab82f7160d1b117d8c2e2892b052e1706 (patch)
tree58c423ff29c15f12c20bff9ad9354f0fb0f7234b /gnu
parent12c815e985698c3da2ceb3ad2c10633baeac6c96 (diff)
downloadguix-e1e76b7ab82f7160d1b117d8c2e2892b052e1706.tar.gz
gnu: Add sugar-datastore.
* gnu/packages/sugar.scm (sugar-datastore): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/sugar.scm63
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/sugar.scm b/gnu/packages/sugar.scm
index 3b40dddacd..655ff79b99 100644
--- a/gnu/packages/sugar.scm
+++ b/gnu/packages/sugar.scm
@@ -27,6 +27,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages search)
   #:use-module (gnu packages xorg)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system python)
@@ -37,6 +38,68 @@
   #:use-module (guix utils)
   #:use-module (guix gexp))
 
+(define-public sugar-datastore
+  (package
+    (name "sugar-datastore")
+    (version "0.120")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/sugarlabs/sugar-datastore")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1wf33w6dm26i8a1zpb40339fj3l9vxjznagls9bc845nld318sqc"))))
+    (build-system glib-or-gtk-build-system)
+    (arguments
+     (list
+      #:imported-modules
+      `(,@%glib-or-gtk-build-system-modules
+        (guix build python-build-system))
+      #:modules
+      '((guix build glib-or-gtk-build-system)
+        ((guix build python-build-system) #:prefix python:)
+        (guix build utils))
+      #:phases
+      '(modify-phases %standard-phases
+         (add-after 'unpack 'patch-build-system
+           (lambda _
+             (substitute* "autogen.sh"
+               (("^\"\\$srcdir/configure" m)
+                (string-append "#" m)))))
+         (add-after 'unpack 'patch-reference-to-du
+           (lambda _
+             (substitute* "src/carquinyol/datastore.py"
+               (("/usr/bin/du") (which "du")))))
+         (add-after 'glib-or-gtk-wrap 'python-and-gi-wrap
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (for-each
+              (lambda (executable)
+                (wrap-program executable
+                  `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")
+                                         ,(python:site-packages inputs outputs)))
+                  `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))
+              (list (search-input-file outputs "bin/copy-from-journal")
+                    (search-input-file outputs "bin/copy-to-journal")
+                    (search-input-file outputs "bin/datastore-service"))))))))
+    (inputs
+     (list python
+           sugar-toolkit-gtk3))
+    (propagated-inputs
+     (list python-dbus
+           python-pygobject
+           python-xapian-bindings))
+    (native-inputs
+     (list autoconf automake
+           libtool
+           pkg-config))
+    (home-page "https://www.sugarlabs.org/")
+    (synopsis "Service for Sugar activities to store and retrieve data")
+    (description "Sugar Datastore provides activities with a way to store data
+and metadata, and the journal with querying and full text search.")
+    (license license:gpl2+)))
+
 (define-public sugar-toolkit-gtk3
   (package
     (name "sugar-toolkit-gtk3")