From: Leo Prikler <leo.prikler@student.tugraz.at>
To: 45270@debbugs.gnu.org
Cc: luis.felipe.la@protonmail.com
Subject: bug#45270: [PATCH] gnu: gnome-builder: Fix python and GI paths.
Date: Fri, 18 Dec 2020 15:16:16 +0100 [thread overview]
Message-ID: <20201218141616.31908-1-leo.prikler@student.tugraz.at> (raw)
In-Reply-To: <e8kWgulxAEiAIByTFCb5Wwpzg2-zuj52Id4VIkVO7LBOqAHbMN-xfacoJTdEZDz4IfP2QxxEeyAwt17B0fWmp2jT7uAbSmk7AR5fMN18rzE=@protonmail.com>
This patch fixes #45270 by patching PYTHON_PATH at application start time and
prepending "the correct" GI typelib paths at plugin load time.
* gnu/packages/gnome.scm (gnome-builder)[#:phases]: Add python-wrap and
patch-gi-repository-path.
---
gnu/packages/gnome.scm | 49 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index 6b2ddf15f3..5a166d1b86 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -11890,6 +11890,38 @@ libraries. Applications do not need to be recompiled--or even restarted.")
(string-append (assoc-ref inputs "python-pygobject")
"/lib")))
#t))
+ (add-after 'unpack 'patch-gi-repository-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (letrec ((gir (lambda (input)
+ (string-append (assoc-ref inputs input)
+ "/lib/girepository-1.0")))
+ (prepend
+ (lambda (path)
+ (let ((fn "g_irepository_prepend_search_path"))
+ (format #f "~a (~s);~% " fn path))))
+ (prepend-gir (lambda (input) (prepend (gir input)))))
+ (substitute* "src/libide/gui/ide-application-plugins.c"
+ (("g_irepository_prepend_search_path .*" all)
+ ;; TODO: Try to establish working set.
+ (string-append
+ (prepend-gir "template-glib")
+ (prepend-gir "at-spi2-core")
+ (prepend-gir "atk")
+ (prepend-gir "harfbuzz")
+ (prepend-gir "pango")
+ (prepend-gir "gtk+")
+ ;; XXX: Adding gdk-pixbuf results in a load error, despite
+ ;; it being needed.
+ ;; (prepend-gir "gdk-pixbuf")
+ (prepend-gir "json-glib")
+ (prepend-gir "jsonrpc-glib")
+ (prepend-gir "libdazzle")
+ (prepend-gir "libpeas")
+ (prepend-gir "libsoup")
+ (prepend-gir "vte")
+ (prepend-gir "webkitgtk")
+ (prepend-gir "gtksourceview")
+ all))))))
(add-after 'configure 'fix-ninja
(lambda _
;; #43296: meson(?) incorrectly assumes we want to link
@@ -11901,7 +11933,22 @@ libraries. Applications do not need to be recompiled--or even restarted.")
(lambda _
(system "Xvfb :1 &")
(setenv "DISPLAY" ":1")
- #t)))))
+ #t))
+ (add-after 'glib-or-gtk-wrap 'python-wrap
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let ((prog (string-append (assoc-ref outputs "out")
+ "/bin/gnome-builder"))
+ (lib (string-append (assoc-ref outputs "out")
+ "/lib")))
+ (wrap-program prog
+ `("PYTHONPATH" = (,(string-append lib
+ "/python"
+ ,(version-major+minor
+ (package-version
+ python))
+ "/site-packages")
+ ,(getenv "PYTHONPATH"))))
+ #t))))))
(inputs
`(("devhelp" ,devhelp)
("gspell" ,gspell)
--
2.29.2
prev parent reply other threads:[~2020-12-18 14:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 15:06 bug#45270: GNOME Builder: I can't start a new project Luis Felipe via Bug reports for GNU Guix
2020-12-18 14:16 ` Leo Prikler [this message]
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=20201218141616.31908-1-leo.prikler@student.tugraz.at \
--to=leo.prikler@student.tugraz.at \
--cc=45270@debbugs.gnu.org \
--cc=luis.felipe.la@protonmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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).