unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: phodina <phodina@protonmail.com>
To: help-guix <help-guix@gnu.org>
Subject: Resources issue with glib-compile-resources
Date: Sun, 03 Oct 2021 06:52:13 +0000	[thread overview]
Message-ID: <C_Dd3tlXrBMe8r6xl_XSdblM67MTyIAX_BzN7z3tnHZrx56aSH6iZL2gK-ZqKIshPByte_5KKFzN6d525rbvdABvHeFzUSCm3C8jBEAi-zw=@protonmail.com> (raw)

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 <phodina@protonmail.com>
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 "https://hyvatti.iki.fi/~jaakko/pic/picprog.html")
     (license license:gpl3+)))

+(define-public pinetime-flasher
+(package
+  (name "pinetime-flasher")
+  (version "0.1")
+  (source (origin
+            (method git-fetch)
+            (uri (git-reference
+             (url "https://github.com/arteeh/pinetime-flasher")
+             (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 "/icons/hicolor/scalable/apps")))
+                     (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 "https://sourceforge.net/p/openocd"
+                    "/code/ci/master/tree/contrib/60-openocd.rules?format=raw"))
+                      (sha256
+                        (base32
+                          "1xvgpk6nzd6kp86sh240iqk122yqbarhwi6s6js98zfj43190sn0"))))))
+  (synopsis "Flashing app for PineTime")
+  (description "Pinetime Flasher provides a GTK app for easily flashing
+the Pinetime smartwatch with an ST-Link.")
+  (home-page "https://github.com/arteeh/pinetime-flasher")
+  (license license:expat)))
+
 (define-public fc-host-tools
   (package
     (name "fc-host-tools")
--
2.32.0




                 reply	other threads:[~2021-10-03  6:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='C_Dd3tlXrBMe8r6xl_XSdblM67MTyIAX_BzN7z3tnHZrx56aSH6iZL2gK-ZqKIshPByte_5KKFzN6d525rbvdABvHeFzUSCm3C8jBEAi-zw=@protonmail.com' \
    --to=phodina@protonmail.com \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).