From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: [PATCH 2/2] gnu: Add gnome-tweak-tool. Date: Wed, 13 Apr 2016 20:02:14 +0200 Message-ID: <87lh4hs7yx.fsf@drakenvlieg.flower> References: <87vb3z3q89.fsf@drakenvlieg.flower> <20160411233524.GA11228@jasmine> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqP7h-0001UI-11 for guix-devel@gnu.org; Wed, 13 Apr 2016 14:02:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqP7d-0000BV-6y for guix-devel@gnu.org; Wed, 13 Apr 2016 14:02:40 -0400 In-Reply-To: <20160411233524.GA11228@jasmine> (Leo Famulari's message of "Mon, 11 Apr 2016 19:35:24 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel@gnu.org, rennes@openmailbox.org --=-=-= Content-Type: text/plain Leo Famulari writes: > I still don't understand how all the parts of GNOME fit together, so I > can't give a full review of these patches. > > But, with these patches, I can successfully prevent my laptop from > sleeping when the lid is closed. Thank you! :-) >> * gnu/packages/gnome.scm (libnotify)[native-inputs]: Add >> gobject-introspection. > > Looks okay, but as I said before, I'm no expert on this stuff. Ok. Yes, gnome-tweak-tool needs this. >> * gnu/packages/patches/gnome-tweak-tool-search-paths.patch: New file. > > Can you add some comments explaining this patch (and a link to the source, if > applicable)? Ok, done. >> * gnu-system.am: Add it. > > Please specify which section of gnu-system.am the file is being added > to. In this case, it's dist_patch_DATA. See the commit log for the exact > format. Ok. >> * gnu/packages/gnome.scm (gnome-tweak-tool): New variable. >> + (replace 'install >> + (lambda _ >> + (zero? (system* "make" >> + "sysconfdir=/tmp" >> + "localstatedir=/tmp" >> + "install"))))))) > > How about setting these variables in #:make-flags instead of replacing > the install phase? Would that work? Yes, that works. Done. >> + (propagated-inputs >> + `(("gobject-introspection" ,gobject-introspection) >> + ("gnome-shell" ,gnome-shell) >> + ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) >> + ("gtk+" ,gtk+) >> + ("libnotify" ,libnotify) >> + ("mutter" ,mutter) >> + ("python2" ,python-2) >> + ("python2-pygobject" ,python2-pygobject))) > > Oof, do we really have to propagate python-2 (and the others)? Yes... I experimented with moving any of these to plain inputs, gnome-tweak-tool crashes on missing gir features. >> + (synopsis "Gnome Tweak Tool") > > Can you paraphrase this? I don't think the synopsis should be the same > as the package name. How about something like this: "GNOME advanced > settings control panel"? I modified synopsis and description using https://git.gnome.org/browse/gnome-tweak-tool/tree/gnome-tweak-tool.doap like rennes suggested. Also, I updated to 3.20.0. Greetings, Jan --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-gnu-libnotify-Add-dependency-on-gobject-introspectio.patch Content-Transfer-Encoding: quoted-printable >From 47bab3dc9216437e948e5c3918063059e7207d05 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 3 Apr 2016 12:56:11 +0200 Subject: [PATCH 1/2] gnu: libnotify: Add dependency on gobject-introspectio= n. * gnu/packages/gnome.scm (libnotify)[native-inputs]: Add gobject-introspection. --- gnu/packages/gnome.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 11ed486..32ff5a8 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -15,6 +15,7 @@ ;;; Copyright =C2=A9 2016 Rene Saavedra ;;; Copyright =C2=A9 2016 Jochem Raat ;;; Copyright =C2=A9 2016 Rene Saavedra +;;; Copyright =C2=A9 2016 Jan Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -681,7 +682,8 @@ database is translated at Transifex.") ("libpng" ,libpng))) (native-inputs `(("pkg-config" ,pkg-config) - ("glib" ,glib "bin"))) + ("glib" ,glib "bin") + ("gobject-introspection" ,gobject-introspection))) (home-page "https://developer-next.gnome.org/libnotify/") (synopsis "GNOME desktop notification library") --=20 2.1.4 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-gnu-Add-gnome-tweak-tool.patch >From c23fc3fdf354da07f41fb0ba9abeaf464729ec2f Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 3 Apr 2016 12:52:37 +0200 Subject: [PATCH 2/2] gnu: Add gnome-tweak-tool. * gnu/packages/patches/gnome-tweak-tool-search-paths.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/gnome.scm (gnome-tweak-tool): New variable. --- gnu-system.am | 1 + gnu/packages/gnome.scm | 39 ++++++++++++++++ .../patches/gnome-tweak-tool-search-paths.patch | 52 ++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 gnu/packages/patches/gnome-tweak-tool-search-paths.patch diff --git a/gnu-system.am b/gnu-system.am index d883cdc..be286ac 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -500,6 +500,7 @@ dist_patch_DATA = \ gnu/packages/patches/glibc-versioned-locpath.patch \ gnu/packages/patches/gmp-arm-asm-nothumb.patch \ gnu/packages/patches/gmp-faulty-test.patch \ + gnu/packages/patches/gnome-tweak-tool-search-paths.patch \ gnu/packages/patches/gnucash-price-quotes-perl.patch \ gnu/packages/patches/gnupg-simple-query-ignore-status-messages.patch \ gnu/packages/patches/gobject-introspection-absolute-shlib-path.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 32ff5a8..acca111 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -4959,3 +4959,42 @@ specified duration and save it as a GIF encoded animated image file.") "Libzapojit is a GLib-based library for accessing online service APIs of Microsoft SkyDrive and Hotmail, using their REST protocols.") (license license:lgpl2.1+))) + +(define-public gnome-tweak-tool + (package + (name "gnome-tweak-tool") + (version "3.20.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://gnome/sources/gnome-tweak-tool/" + (version-major+minor version) "/" + "gnome-tweak-tool-" version ".tar.xz")) + (patches (list + (search-patch "gnome-tweak-tool-search-paths.patch"))) + (sha256 + (base32 + "1nr5m7ziij7jrfkpm4rsk089vgcpwpm90x9lfl7m918zayawrfk0")))) + (build-system gnu-build-system) + (arguments + `(#:configure-flags '("--localstatedir=/tmp" + "--sysconfdir=/tmp"))) + (propagated-inputs + `(("gobject-introspection" ,gobject-introspection) + ("gnome-shell" ,gnome-shell) + ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) + ("gtk+" ,gtk+) + ("libnotify" ,libnotify) + ("mutter" ,mutter) + ("python2" ,python-2) + ("python2-pygobject" ,python2-pygobject))) + (native-inputs + `(("intltool" ,intltool) + ("pkg-config" ,pkg-config))) + (synopsis "Customize advanced GNOME 3 options") + (home-page "https://wiki.gnome.org/action/show/Apps/GnomeTweakTool") + (description + "GNOME Tweak Tool allows adjusting advanced configuration settings in +GNOME 3. This includes things like the fonts used in user interface elements, +alternative user interface themes, changes in window management behavior, +GNOME Shell appearance and extension, etc.") + (license license:gpl3+))) diff --git a/gnu/packages/patches/gnome-tweak-tool-search-paths.patch b/gnu/packages/patches/gnome-tweak-tool-search-paths.patch new file mode 100644 index 0000000..027c61b --- /dev/null +++ b/gnu/packages/patches/gnome-tweak-tool-search-paths.patch @@ -0,0 +1,52 @@ +Gnome-tweak-tool does not look at GSETTINGS_SCHEMA_PATH or XDG_DATA_DIRS, it +assumes that schemas are installed in one global directory +(GSETTINGS_SCHEMA_DIR/gsettingsschemadir). + +Guix/GuixSD uses a different directory for every gir package and has +packages pick-up files using XDG_DATA_DIRS. + +Upstream ticket: https://bugzilla.gnome.org/show_bug.cgi?id=764537 +janneke@gnu.org + +--- gnome-tweak-tool-3.18.1.orig/gtweak/gsettings.py 2015-04-08 15:21:32.000000000 +0200 ++++ gnome-tweak-tool-3.18.1/gtweak/gsettings.py 2016-04-03 11:26:38.658482704 +0200 +@@ -16,7 +16,8 @@ + # along with gnome-tweak-tool. If not, see . + + import logging +-import os.path ++import os ++import sys + import xml.dom.minidom + import gettext + +@@ -31,6 +32,13 @@ + class GSettingsMissingError(Exception): + pass + ++def file_from_path(path, file_name): ++ for dir in path: ++ f = os.path.join(dir, file_name) ++ if os.path.exists(f): ++ return f ++ return None ++ + class _GSettingsSchema: + def __init__(self, schema_name, schema_dir=None, schema_filename=None, **options): + if not schema_dir: +@@ -38,9 +46,14 @@ + if not schema_filename: + schema_filename = schema_name + ".gschema.xml" + ++ schema_prefix = os.path.join('glib-2.0', 'schemas') + schema_path = os.path.join(schema_dir, schema_filename) + if not os.path.exists(schema_path): +- logging.critical("Could not find schema %s" % schema_path) ++ schema_path = file_from_path(os.environ.get ('GSETTINGS_SCHEMA_PATH', '').split(os.path.pathsep), schema_filename) ++ if not (schema_path and os.path.exists(schema_path)): ++ schema_path = file_from_path(os.environ.get ('XDG_DATA_DIRS', '').split(os.path.pathsep), os.path.join(schema_prefix, schema_filename)) ++ if not (schema_path and os.path.exists(schema_path)): ++ logging.critical("Could not find schema %s" % schema_filename) + assert(False) + + self._schema_name = schema_name -- 2.1.4 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20 --=-=-=--