From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aN82BPnENGHqBgEAgWs5BA (envelope-from ) for ; Sun, 05 Sep 2021 15:24:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id OE0+APnENGGOdwAA1q6Kng (envelope-from ) for ; Sun, 05 Sep 2021 13:24:09 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A6C94234AA for ; Sun, 5 Sep 2021 15:24:08 +0200 (CEST) Received: from localhost ([::1]:43152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMs7z-00062k-NL for larch@yhetil.org; Sun, 05 Sep 2021 09:24:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMs7u-0005zE-Is for guix-patches@gnu.org; Sun, 05 Sep 2021 09:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:37893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMs7u-0008T1-B6 for guix-patches@gnu.org; Sun, 05 Sep 2021 09:24:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mMs7u-00011m-2T for guix-patches@gnu.org; Sun, 05 Sep 2021 09:24:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48554] [PATCH wip-gnome v9 1/2] gnu: Add gtk. References: In-Reply-To: Resent-From: Raghav Gururajan Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 05 Sep 2021 13:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48554 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 48554@debbugs.gnu.org Cc: Raghav Gururajan Received: via spool by 48554-submit@debbugs.gnu.org id=B48554.16308481923879 (code B ref 48554); Sun, 05 Sep 2021 13:24:02 +0000 Received: (at 48554) by debbugs.gnu.org; 5 Sep 2021 13:23:12 +0000 Received: from localhost ([127.0.0.1]:49435 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMs70-00010H-4k for submit@debbugs.gnu.org; Sun, 05 Sep 2021 09:23:11 -0400 Received: from out0.migadu.com ([94.23.1.103]:32379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMs6w-0000zj-IE for 48554@debbugs.gnu.org; Sun, 05 Sep 2021 09:23:05 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raghavgururajan.name; s=key1; t=1630848180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V9glewwrm0x6VrpbLKd0QbT45YQueMkC47+BdE3IsiE=; b=lRwt/xWjcpOCkPYZTwUUReqZ3H4AlSXtPkFhIHtd4BRyOm+NK3YgIHtjXUyPmcgd0qoppB DTkjPlMsV21e7+7RZQFnqiRD4tV+5iDzEYB2CzsKUsflrkPg7defszaemeI8mw8iAJgrCr +OEB0GiSKTK7d6j9xqIjiZFhbsK4gOHzJKpZOg6Wg4Bk+a/dP6NSUb+h2yLzpSo3EewXC2 kh68ZvsCuoGF+Lgf22yKhpoOPP6Q7G/ib99TXC/eabYNhmohu0+1fNoK5e3dtDhWb6Q6FQ xf38LC3YTbyVuqV6168O8fv9J9njko/SBjsYprZ5QF+r/LOzHJkGxCbQ3JvQWQ== Date: Sun, 5 Sep 2021 09:22:44 -0400 Message-Id: <20210905132245.20595-1-rg@raghavgururajan.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Auth-User: rg@raghavgururajan.name X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Raghav Gururajan X-ACL-Warn: , Raghav Gururajan via Guix-patches From: Raghav Gururajan via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630848248; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=V9glewwrm0x6VrpbLKd0QbT45YQueMkC47+BdE3IsiE=; b=CkyHrAjGXeQQPAU0f9VZWC4T6tmCRfF/dyArHvhJOzj8msuHCGNX1j5XkE9iesB/yJU9TJ 9RKfAFDSg/QwFZ0rYcWG6sCLPQgDa+/A4+UwCbfqfdfSVgvzczv2cAs1p0jk8eACgi39kh 5SPHcs1usWbcftyoq9xzQrO127vjxzpW9EL5PfoFNJiM39HzyWFfa5e1Ghy1dIBwa0SJME sCBpEdI6WSvc0GoWS8oglD5mWf20MpyC3uk/EvRNFpT8dK/YqeArUWlcXcdiA7bGjhIRKS R/2TB6gcR+7hEevZlHJmED7PVZYBGt5ZQH0PrOa5NfccDHlGNThVLxO1+pZylQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630848248; a=rsa-sha256; cv=none; b=AxAbmOEiL6HUYXMtS6BycBetp1FzDQ5lltyBgOKEDn5PtFJynoff+eW1Op/S9RvfPZb8ka kvaiJCqIjh+BGby4fyBs3Hpej8qodZtXfFUGnhs5DFZKQAosbg9X81eGfsb40CnNprryhc r29mJIgBh0vx1v0OvrnIuDhfNvUsPMoKW2IC63GpYdSRoIn7U4s1uygHOphhJ5ce8cnUT8 fmtcEKJ701SAlTek9/Tmlx22GQVBW9NQJeAhX6GkBfakGpZAcBIQnf7xPPD/N3w644XsFL 13ej7x8a9fQDSp8Sxmo9ykt+jsYxQ0Th6UffJfQEWYlRzx7nSl+g8IYOjbBbcA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=raghavgururajan.name header.s=key1 header.b="lRwt/xWj"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 1.09 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=raghavgururajan.name header.s=key1 header.b="lRwt/xWj"; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: A6C94234AA X-Spam-Score: 1.09 X-Migadu-Scanner: scn1.migadu.com X-TUID: +GMdgue8QzO3 * gnu/packages/gtk.scm (gtk): New variable. * gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. --- gnu/local.mk | 1 + gnu/packages/gtk.scm | 180 ++++++++++++++++++ .../patches/gtk4-respect-GUIX_GTK4_PATH.patch | 51 +++++ 3 files changed, 232 insertions(+) create mode 100644 gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch diff --git a/gnu/local.mk b/gnu/local.mk index c42c879f5a..ced9d7d892 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1203,6 +1203,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..73e7a7b4c4 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -91,11 +91,15 @@ #: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 gstreamer) #: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 video) + #:use-module (gnu packages vulkan) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module (gnu packages xorg) @@ -833,6 +837,182 @@ 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-respect-GUIX_GTK4_PATH.patch")))) + (build-system meson-build-system) + (outputs '("out" "bin" "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 + "-Dtracker=enabled" ;for filechooser search support + "-Dcolord=enabled" ;for color printing support + ,@(if (%current-target-system) + ;; If true, gtkdoc-scangobj will try to execute a + ;; cross-compiled binary. + '("-Dgtk_doc=false") + '("-Dgtk_doc=true")) + "-Dman-pages=true") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch + (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) + ;; Correct DTD resources of docbook. + (substitute* (find-files "docs" "\\.xml$") + (("http://www.oasis-open.org/docbook/xml/4.3/") + (string-append + (assoc-ref (or native-inputs inputs) "docbook-xml-4.3") + "/xml/dtd/docbook/"))) + ;; Disable building of icon cache. + (substitute* "meson.build" + (("gtk_update_icon_cache: true") + "gtk_update_icon_cache: false")) + ;; Disable failing tests. + ;; https://paste.sr.ht/blob/0af160f1172a58dff88a5cf6354ecba613cccdef + (substitute* (find-files "testsuite" "meson.build") + (("[ \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"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + ;; Run tests using the x11 setup, + ;; instead of the default wayland. + (invoke "meson" "test" "--setup=x11")))) + (add-after 'install 'move-files + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (bin (assoc-ref outputs "bin")) + (doc (assoc-ref outputs "doc"))) + (for-each mkdir-p + (list + (string-append bin "/bin") + (string-append bin "/share/applications") + (string-append bin "/share/icons") + (string-append bin "/share/man") + (string-append bin "/share/metainfo") + (string-append doc "/share/doc"))) + ;; Move programs and related files to output 'bin'. + (for-each (lambda (dir) + (rename-file + (string-append out dir) + (string-append bin dir))) + (list + "/bin" + "/share/applications" + "/share/icons" + "/share/man" + "/share/metainfo")) + ;; Move HTML documentation to output 'doc'. + (rename-file + (string-append out "/share/doc") + (string-append doc "/share/doc"))))) + (add-after 'move-files 'patch-desktop-files + (lambda* (#:key outputs #:allow-other-keys) + (let* ((bin (assoc-ref outputs "bin")) + (bindir (string-append bin "/bin")) + (appdir (string-append "/share/applications"))) + (substitute* (find-files appdir "//.desktop$") + (("exec.*=.*/bin") + (string-append "exec = " bindir))))))))) + (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 + ("gst-plugins-bad" ,gst-plugins-bad) ;provides gstreamer-player + ("gst-plugins-base" ,gst-plugins-base) ;provides gstreamer-gl + ("harfbuzz" ,harfbuzz) + ("iso-codes" ,iso-codes) + ("json-glib" ,json-glib) + ("libcloudproviders" ,libcloudproviders) ;for clould-providers support + ("librsvg" ,librsvg) + ("python" ,python) + ("rest" ,rest) + ("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-respect-GUIX_GTK4_PATH.patch b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch new file mode 100644 index 0000000000..4a60023bf7 --- /dev/null +++ b/gnu/packages/patches/gtk4-respect-GUIX_GTK4_PATH.patch @@ -0,0 +1,51 @@ +From 889294a93fc6464c2c2919bc47f6fd85ec823363 Mon Sep 17 00:00:00 2001 +From: Raghav Gururajan +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