From: Raghav Gururajan via Guix-patches via <guix-patches@gnu.org>
To: 48554@debbugs.gnu.org
Cc: Raghav Gururajan <rg@raghavgururajan.name>
Subject: [bug#48554] [PATCH wip-gnome v2] gnu: Add gtk.
Date: Thu, 2 Sep 2021 10:12:08 -0400 [thread overview]
Message-ID: <20210902141208.20049-1-rg@raghavgururajan.name> (raw)
In-Reply-To: <fbafbdb4-32ec-6e68-655f-a23d6f554de5@raghavgururajan.name>
* gnu/packages/gtk.scm (gtk): New variable.
* gnu/packages/patches/gtk4-honor-GUIX_GTK4_PATH.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/gtk.scm | 143 ++++++++++++++++++
.../patches/gtk4-honor-GUIX_GTK4_PATH.patch | 51 +++++++
3 files changed, 195 insertions(+)
create mode 100644 gnu/packages/patches/gtk4-honor-GUIX_GTK4_PATH.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 8aa20471d5..7922712b04 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1204,6 +1204,7 @@ dist_patch_DATA = \
%D%/packages/patches/gtk2-theme-paths.patch \
%D%/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch \
%D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \
+ %D%/packages/patches/gtk4-honor-GUIX_GTK4_PATH.patch \
%D%/packages/patches/gtkglext-disable-disable-deprecated.patch \
%D%/packages/patches/gtksourceview-2-add-default-directory.patch \
%D%/packages/patches/gvfs-add-support-for-libplist-2.2.patch \
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index ada006b671..d4f856ed21 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -91,11 +91,13 @@
#:use-module (gnu packages pretty-print)
#:use-module (gnu packages profiling)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-build)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages guile)
#:use-module (gnu packages guile-xyz)
#:use-module (gnu packages cups)
#:use-module (gnu packages version-control)
+ #:use-module (gnu packages vulkan)
#:use-module (gnu packages web)
#:use-module (gnu packages xml)
#:use-module (gnu packages xorg)
@@ -833,6 +835,147 @@ is part of the GNOME accessibility project.")
(license license:lgpl2.1+)
(home-page "https://wiki.gnome.org/Accessibility/")))
+(define-public gtk
+ (package
+ (name "gtk")
+ (version "4.2.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "mirror://gnome/sources/" name "/"
+ (version-major+minor version) "/"
+ name "-" version ".tar.xz"))
+ (sha256
+ (base32 "1rh9fd5axf79pmd93hb2fmmflic5swcvqvq6vqghlgz4bmvnjc82"))
+ (patches
+ (search-patches "gtk4-honor-GUIX_GTK4_PATH.patch"))))
+ (build-system meson-build-system)
+ (outputs '("out" "doc"))
+ (arguments
+ `(#:meson ,meson-0.55 ;project requires meson v0.55 or higher
+ #:configure-flags
+ (list
+ "-Dbroadway-backend=true" ;for broadway display-backend
+ "-Dcloudproviders=enabled" ;for cloud-providers support
+ ;;"-Dsysprof=enabled" ;for tracing support
+ "-Dtracker=enabled" ;for filechooser search support
+ "-Dcolord=enabled" ;for color printing support
+ "-Dgtk_doc=true"
+ "-Dman-pages=true")
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch
+ (lambda* (#:key inputs #:allow-other-keys)
+ ;; Fix DTD resource of docbook-xml.
+ (substitute* (find-files "docs" "\\.xml$")
+ (("http://www.oasis-open.org/docbook/xml/4.3/")
+ (string-append (assoc-ref inputs "docbook-xml-4.3")
+ "/xml/dtd/docbook/")))
+ ;; Use X display server for tests.
+ (substitute* (find-files "testsuite" "meson.build")
+ (("GDK_BACKEND=(wayland|broadway)")
+ "GDK_BACKEND=x11")
+ (("TEST_OUTPUT_SUBDIR=(wayland|brodway)")
+ "TEST_OUTPUT_SUBDIR=x11"))
+ ;; Disable failing tests.
+ ;; https://paste.sr.ht/blob/d70e2a92f329ed9b557f3268101cd312f7762a84
+ (substitute* '("testsuite/tools/meson.build"
+ "testsuite/gsk/meson.build")
+ (("'validate', ") "")
+ (("[ \t]*'empty-text.node',") "")
+ (("[ \t]*'testswitch.node',") "")
+ (("[ \t]*'widgetfactory.node',") ""))))
+ (add-before 'check 'pre-check
+ (lambda _
+ ;; Tests require a running X server.
+ (system "Xvfb :1 +extension GLX &")
+ (setenv "DISPLAY" ":1")
+ ;; Tests write to $HOME.
+ (setenv "HOME" (getcwd))
+ ;; Tests look for $XDG_RUNTIME_DIR.
+ (setenv "XDG_RUNTIME_DIR" (getcwd))
+ ;; For missing '/etc/machine-id'.
+ (setenv "DBUS_FATAL_WARNINGS" "0")))
+ (add-after 'install 'move-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (doc (assoc-ref outputs "doc")))
+ (mkdir-p (string-append doc "/share/doc"))
+ (rename-file
+ (string-append out "/share/doc")
+ (string-append doc "/share/doc"))))))))
+ (native-inputs
+ `(("docbook-xml-4.3" ,docbook-xml-4.3)
+ ("docbook-xsl" ,docbook-xsl)
+ ("gettext-minimal" ,gettext-minimal)
+ ("glib:bin" ,glib "bin")
+ ("gobject-introspection" ,gobject-introspection) ;for building introspection data
+ ("gtk-doc" ,gtk-doc) ;for building documentation
+ ("intltool" ,intltool)
+ ("libxslt" ,libxslt) ;for building man-pages
+ ("pkg-config" ,pkg-config)
+ ;; These python modules are required for building documentation.
+ ("python-jinja2" ,python-jinja2)
+ ("python-markdown" ,python-markdown)
+ ("python-markupsafe" ,python-markupsafe)
+ ("python-pygments" ,python-pygments)
+ ("python-toml" ,python-toml)
+ ("python-typogrify" ,python-typogrify)
+ ("sassc" ,sassc) ;for building themes
+ ("vala" ,vala)
+ ("xorg-server-for-tests" ,xorg-server-for-tests)))
+ (inputs
+ `(("colord" ,colord) ;for color printing support
+ ("cups" ,cups) ;for CUPS print-backend
+ ;;("ffmpeg" ,ffmpeg) ;for ffmpeg media-backend
+ ("fribidi" ,fribidi)
+ ;;("gstreamer" ,gstreamer) ;for gstreamer media-backend
+ ("harfbuzz" ,harfbuzz)
+ ("iso-codes" ,iso-codes)
+ ("json-glib" ,json-glib)
+ ("libcloudproviders" ,libcloudproviders) ; for clould-providers support
+ ("librsvg" ,librsvg)
+ ("python" ,python)
+ ("rest" ,rest)
+ ;;("sysprof" ,sysprof) ;for tracing support
+ ("tracker" ,tracker))) ;for filechooser search support
+ (propagated-inputs
+ ;; Following dependencies are referenced in .pc files.
+ `(("cairo" ,cairo)
+ ("fontconfig" ,fontconfig)
+ ("gdk-pixbuf+svg" ,gdk-pixbuf+svg)
+ ("glib" ,glib)
+ ("graphene" ,graphene)
+ ("libepoxy" ,libepoxy)
+ ("libx11" ,libx11) ;for x11 display-backend
+ ("libxcomposite" ,libxcomposite)
+ ("libxcursor" ,libxcursor)
+ ("libxdamage" ,libxdamage)
+ ("libxext" ,libxext)
+ ("libxfixes" ,libxfixes)
+ ("libxi" ,libxi)
+ ("libxinerama" ,libxinerama) ;for xinerama support
+ ("libxkbcommon" ,libxkbcommon)
+ ("libxrandr" ,libxrandr)
+ ("libxrender" ,libxrender)
+ ("pango" ,pango)
+ ("vulkan-headers" ,vulkan-headers)
+ ("vulkan-loader" ,vulkan-loader) ;for vulkan graphics API support
+ ("wayland" ,wayland) ;for wayland display-backend
+ ("wayland-protocols" ,wayland-protocols)))
+ (native-search-paths
+ (list
+ (search-path-specification
+ (variable "GUIX_GTK4_PATH")
+ (files '("lib/gtk-4.0")))))
+ (search-paths native-search-paths)
+ (home-page "https://www.gtk.org/")
+ (synopsis "Cross-platform widget toolkit")
+ (description "GTK is a multi-platform toolkit for creating graphical user
+interfaces. Offering a complete set of widgets, GTK is suitable for projects
+ranging from small one-off tools to complete application suites.")
+ (license license:lgpl2.1+)))
+
(define-public gtk+-2
(package
(name "gtk+")
diff --git a/gnu/packages/patches/gtk4-honor-GUIX_GTK4_PATH.patch b/gnu/packages/patches/gtk4-honor-GUIX_GTK4_PATH.patch
new file mode 100644
index 0000000000..4a60023bf7
--- /dev/null
+++ b/gnu/packages/patches/gtk4-honor-GUIX_GTK4_PATH.patch
@@ -0,0 +1,51 @@
+From 889294a93fc6464c2c2919bc47f6fd85ec823363 Mon Sep 17 00:00:00 2001
+From: Raghav Gururajan <rg@raghavgururajan.name>
+Date: Tue, 18 May 2021 19:57:00 -0400
+Subject: [PATCH] [PATCH]: Honor GUIX_GTK4_PATH.
+
+This patch makes GTK look for additional modules in a list of directories
+specified by the environment variable "GUIX_GTK4_PATH". This can be used
+instead of "GTK_PATH" to make GTK find modules that are incompatible with
+other major versions of GTK.
+---
+ gtk/gtkmodules.c | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/gtk/gtkmodules.c b/gtk/gtkmodules.c
+index aace5dcbc9..193b6a02e9 100644
+--- a/gtk/gtkmodules.c
++++ b/gtk/gtkmodules.c
+@@ -105,6 +105,7 @@ static char **
+ get_module_path (void)
+ {
+ const char *module_path_env;
++ const gchar *module_guix_gtk4_path_env;
+ const char *exe_prefix;
+ char *module_path;
+ char *default_dir;
+@@ -114,6 +115,7 @@ get_module_path (void)
+ return result;
+
+ module_path_env = g_getenv ("GTK_PATH");
++ module_guix_gtk4_path_env = g_getenv ("GUIX_GTK4_PATH");
+ exe_prefix = g_getenv ("GTK_EXE_PREFIX");
+
+ if (exe_prefix)
+@@ -121,7 +123,13 @@ get_module_path (void)
+ else
+ default_dir = g_build_filename (_gtk_get_libdir (), "gtk-4.0", NULL);
+
+- if (module_path_env)
++ if (module_guix_gtk4_path_env && module_path_env)
++ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
++ module_guix_gtk4_path_env, module_path_env, default_dir, NULL);
++ else if (module_guix_gtk4_path_env)
++ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
++ module_guix_gtk4_path_env, default_dir, NULL);
++ else if (module_path_env)
+ module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,
+ module_path_env, default_dir, NULL);
+ else
+--
+2.31.1
+
--
2.33.0
next prev parent reply other threads:[~2021-09-02 14:15 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 4:06 [bug#48554] GTK v4 Raghav Gururajan via Guix-patches via
2021-05-21 4:08 ` [bug#48554] [PATCH wip-gnome v1] gnu: Add gtk Raghav Gururajan via Guix-patches via
2021-07-16 15:39 ` [bug#48554] Successful Build Charles via Guix-patches via
2021-08-16 4:29 ` Raghav Gururajan via Guix-patches via
2021-08-31 1:05 ` [bug#48554] GTK v4 Raghav Gururajan via Guix-patches via
2021-08-31 5:53 ` Raghav Gururajan via Guix-patches via
2021-09-02 14:12 ` Raghav Gururajan via Guix-patches via [this message]
2021-09-02 14:20 ` [bug#48554] [PATCH wip-gnome v2] gnu: Add gtk Maxime Devos
2021-09-02 14:23 ` Raghav Gururajan via Guix-patches via
2021-09-02 14:28 ` Maxime Devos
2021-09-02 15:07 ` Raghav Gururajan via Guix-patches via
2021-09-02 14:29 ` Maxime Devos
2021-09-02 15:10 ` Raghav Gururajan via Guix-patches via
2021-09-02 15:06 ` [bug#48554] [PATCH wip-gnome v3] " Raghav Gururajan via Guix-patches via
2021-09-02 15:37 ` [bug#48554] [PATCH wip-gnome v4] " Raghav Gururajan via Guix-patches via
2021-09-02 20:09 ` [bug#48554] [PATCH wip-gnome v5 1/2] " Raghav Gururajan via Guix-patches via
2021-09-02 20:09 ` [bug#48554] [PATCH wip-gnome v5 2/2] gnu: Update gtkmm to 4.2.0, add gtkmm@3, and adjust gtkmm@2 Raghav Gururajan via Guix-patches via
2021-09-02 20:41 ` [bug#48554] [PATCH wip-gnome v6 1/4] gnu: Add gtk Raghav Gururajan via Guix-patches via
2021-09-02 20:41 ` [bug#48554] [PATCH wip-gnome v6 2/4] gnu: gtk+: Update to 3.24.30 and inherit from gtk instead of gtk+-2 Raghav Gururajan via Guix-patches via
2021-09-02 20:41 ` [bug#48554] [PATCH wip-gnome v6 3/4] gnu: gtk+@2: Move block and inherit from gtk Raghav Gururajan via Guix-patches via
2021-09-02 20:41 ` [bug#48554] [PATCH wip-gnome v6 4/4] gnu: Update gtkmm to 4.2.0, add gtkmm@3, and adjust gtkmm@2 Raghav Gururajan via Guix-patches via
2021-09-02 20:56 ` [bug#48554] [PATCH wip-gnome v7 1/4] gnu: Add gtk Raghav Gururajan via Guix-patches via
2021-09-02 20:56 ` [bug#48554] [PATCH wip-gnome v7 2/4] gnu: gtk+: Inherit from gtk instead of gtk+-2 Raghav Gururajan via Guix-patches via
2021-09-02 20:56 ` [bug#48554] [PATCH wip-gnome v7 3/4] gnu: gtk+@2: Move block and inherit from gtk Raghav Gururajan via Guix-patches via
2021-09-02 20:56 ` [bug#48554] [PATCH wip-gnome v7 4/4] gnu: Update gtkmm to 4.2.0, add gtkmm@3, and adjust gtkmm@2 Raghav Gururajan via Guix-patches via
2021-09-03 17:08 ` [bug#48554] [PATCH wip-gnome v8 1/4] gnu: Add gtk Raghav Gururajan via Guix-patches via
2021-09-03 17:08 ` [bug#48554] [PATCH wip-gnome v8 2/4] gnu: gtk+: Inherit from gtk instead of gtk+-2 Raghav Gururajan via Guix-patches via
2021-09-03 17:08 ` [bug#48554] [PATCH wip-gnome v8 3/4] gnu: gtk+@2: Move block and inherit from gtk Raghav Gururajan via Guix-patches via
2021-09-03 17:08 ` [bug#48554] [PATCH wip-gnome v8 4/4] gnu: Update gtkmm to 4.2.0, add gtkmm@3, and adjust gtkmm@2 Raghav Gururajan via Guix-patches via
2021-09-05 13:22 ` [bug#48554] [PATCH wip-gnome v9 1/2] gnu: Add gtk Raghav Gururajan via Guix-patches via
2021-09-05 13:22 ` [bug#48554] [PATCH wip-gnome v9 2/2] gnu: Update gtkmm to 4.2.0, add gtkmm@3, and adjust gtkmm@2 Raghav Gururajan via Guix-patches via
2021-09-05 14:44 ` [bug#48554] [PATCH wip-gnome v10 1/2] gnu: Add gtk Raghav Gururajan via Guix-patches via
2021-09-05 14:44 ` [bug#48554] [PATCH wip-gnome v10 2/2] gnu: Update gtkmm to 4.2.0, add gtkmm@3, and adjust gtkmm@2 Raghav Gururajan via Guix-patches via
2021-09-06 19:58 ` [bug#48554] GTK v4 Raghav Gururajan via Guix-patches via
2021-09-07 0:41 ` bug#48554: " Raghav Gururajan via Guix-patches via
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210902141208.20049-1-rg@raghavgururajan.name \
--to=guix-patches@gnu.org \
--cc=48554@debbugs.gnu.org \
--cc=rg@raghavgururajan.name \
/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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.