gnu: Add eject.

DoneSubmitted by Raghav Gururajan.
Details
4 participants
  • Danny Milosavljevic
  • Jan Nieuwenhuizen
  • Tobias Geerinckx-Rice
  • Raghav Gururajan
Owner
unassigned
Severity
normal
R
R
Raghav Gururajan wrote on 21 Apr 2020 22:22
(address . guix-patches@gnu.org)
20200421162206.527fd8c8.raghavgururajan@disroot.org
From a7fcab4e6ea2e61c4a18520a1a462250a503eba7 Mon Sep 17 00:00:00 2001
From: Raghav Gururajan <raghavgururajan@disroot.org>
Date: Tue, 21 Apr 2020 16:20:27 -0400
Subject: [PATCH 2/2] gnu: Add eject.

* gnu/packages/disk.scm (eject): New variable.
---
gnu/packages/disk.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 573cc88c34..8b2a432e9c 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -66,6 +66,7 @@
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages samba)
+  #:use-module (gnu packages scsi)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
@@ -86,6 +87,41 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages))
 
+(define-public eject
+  (package
+    (name "eject")
+    (version "2019.08.22")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://git.code.sf.net/p/eject/git")
+         (commit "12a22e")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1dxj0zn32l8k16j5innh8y4snambx1b702ny37114drddqcqac6h"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; No target
+       #:make-flags
+       (list
+        (string-append "PREFIX=" (assoc-ref %outputs "out")))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("gettext" ,gettext-minimal)))
+    (inputs
+     `(("lvm2" ,lvm2)
+       ("sg3-utils" ,sg3-utils)))
+    (synopsis "Utility for Removable Media")
+    (description "Eject allows removable media (typically a CD-ROM, floppy disk,
+tape, or JAZ or ZIP disk) to be ejected under software control.  The command can
+also control some multi-disc CD-ROM changers, the auto-eject feature supported
+by some devices, and close the disc tray of some CD-ROM drives. ")
+    (home-page "http://eject.sourceforge.net")
+    (license license:gpl2+)))
+
 (define-public udevil
   (package
     (name "udevil")
-- 
2.26.1
T
T
Tobias Geerinckx-Rice wrote on 22 Apr 2020 00:28
(address . 40752@debbugs.gnu.org)
87zhb4wk1d.fsf@nckx
Raghav,

Thanks for the patch! Amazing that this wasn't in Guix yet. Even
more amazing that I didn't package it.

Raghav Gururajan 写道:
+(define-public eject
+ (package
+ (name "eject")
+ (version "2019.08.22")

You've been around long enough to know how we package git releases
:-) Certainly not like this.

More like

;; Comment explaining why we use a git snapshot.
(let ((commit "12a22e…")
(revision "0"))
(package …
(version (git version "2.1.…" revision commit))

please.

Upstream[0 ]says there's a 2.1.6 version, but it may exist nowhere
but in the author's mind. If you do find a tarball, tag, or
corresponding commit, use it, or explain in a comment why 12a22e
is better.

+ (source
+ (origin
+ (method git-fetch)
+ (uri
+ (git-reference
+ (commit "12a22e")))

Please don't abbreviate commits like this.

+ (file-name (git-file-name name version))

Yay!

+ (sha256
+ (base32
"1dxj0zn32l8k16j5innh8y4snambx1b702ny37114drddqcqac6h"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; No target

Write ‘; no test suite’ instead, which is to be expected from a
package like this.

‘No target’ makes it sound like who knows, there might be tests,
but there's no make rule to run them, so we don't. Not a good
look.

+ #:make-flags
+ (list

Hm? Eh? Oh… Please insert a comment here:

;; ./configure respects --prefix=; the handwritten
po/Makefile doesn't.

+ (string-append "PREFIX=" (assoc-ref %outputs "out")))))
+ (native-inputs
+ `(("autoconf" ,autoconf)
+ ("automake" ,automake)
+ ("gettext" ,gettext-minimal)))
+ (inputs
+ `(("lvm2" ,lvm2)
+ ("sg3-utils" ,sg3-utils)))
+ (synopsis "Utility for Removable Media")

…is too vague. And this is worse:

+ (description "Eject allows removable media (typically a
CD-ROM, floppy disk,
+tape, or JAZ or ZIP disk) to be ejected under software control.
The command can
+also control some multi-disc CD-ROM changers, the auto-eject
feature supported
+by some devices, and close the disc tray of some CD-ROM
drives. ")

I know this is upstream's handiwork; not yours, but crikey.

Always feel free to edit the hell out of these texts. ‘Software
Foo allows gizmos to be frobbed under software control’? → ‘Foo
frobs gizmos’. Done.

A quick attempt with some inspiration from Debian:

(synopsis "Eject and safely disconnect removable media")
(description
"This little program will eject CD-ROMs and other ejectable
removable media.
It can also set the auto-eject feature, close the tray of some
CD-ROM drives,
and select the active disc in supported multi-disc changers.

You can also use @command{eject} to properly disconnect external
mass-storage
devices like mobile phones, digital cameras, or portable music
players.")

+ (home-page "http://eject.sourceforge.net")
+ (license license:gpl2+)))
+

I wasn't able to apply & test this patch; I guess ‘udevil’ is
still under review. I don't have time to review it as well.

Please: try to add new packages in alphabetical order, NOT blindly
to the beginning or end of files. For once, this has nothing
(well, less) to do with my obsession for ordnung. It makes
annoying issues like this less likely.

It doesn't matter that most package .scm files are an unordered
mess: if you'd added eject near the beginning and udevil near the
end, the two unrelated packages wouldn't conflict.

Kind regards,

T G-R

-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXp9zjgAKCRANsP+IT1Vt
eUdzAQCsY3wEcy5Wwp+VBVbDNRO1WPxYlVgb4kiLHojKIq3MFAD9EHeMA+3UW3oN
qVfabUaMLmd8q4vFClbgSyhCvvtqtwo=
=B1RC
-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 22 Apr 2020 08:55
(name . Raghav Gururajan)(address . raghavgururajan@disroot.org)(address . 40752@debbugs.gnu.org)
20200422085501.161d6605@scratchpost.org
Hmm, how is this different to util-linux's eject ?
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl6f6kUACgkQ5xo1VCww
uqVfIQf+NlOSYRZc1ii39Sd7Rti6HK9ORNbrKk8AeHdFSyDu3S/UrJFm68W0sFJi
uZ0oaZHqTJmL9PTD1QEOKnyejlQrnZNROfngN0z8EzsyjHWtyw/rH+vBrbkwgLgw
CMXfNFBNKG+o8yQ09c/Wk/usPJ2ZAjzM7bDWS4Yap31pg9sPlp/3Y1Zk+yI4HRCF
UGr3E33cPqOxLcBtDlLYuzrrMcV8jHYY5I81TyFhK7/zLFGQwZ61IpIoZi+8vGMJ
GCnasV/Jq7727hQzl98mTYb/hKtcwVHE75O/6BuuFC3auaBF2s+nvKzwfqh+wnGi
1GrzSRnemuGe4Uylr7yKFOMYOhqeJw==
=ALEd
-----END PGP SIGNATURE-----


R
R
Raghav Gururajan wrote on 23 Apr 2020 03:21
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 40752@debbugs.gnu.org)
20200422212110.0b1e978b.raghavgururajan@disroot.org
Hi Danny!

Toggle quote (2 lines)
> Hmm, how is this different to util-linux's eject ?

There is no difference, but for some reason SpaceFM use this as dependency.
This is has been packaged for the sole purpose of SpaceFM (#40753). :-)

Regards,
RG.
J
J
Jan Nieuwenhuizen wrote on 23 Apr 2020 08:16
(name . Raghav Gururajan)(address . raghavgururajan@disroot.org)
87k12620bp.fsf@gnu.org
Raghav Gururajan writes:

Toggle quote (5 lines)
>> Hmm, how is this different to util-linux's eject ?
>
> There is no difference, but for some reason SpaceFM use this as dependency.
> This is has been packaged for the sole purpose of SpaceFM (#40753). :-)

This page


suggests that on Arch, SpaceFM is using eject from util-linux. Wouldn't
it be nice to do that in Guix too? Maybe you can see how they did it?

Greetings,
janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
R
R
Raghav Gururajan wrote on 24 Apr 2020 20:46
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
20200424144621.6c832973.raghavgururajan@disroot.org
Hi Jan!

Toggle quote (7 lines)
> This page
>
> https://aur.archlinux.org/packages/spacefm/
>
> suggests that on Arch, SpaceFM is using eject from util-linux. Wouldn't
> it be nice to do that in Guix too? Maybe you can see how they did it?

Thanks for the info. I tried and it works. But I am wondering why to use
'util-linux' package just for one utility. This 'eject' package will be
smaller dependency than 'util-linux' package. What do you think?

Regards,
RG.
R
R
Raghav Gururajan wrote on 24 Apr 2020 21:02
(name . Jan Nieuwenhuizen)(address . janneke@gnu.org)
20200424150241.62024541.raghavgururajan@disroot.org
On Fri, 24 Apr 2020 14:46:21 -0400
Raghav Gururajan <raghavgururajan@disroot.org> wrote:

Toggle quote (13 lines)
> Hi Jan!
>
> > This page
> >
> > https://aur.archlinux.org/packages/spacefm/
> >
> > suggests that on Arch, SpaceFM is using eject from util-linux. Wouldn't
> > it be nice to do that in Guix too? Maybe you can see how they did it?
>
> Thanks for the info. I tried and it works. But I am wondering why to use
> 'util-linux' package just for one utility. This 'eject' package will be
> smaller dependency than 'util-linux' package. What do you think?

On the second thought, 'util-linux' is better maintained. So I'll close this
ticket.

Regards,
RG.
R
R
Raghav Gururajan wrote on 24 Apr 2020 21:05
(no subject)
(address . control@debbugs.gnu.org)
20200424150533.0b9f68bb.raghavgururajan@disroot.org
close 40752
?
Your comment

This issue is archived.

To comment on this conversation send email to 40752@debbugs.gnu.org