[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Resources issue with glib-compile-resources

From: phodina
Subject: Resources issue with glib-compile-resources
Date: Sun, 03 Oct 2021 06:52:13 +0000

Hi Guix,

I'm struggling to build this package (patch provided below)
and would like to ask for your ideas.

The issue is that in Makefile we call glib-compile-resources
to compile the resources. However, the path needs to be substituted
otherwise the resources are not found when the app is launched.

But by substituting the location the build phase fails as the
glib-compile-resources command looks for the resources in the
/gnu/store/xxxxx where the files are not yet present.

The only solution I come up with is to install those files there
before the build stage.

What do you think?

--8<---------------cut here---------------start------------->8---

>From 5b75a1733107268fe41207c32e714d60643b9714 Mon Sep 17 00:00:00 2001
From: Petr Hodina <>
Date: Sat, 2 Oct 2021 15:58:53 +0200
Subject: [PATCH] gnu: Add pine-flasher.

* gnu/packages/embedded.scm (pine-flasher): New variable.

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index f388c11c3d..9b790b1aa5 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -43,12 +43,16 @@
   #:use-module ((gnu packages base) #:prefix base:)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cross-base)
   #:use-module (gnu packages dejagnu)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gdb)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages libftdi)
   #:use-module (gnu packages libusb)
@@ -60,6 +64,7 @@
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (srfi srfi-1))

@@ -1217,6 +1222,74 @@ SPI, I2C, JTAG.")
     (home-page "";)
     (license license:gpl3+)))

+(define-public pinetime-flasher
+  (name "pinetime-flasher")
+  (version "0.1")
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+             (url "";)
+             (commit version)))
+            (file-name (git-file-name name version))
+            (sha256
+             (base32
+              "1n5isqi2s4y69w80ymfwndyqxzqgp5aycimm27dpmsxnx3rxsx48"))))
+  (build-system gnu-build-system)
+  (arguments
+    `(#:tests? #f ; no test suite
+      #:phases
+      (modify-phases %standard-phases
+        (delete 'configure)
+        (add-before 'build 'fix-icon-location-chdir
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((out (assoc-ref outputs "out"))
+                  (icons (string-append out
+                           "/share/icons/hicolor/scalable/apps")))
+                    (substitute* "src/pinetime-flasher.ui"
+                      (("../build") icons))
+                    (substitute* "src/pinetime-flasher.gresource.xml"
+                      (("../build") icons))
+                    (chdir "build") #t)))
+        (replace 'install
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((out (assoc-ref outputs "out"))
+                   (bin (string-append out "/bin"))
+                   (share (string-append out "/share"))
+                   (udev (string-append out "/lib/udev/rules.d"))
+                   (udev-rule (string-append
+                     (assoc-ref inputs "udev-rules") "/60-openocd.rules"))
+                   (icons (string-append share 
+                     (mkdir-p bin)
+                     (mkdir-p icons)
+                     (mkdir-p share)
+                     (mkdir-p udev)
+                     (install-file "icon.png" icons)
+                     (install-file "icon.svg" icons)
+                     (install-file udev-rule udev)
+                     (install-file "com.arteeh.Flasher.desktop" share)
+                     (install-file "pinetime-flasher" bin)))))))
+  (native-inputs `(("glib" ,glib "bin")
+                   ("libxml2" ,libxml2)
+                   ("pkg-config" ,pkg-config)))
+  (inputs `(("curl" ,curl)
+            ("gtk+" ,gtk+)
+            ("libhandy" ,libhandy)
+            ("stlink" ,stlink)
+            ("udev-rule"
+               ,(origin
+                  (method url-fetch)
+                    (uri (string-append "";
+                      (sha256
+                        (base32
+  (synopsis "Flashing app for PineTime")
+  (description "Pinetime Flasher provides a GTK app for easily flashing
+the Pinetime smartwatch with an ST-Link.")
+  (home-page "";)
+  (license license:expat)))
 (define-public fc-host-tools
     (name "fc-host-tools")

reply via email to

[Prev in Thread] Current Thread [Next in Thread]