[bug#34758,1/4] gnu: Add libmirage.

Message ID 20190305172620.20118-1-mail@ambrevar.xyz
State Accepted
Headers show
Series [bug#34758,1/4] gnu: Add libmirage. | expand

Checks

Context Check Description
cbaines/comparison success View comparison
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied

Commit Message

Pierre Neidhardt March 5, 2019, 5:26 p.m. UTC
* gnu/packages/cdrom.scm (libmirage): New variable.
---
 gnu/packages/cdrom.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

Pierre Neidhardt March 5, 2019, 5:44 p.m. UTC | #1
libmirage, cdemu-daemon and cdemu-client seems to be fine.

The VHBA kernel module is not package properly and this a blocker for
cdemu-daemon.

1. This raises the more general issue of building kernel modules on Guix.

For the record, here is the VHBA makefile:

--8<---------------cut here---------------start------------->8---
VHBA_VERSION := 20170610

KERNELRELEASE ?= $(shell uname -r)
KDIR ?= /lib/modules/$(KERNELRELEASE)/build
PWD ?= $(shell pwd)

obj-m := vhba.o
ccflags-y := -DVHBA_VERSION=\"$(VHBA_VERSION)\" -Werror

default: modules
install: modules_install

modules modules_install clean:
	$(MAKE) -C $(KDIR) M=$(PWD) $@
--8<---------------cut here---------------end--------------->8---

As you can see, it relies on the Makefile (and probably a bunch of other
files) in /lib/modules/$(KERNELRELEASE)/build.

In our linux-libre package, "build" is a broken symlink, e.g. to
/tmp/guix-build-linux-libre-4.20.12.../linux-4.20.12.

Shouldn't we include this folder in the linux-libre package?  Without
it, I can't see how to build kernel modules.

Once we have this, we will be able to build vhba-module.



2. Next question: how do we load this module?  In `operating-system' we
have `initrd-modules', but in this case vhba is probably not needed in
the initrd.  What we really want, I think, is a union of kernel modules
in say

/run/booted-system/kernel/lib/modules/4.20.7/

Makes sense?

Thoughts?

--
Pierre Neidhardt
https://ambrevar.xyz/
Ludovic Courtès March 22, 2019, 9:10 p.m. UTC | #2
Hello Pierre,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> * gnu/packages/cdrom.scm (libmirage): New variable.

[...]

> +              (uri (string-append
> +                    "https://downloads.sourceforge.net/cdemu/libmirage-"

Please use mirror://sourceforge instead (in the other patches as well).

> +    (home-page "https://cdemu.sourceforge.io/")
> +    (synopsis "CD-ROM image (B6T/C2D/CCD/CDI/CIF/CUE/ISO/MDS/MDX/NRG/TOC) access library")

I’d remove the list that’s in parentheses here.

Otherwise LGTM, thanks!

Ludo’.

Patch

diff --git a/gnu/packages/cdrom.scm b/gnu/packages/cdrom.scm
index cdbe25fe4..846ce705b 100644
--- a/gnu/packages/cdrom.scm
+++ b/gnu/packages/cdrom.scm
@@ -860,3 +860,31 @@  Supported extensions to ISO 9660 are Rock Ridge, Joliet, AAIP, zisofs.")
 blanking CD-RW media, creating ISO-9660 file system images, extracting audio
 CD data, and more.  It's mostly compatible with @code{cdrtools}.")
     (license gpl2+)))
+
+(define-public libmirage
+  (package
+    (name "libmirage")
+    (version "3.2.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://downloads.sourceforge.net/cdemu/libmirage-"
+                    version ".tar.bz2"))
+              (sha256
+               (base32
+                "1ydph33sfxplp4872dp8ghp574jk5d4qr8hqz61qnznq1b11cnbr"))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("intltool" ,intltool)))
+    (inputs
+     `(("glib" ,glib)))
+    (arguments
+     ;; No tests.
+     '(#:tests? #f))
+    (home-page "https://cdemu.sourceforge.io/")
+    (synopsis "CD-ROM image (B6T/C2D/CCD/CDI/CIF/CUE/ISO/MDS/MDX/NRG/TOC) access library")
+    (description "libMirage is a CD-ROM image access library.  It is written
+in C and based on GLib.  Its aim is to provide uniform access to the data
+stored in various image formats.")
+    (license gpl2+)))