diff mbox series

[bug#72647] fix siril gui in pure environments

Message ID 20240816020838.25429-1-tikhonenko@mpe.mpg.de
State New
Headers show
Series [bug#72647] fix siril gui in pure environments | expand

Commit Message

Iliya Tikhonenko Aug. 16, 2024, 2:08 a.m. UTC
Change-Id: Ia5c1043fa4824275f84c2f0e6db6234c9d2fb2ed
---
When launching in a container with

guix -C siril --network --preserve='^DISPLAY$' -E'^XDG_RUNTIME_DIR$' --share="${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY}" -- siril

the program was crashing due to missing gsettings schemas. The fix is to 
add the right build phase with #:glib-or-gtk #t and wrap program once
more to get the icons displaying without glitches.

 gnu/packages/astronomy.scm | 46 +++++++++++++++++++++++++++++---------
 1 file changed, 35 insertions(+), 11 deletions(-)


base-commit: 888fdfd1b1c4e4b3913b7b229f1ebc9f4596be20

Comments

Sharlatan Hellseher Aug. 16, 2024, 7:03 p.m. UTC | #1
Hi,

Thanks for the patch!

Pushed as ff7d4d821a033bfd77b8cbb00339738570bac3bc to master with added
commit message.

--
Oleg
diff mbox series

Patch

diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm
index 613e4d3fee..835ea044ec 100644
--- a/gnu/packages/astronomy.scm
+++ b/gnu/packages/astronomy.scm
@@ -9,7 +9,7 @@ 
 ;;; Copyright © 2021, 2022 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
-;;; Copyright © 2023 Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
+;;; Copyright © 2023-2024 Iliya Tikhonenko <tikhonenko@mpe.mpg.de>
 ;;; Copyright © 2023 Andreas Enge <andreas@enge.fr>
 ;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2024 Ricardo Wurmus <rekado@elephly.net>
@@ -35,6 +35,7 @@  (define-module (gnu packages astronomy)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
   #:use-module (gnu packages check)
@@ -1538,25 +1539,48 @@  (define-public siril
   (package
     (name "siril")
     (version "1.2.3")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://gitlab.com/free-astro/siril")
-                    (commit version)))
-              (sha256
-               (base32
-                "0gkd8w2bpwq4ibl3vawx008yrm5k6zlj77lp98fflffcf7cj8hr5"))
-              (file-name (git-file-name name version))))
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gitlab.com/free-astro/siril")
+             (commit version)))
+       (sha256
+        (base32 "0gkd8w2bpwq4ibl3vawx008yrm5k6zlj77lp98fflffcf7cj8hr5"))
+       (file-name (git-file-name name version))))
     (build-system meson-build-system)
-    (native-inputs (list cmake git glib libconfig pkg-config))
+    (arguments
+     (list
+      #:glib-or-gtk? #t
+      #:imported-modules `(,@%meson-build-system-modules (guix build
+                                                          glib-or-gtk-build-system))
+      #:modules '((guix build meson-build-system)
+                  ((guix build glib-or-gtk-build-system)
+                   #:prefix glib-or-gtk:)
+                  (guix build utils))
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'generate-gdk-pixbuf-loaders-cache-file
+                     (assoc-ref glib-or-gtk:%standard-phases
+                                'generate-gdk-pixbuf-loaders-cache-file))
+                   (add-after 'install 'wrap-program
+                     (lambda* _
+                       (wrap-program (string-append #$output "/bin/siril")
+                         ;; Wrapping GDK_PIXBUF_MODULE_FILE
+                         ;; to load icons in pure environments.
+                         `("GDK_PIXBUF_MODULE_FILE" =
+                           (,(getenv "GDK_PIXBUF_MODULE_FILE")))))))))
+    (native-inputs (list cmake git libconfig pkg-config))
     (inputs (list cfitsio
+                  (librsvg-for-system)
                   exiv2
                   ffms2
                   fftwf
                   gsl
+                  gdk-pixbuf
                   gtk+
                   json-glib
                   libheif
+                  bash-minimal ;for wrap-program
                   libraw
                   librtprocess
                   opencv))