From: Hartmut Goebel <h.goebel@crazy-compilers.com>
To: 38122@debbugs.gnu.org
Cc: Guillaume Le Vaillant <glv@posteo.net>
Subject: [bug#38122] [PATCH 009/197] gnu: Add udiskie.
Date: Fri, 8 Nov 2019 11:33:37 +0100 [thread overview]
Message-ID: <20191108103434.8390-10-h.goebel@crazy-compilers.com> (raw)
In-Reply-To: <20191108103434.8390-1-h.goebel@crazy-compilers.com>
From: Guillaume Le Vaillant <glv@posteo.net>
* gnu/packages/freedesktop.scm (udiskie): New variable.
* gnu/packages/patches/udiskie-no-appindicator.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/freedesktop.scm | 63 +++++++
.../patches/udiskie-no-appindicator.patch | 155 ++++++++++++++++++
3 files changed, 219 insertions(+)
create mode 100644 gnu/packages/patches/udiskie-no-appindicator.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 41c5a92a0a..96b570a759 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1386,6 +1386,7 @@ dist_patch_DATA = \
%D%/packages/patches/tuxpaint-stamps-path.patch \
%D%/packages/patches/txr-shell.patch \
%D%/packages/patches/u-boot-fix-mkimage-header-verification.patch \
+ %D%/packages/patches/udiskie-no-appindicator.patch \
%D%/packages/patches/unzip-CVE-2014-8139.patch \
%D%/packages/patches/unzip-CVE-2014-8140.patch \
%D%/packages/patches/unzip-CVE-2014-8141.patch \
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index b18d71cb98..2574153cef 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -15,6 +15,7 @@
;;; Copyright © 2018 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2018 Stefan Stefanović <stefanx2ovic@gmail.com>
;;; Copyright © 2019 Reza Alizadeh Majd <r.majd@pantherx.org>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -74,6 +75,7 @@
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages polkit)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages sqlite)
#:use-module (gnu packages valgrind)
@@ -1439,3 +1441,64 @@ encoding names are iconv-compatible.")
;; This combines code under MPL 1.1, LGPL 2.1+, and GPL 2.0+, so the
;; combination is GPL 2.0+.
(license license:gpl2+)))
+
+(define-public udiskie
+ (package
+ (name "udiskie")
+ (version "1.7.7")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "udiskie" version))
+ (sha256
+ (base32
+ "121g9dkr7drv9igpdbcbkj59x15mm72rzp3198bp50zj0lr4wbvi"))
+ ;; Remove support for the libappindicator library of the
+ ;; Unity desktop environment which is not in Guix.
+ (patches (search-patches "udiskie-no-appindicator.patch"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("asciidoc" ,asciidoc)
+ ("gettext" ,gettext-minimal)
+ ("gobject-introspection" ,gobject-introspection)))
+ (inputs
+ `(("gobject-introspection" ,gobject-introspection)
+ ("gtk+" ,gtk+)
+ ("libnotify" ,libnotify)
+ ("udisks" ,udisks)))
+ (propagated-inputs
+ `(("python-docopt" ,python-docopt)
+ ("python-pygobject" ,python-pygobject)
+ ("python-keyutils" ,python-keyutils)
+ ("python-pyxdg" ,python-pyxdg)
+ ("python-pyyaml" ,python-pyyaml)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'install 'wrap-gi-typelib
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
+ (wrap-program (string-append out "/bin/udiskie")
+ `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
+ #t)))))
+ (home-page "https://github.com/coldfix/udiskie")
+ (synopsis "Automounter for removable media")
+ (description
+ "The @command{udiskie} program is a udisks2 front-end that allows to
+manage removable media such as CDs or flash drives from userspace.
+
+Its features include:
+
+@itemize
+@item automount removable media,
+@item notifications,
+@item tray icon,
+@item command line tools for manual (un)mounting,
+@item LUKS encrypted devices,
+@item unlocking with keyfiles,
+@item loop devices (mounting ISO archives),
+@item password caching.
+@end itemize
+")
+ (license license:expat)))
diff --git a/gnu/packages/patches/udiskie-no-appindicator.patch b/gnu/packages/patches/udiskie-no-appindicator.patch
new file mode 100644
index 0000000000..c19099cdaa
--- /dev/null
+++ b/gnu/packages/patches/udiskie-no-appindicator.patch
@@ -0,0 +1,155 @@
+Remove the support for Unity's appindicator.
+
+diff -Naur udiskie-1.7.7/completions/_udiskie udiskie-1.7.7a/completions/_udiskie
+--- udiskie-1.7.7/completions/_udiskie 2019-02-17 18:28:58.000000000 +0100
++++ udiskie-1.7.7a/completions/_udiskie 2019-10-29 14:21:04.556193639 +0100
+@@ -21,8 +21,6 @@
+ '(-a)'{-A,--no-automount}"[disable automounting]"
+ '(-N)'{-n,--notify}"[show popup notifications]"
+ '(-n)'{-N,--no-notify}"[disable notifications]"
+- '(--no-appindicator)'--appindicator"[use appindicator for status icon]"
+- '(--appindicator)'--no-appindicator"[don't use appindicator]"
+ '(-T -s)'{-t,--tray}"[show tray icon]"
+ '(-T -t)'{-s,--smart-tray}"[auto hide tray icon]"
+ '(-t -s)'{-T,--no-tray}"[disable tray icon]"
+diff -Naur udiskie-1.7.7/doc/udiskie.8.txt udiskie-1.7.7a/doc/udiskie.8.txt
+--- udiskie-1.7.7/doc/udiskie.8.txt 2019-02-17 18:28:58.000000000 +0100
++++ udiskie-1.7.7a/doc/udiskie.8.txt 2019-10-29 14:21:52.304570344 +0100
+@@ -95,12 +95,6 @@
+ *-F, \--no-file-manager*::
+ Disable browsing.
+
+-*-appindicator*::
+- Use AppIndicator3 for the status icon. Use this on Ubuntu/Unity if no icon is shown.
+-
+-*--no-appindicator*::
+- Use Gtk.StatusIcon for the status icon (default).
+-
+ *--password-cache MINUTES*::
+ Cache passwords for LUKS partitions and set the timeout.
+
+diff -Naur udiskie-1.7.7/udiskie/appindicator.py udiskie-1.7.7a/udiskie/appindicator.py
+--- udiskie-1.7.7/udiskie/appindicator.py 2019-02-17 18:28:58.000000000 +0100
++++ udiskie-1.7.7a/udiskie/appindicator.py 1970-01-01 01:00:00.000000000 +0100
+@@ -1,61 +0,0 @@
+-"""
+-Status icon using AppIndicator3.
+-"""
+-
+-from gi.repository import Gtk
+-from gi.repository import AppIndicator3
+-
+-from udiskie.async_ import Async
+-
+-
+-class AppIndicatorIcon(object):
+-
+- """
+- Show status icon using AppIndicator as backend. Replaces
+- `udiskie.tray.StatusIcon` on ubuntu/unity.
+- """
+-
+- def __init__(self, menumaker, _icons):
+- self._maker = menumaker
+- self._menu = Gtk.Menu()
+- self._indicator = AppIndicator3.Indicator.new(
+- 'udiskie',
+- _icons.get_icon_name('media'),
+- AppIndicator3.IndicatorCategory.HARDWARE)
+- self._indicator.set_status(AppIndicator3.IndicatorStatus.PASSIVE)
+- self._indicator.set_menu(self._menu)
+- # Get notified before menu is shown, see:
+- # https://bugs.launchpad.net/screenlets/+bug/522152/comments/15
+- dbusmenuserver = self._indicator.get_property('dbus-menu-server')
+- self._dbusmenuitem = dbusmenuserver.get_property('root-node')
+- self._conn = self._dbusmenuitem.connect('about-to-show', self._on_show)
+- self.task = Async()
+- menumaker._quit_action = self.destroy
+- # Populate menu initially, so libdbusmenu does not ignore the
+- # 'about-to-show':
+- self._maker(self._menu)
+-
+- def destroy(self):
+- self.show(False)
+- self._dbusmenuitem.disconnect(self._conn)
+- self.task.callback()
+-
+- @property
+- def visible(self):
+- status = self._indicator.get_status()
+- return status == AppIndicator3.IndicatorStatus.ACTIVE
+-
+- def show(self, show=True):
+- if show == self.visible:
+- return
+- status = (AppIndicator3.IndicatorStatus.ACTIVE if show else
+- AppIndicator3.IndicatorStatus.PASSIVE)
+- self._indicator.set_status(status)
+-
+- def _on_show(self, menu):
+- # clear menu:
+- for item in self._menu.get_children():
+- self._menu.remove(item)
+- # repopulate:
+- self._maker(self._menu)
+- self._menu.show_all()
+diff -Naur udiskie-1.7.7/udiskie/cli.py udiskie-1.7.7a/udiskie/cli.py
+--- udiskie-1.7.7/udiskie/cli.py 2019-02-17 18:28:58.000000000 +0100
++++ udiskie-1.7.7a/udiskie/cli.py 2019-10-29 14:18:22.678919186 +0100
+@@ -376,9 +376,6 @@
+ -T, --no-tray Disable tray icon
+ -m MENU, --menu MENU Tray menu [flat/nested]
+
+- --appindicator Use appindicator for status icon
+- --no-appindicator Don't use appindicator
+-
+ --password-cache MINUTES Set password cache timeout
+ --no-password-cache Disable password cache
+
+@@ -400,7 +397,6 @@
+ 'notify': True,
+ 'tray': False,
+ 'menu': 'flat',
+- 'appindicator': False,
+ 'file_manager': 'xdg-open',
+ 'password_prompt': 'builtin:gui',
+ 'password_cache': False,
+@@ -415,7 +411,6 @@
+ '--no-tray': False,
+ '--smart-tray': 'auto'}),
+ 'menu': Value('--menu'),
+- 'appindicator': Switch('appindicator'),
+ 'file_manager': OptionalValue('--file-manager'),
+ 'password_prompt': OptionalValue('--password-prompt'),
+ 'password_cache': OptionalValue('--password-cache'),
+@@ -541,11 +536,7 @@
+ raise ValueError("Invalid menu: %s" % (options['menu'],))
+
+ menu_maker = udiskie.tray.UdiskieMenu(self, icons, actions, flat)
+- if options['appindicator']:
+- import udiskie.appindicator
+- TrayIcon = udiskie.appindicator.AppIndicatorIcon
+- else:
+- TrayIcon = udiskie.tray.TrayIcon
++ TrayIcon = udiskie.tray.TrayIcon
+ trayicon = TrayIcon(menu_maker, icons)
+ return udiskie.tray.UdiskieStatusIcon(trayicon, menu_maker, smart)
+
+diff -Naur udiskie-1.7.7/udiskie.egg-info/SOURCES.txt udiskie-1.7.7a/udiskie.egg-info/SOURCES.txt
+--- udiskie-1.7.7/udiskie.egg-info/SOURCES.txt 2019-02-17 19:42:25.000000000 +0100
++++ udiskie-1.7.7a/udiskie.egg-info/SOURCES.txt 2019-10-29 14:40:09.333315287 +0100
+@@ -24,7 +24,6 @@
+ test/test_cache.py
+ test/test_match.py
+ udiskie/__init__.py
+-udiskie/appindicator.py
+ udiskie/async_.py
+ udiskie/automount.py
+ udiskie/cache.py
+@@ -46,4 +45,4 @@
+ udiskie.egg-info/dependency_links.txt
+ udiskie.egg-info/entry_points.txt
+ udiskie.egg-info/requires.txt
+-udiskie.egg-info/top_level.txt
+\ Pas de fin de ligne à la fin du fichier
++udiskie.egg-info/top_level.txt
--
2.21.0
next prev parent reply other threads:[~2019-11-08 10:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 10:33 [bug#38122] [PATCH 0/1] qtwebkit: Uses sqlite-with-column-metadata Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 001/197] gnu: Add emacs-eshell-prompt-extras Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 1/1] gnu: qtwebkit: Uses sqlite-with-column-metadata Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 002/197] gnu: Add emacs-eshell-did-you-mean Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 003/197] gnu: Fix attribution Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 004/197] gnu: make-nsis: Fix cross-compilation Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 005/197] gnu: Add dxvk Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 006/197] gnu: Fix make-gcc-libc Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 007/197] gnu: Add gitg Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 008/197] gnu: Add python-keyutils Hartmut Goebel
2019-11-08 10:33 ` Hartmut Goebel [this message]
2019-11-08 10:33 ` [bug#38122] [PATCH 010/197] services: ntp: Ensure no double quotes are output to config file Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 011/197] gnu: pingus: Update source URI Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 012/197] gnu: pingus: Adjust for GCC 7 Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 013/197] gnu: Remove python2-feather-format Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 014/197] gnu: u-boot: Remove redundant GCC input Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 015/197] gnu: pocl: Update to 1.4 Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 016/197] gnu: icecat: Update to 68.2.0-guix0-preview3 Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 017/197] gnu: Chibi-Scheme: Update to 0.8 Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 018/197] gnu: Chibi-Scheme: Do not use unstable tarball Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 019/197] gnu: bitcoin-abc: Update to 0.20.4 Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 020/197] services: ntp: Fix a crash when using legacy configuration Hartmut Goebel
2019-11-08 10:33 ` [bug#38122] [PATCH 021/197] gnu: musescore: Update to 3.3 Hartmut Goebel
2019-11-08 10:36 ` bug#38122: Faulty patchset Hartmut Goebel
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=20191108103434.8390-10-h.goebel@crazy-compilers.com \
--to=h.goebel@crazy-compilers.com \
--cc=38122@debbugs.gnu.org \
--cc=glv@posteo.net \
/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).