From c2426b83876dc27308b6678456012efb0c02a2a0 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: Add it. * gnu/packages/gnome.scm (gnome-tweak-tool): New variable. --- gnu-system.am | 1 + gnu/packages/gnome.scm | 42 ++++++++++++++++++++++ .../patches/gnome-tweak-tool-search-paths.patch | 42 ++++++++++++++++++++++ 3 files changed, 85 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..12e03f0 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -4959,3 +4959,45 @@ 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.18.1") + (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 + "0c4lw9fhflvpa5l5jsr70aqxcmvhdgh43ab35ly42j3n4c1i2b2w")))) + (build-system gnu-build-system) + (arguments + '(#:phases + (modify-phases %standard-phases + (replace 'install + (lambda _ + (zero? (system* "make" + "sysconfdir=/tmp" + "localstatedir=/tmp" + "install"))))))) + (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 "Gnome Tweak Tool") + (home-page "https://wiki.gnome.org/action/show/Apps/GnomeTweakTool") + (description + "GNOME Tweak Tool allows the adjustment of several advanced GNOME +options that can't be configured in gnome-control-center.") + (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..06d5298 --- /dev/null +++ b/gnu/packages/patches/gnome-tweak-tool-search-paths.patch @@ -0,0 +1,42 @@ +--- 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.6.3