[PATCH 0/2] gnu: Add udiskie.

  • Done
  • quality assurance status badge
Details
2 participants
  • Guillaume Le Vaillant
  • Pierre Neidhardt
Owner
unassigned
Submitted by
Guillaume Le Vaillant
Severity
normal
G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 10:26
(address . guix-patches@gnu.org)
87r22v6gxv.fsf@yamatai
This patch series adds the udiskie frontend for udisks.

Patches:
- gnu: Add python-keyutils.
- gnu: Add udiskie

Note: I'm not familiar with the python build system, and I couldn't get
the tests for python-keyutils to work. So if you're a pythoner with some
free time, please check if you can get them to work.
G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 10:31
[PATCH 1/2] gnu: Add python-keyutils.
(address . 37975@debbugs.gnu.org)(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20191029093135.32727-1-glv@posteo.net
* gnu/packages/python-crypto.scm (python-keyutils): New variable.
---
gnu/packages/python-crypto.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index f05c01060f..7dac25eb61 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1062,3 +1063,30 @@ Password-Authenticated Key Exchange algorithm.")
(description "This package provides a Twisted-based Tor controller client,
with state-tracking and configuration abstractions.")
(license license:expat)))
+
+(define-public python-keyutils
+ (package
+ (name "python-keyutils")
+ (version "0.6")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "keyutils" version))
+ (sha256
+ (base32
+ "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (inputs
+ `(("keyutils" ,keyutils)))
+ (arguments
+ '(#:tests? #f))
+ (home-page "https://github.com/sassoftware/python-keyutils")
+ (synopsis "Python bindings for keyutils")
+ (description
+ "This is a set of python bindings for keyutils, a key management suite
+that leverages the infrastructure provided by the Linux kernel for safely
+storing and retrieving sensitive infromation in your programs.")
+ (license license:asl2.0)))
--
2.23.0
G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 10:31
[PATCH 2/2] gnu: Add udiskie.
(address . 37975@debbugs.gnu.org)(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20191029093135.32727-2-glv@posteo.net
* gnu/packages/freedesktop.scm (udiskie): New variable.
---
gnu/packages/freedesktop.scm | 61 ++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)

Toggle diff (85 lines)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index b18d71cb98..67d587ee48 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,62 @@ 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"))))
+ (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
+ `(;; The tests want libappindicator, which is not available.
+ #:tests? #f
+ #: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 udiskie program is a udisks2 front-end that allows to manage
+removeable 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)))
--
2.23.0
P
P
Pierre Neidhardt wrote on 29 Oct 2019 12:10
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 37975@debbugs.gnu.org)
87a79jerjc.fsf@ambrevar.xyz
Hi Guillaume,

Looking great, just a few nits below:

Toggle quote (3 lines)
> + (arguments
> + `(;; The tests want libappindicator, which is not available.

Why isn't available? Should we package it? URL of the lib?

Toggle quote (15 lines)
> + #:tests? #f
> + #: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 udiskie program is a udisks2 front-end that allows to manage

@command{udiskie}.

Toggle quote (2 lines)
> +removeable media such as CDs or flash drives from userspace.

Typo: removable.

Toggle quote (9 lines)
> +
> +Its features include:
> +
> +@itemize
> +@item automount removable media
> +@item notifications
> +@item tray icon
> +@item command line tools for manual un-/mounting

I find the "-/" syntax a bit unconventional. Maybe "(un)mounting" would be
better.
In doubt, "mounting and unmounting" works in all cases :)

Toggle quote (4 lines)
> +@item LUKS encrypted devices
> +@item unlocking with keyfiles
> +@item loop devices (mounting iso archives)

iso => ISO

Toggle quote (3 lines)
> +@item password caching
> +@end itemize")

=> @end itemize\n

Also maybe improve the typography of the list, e.g. add commas at the
end of every line and a period for the last line.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl24HhcACgkQm9z0l6S7
zH+RoQf7BbufoR8W6nX0gTbqlgobWjgwM4Okdus214jVF14vE3wk7kzhB7T3tQED
9iVQaic/uPnrlH0zx2Rc+/wRxCRL59g0ZMxzhKmRkZt+wVHAT5biX8e2fQayPZ4s
GzeJcJko4qHk0KCwm2kJVupZvMC0zrKleUMc304K3n2+W/KJSUSZWmPxMPvX7cAS
Drmr6EfWObBBBzT3ldixUJuWjdIegF5UZxtQqFzXtdmJ5QjVMjL/6IJWb9oyrKOq
Qg8fUZlTa5KPXAV5MYdNGsls0s7ctZz4/lblDdSF1heNLzscxwBnoDMTV/eeDudl
dk+mMJWh9/AxdgmbsuB1W9c4OZHg3Q==
=vVqk
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 15:02
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 37975@debbugs.gnu.org)
87o8xz646a.fsf@yamatai
Pierre Neidhardt skribis:

Toggle quote (5 lines)
>> + (arguments
>> + `(;; The tests want libappindicator, which is not available.
>
> Why isn't available? Should we package it? URL of the lib?

Apparently libappindicator is a library for the Unity desktop
environment. I think it does not make much sense to add it as Unity is
not in Guix. Instead I added a patch removing the support for
libappindicator from udiskie.
G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 15:03
[PATCH v2 1/2] gnu: Add python-keyutils.
(address . 37975@debbugs.gnu.org)(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20191029140352.3093-1-glv@posteo.net
* gnu/packages/python-crypto.scm (python-keyutils): New variable.
---
gnu/packages/python-crypto.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index f05c01060f..7dac25eb61 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1062,3 +1063,30 @@ Password-Authenticated Key Exchange algorithm.")
(description "This package provides a Twisted-based Tor controller client,
with state-tracking and configuration abstractions.")
(license license:expat)))
+
+(define-public python-keyutils
+ (package
+ (name "python-keyutils")
+ (version "0.6")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "keyutils" version))
+ (sha256
+ (base32
+ "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (inputs
+ `(("keyutils" ,keyutils)))
+ (arguments
+ '(#:tests? #f))
+ (home-page "https://github.com/sassoftware/python-keyutils")
+ (synopsis "Python bindings for keyutils")
+ (description
+ "This is a set of python bindings for keyutils, a key management suite
+that leverages the infrastructure provided by the Linux kernel for safely
+storing and retrieving sensitive infromation in your programs.")
+ (license license:asl2.0)))
--
2.23.0
G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 15:03
[PATCH v2 2/2] gnu: Add udiskie.
(address . 37975@debbugs.gnu.org)(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20191029140352.3093-2-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 | 61 +++++++
.../patches/udiskie-no-appindicator.patch | 155 ++++++++++++++++++
3 files changed, 217 insertions(+)
create mode 100644 gnu/packages/patches/udiskie-no-appindicator.patch

Toggle diff (258 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1b04485422..01ab967148 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1387,6 +1387,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..91c0a70b9c 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,62 @@ 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"))
+ (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.23.0
P
P
Pierre Neidhardt wrote on 29 Oct 2019 15:17
Re: [bug#37975] [PATCH 2/2] gnu: Add udiskie.
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 37975@debbugs.gnu.org)
87v9s7skj4.fsf@ambrevar.xyz
Guillaume Le Vaillant <glv@posteo.net> writes:

Toggle quote (5 lines)
> Apparently libappindicator is a library for the Unity desktop
> environment. I think it does not make much sense to add it as Unity is
> not in Guix. Instead I added a patch removing the support for
> libappindicator from udiskie.

Alright, could you the just explain this in the comment?
Thanks!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl24Sg8ACgkQm9z0l6S7
zH+dbAf8DVbOGNchhvyKOmYDIsyw/i/or7uwvHDr5D+Rkd8+nr6Kp/haMp/UFVwJ
6IrrOzzyD9GjjFI/0Q2dF/nNiO5HYFrBAcM4axCL2LbgB/07GVKClLXrbwNZ+1dw
U35rguoo8VPfj+B2EfL6TkeKQg9gn5jh0C9gWp+HuwgW39npJ1vPH50uQZ67EDMr
xUJ+dfJsilPPdoyRgiMuHOPRG07JOItL5UOHIl0Ws57h0895br99+GPc1s89EWVa
cQBJvLKm3s+xBvFkCo/WnsNCxbdAAk4IQXRLTXbvApXTel3JH7jEI9IMoPR15dax
kkWZPaz8DihHE3+FJaiRzWsBzvqnCQ==
=J0jD
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 16:14
[PATCH v3 1/2] gnu: Add python-keyutils.
(address . 37975@debbugs.gnu.org)(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20191029151414.1654-1-glv@posteo.net
* gnu/packages/python-crypto.scm (python-keyutils): New variable.
---
gnu/packages/python-crypto.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index f05c01060f..7dac25eb61 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -19,6 +19,7 @@
;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
;;; Copyright © 2018 Nam Nguyen <namn@berkeley.edu>
+;;; Copyright © 2019 Guillaume Le Vaillant <glv@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1062,3 +1063,30 @@ Password-Authenticated Key Exchange algorithm.")
(description "This package provides a Twisted-based Tor controller client,
with state-tracking and configuration abstractions.")
(license license:expat)))
+
+(define-public python-keyutils
+ (package
+ (name "python-keyutils")
+ (version "0.6")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "keyutils" version))
+ (sha256
+ (base32
+ "0lipygpzhwzzsq2k5imb1jgkmj8y4khxdwhzadjs3bd56g6bmkx9"))))
+ (build-system python-build-system)
+ (native-inputs
+ `(("python-pytest" ,python-pytest)
+ ("python-pytest-runner" ,python-pytest-runner)))
+ (inputs
+ `(("keyutils" ,keyutils)))
+ (arguments
+ '(#:tests? #f))
+ (home-page "https://github.com/sassoftware/python-keyutils")
+ (synopsis "Python bindings for keyutils")
+ (description
+ "This is a set of python bindings for keyutils, a key management suite
+that leverages the infrastructure provided by the Linux kernel for safely
+storing and retrieving sensitive infromation in your programs.")
+ (license license:asl2.0)))
--
2.23.0
G
G
Guillaume Le Vaillant wrote on 29 Oct 2019 16:14
[PATCH v3 2/2] gnu: Add udiskie.
(address . 37975@debbugs.gnu.org)(name . Guillaume Le Vaillant)(address . glv@posteo.net)
20191029151414.1654-2-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

Toggle diff (260 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1b04485422..01ab967148 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1387,6 +1387,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.23.0
P
P
Pierre Neidhardt wrote on 30 Oct 2019 17:53
Re: [bug#37975] [PATCH v3 1/2] gnu: Add python-keyutils.
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 37975@debbugs.gnu.org)
87h83q6up7.fsf@ambrevar.xyz
Merged, thanks a lot for this very useful package!

--
Pierre Neidhardt
P
P
Pierre Neidhardt wrote on 30 Oct 2019 17:53
control message for bug #37975
(address . control@debbugs.gnu.org)
87ftja6uoz.fsf@ambrevar.xyz
close 37975
quit
?