Re: Tiny Guix (and containers)

2017-10-28 Thread Ludovic Courtès
Hi,

Hartmut Goebel  skribis:

> Am 26.10.2017 um 12:42 schrieb Pjotr Prins:
>> Yes, I think that is what we should head for eventually. I vaguely
>> remember a discussion about this on this ML and people were against
>> separate outputs for doc, include, static-lib etc.  What are you all
>> thinking now? Does it make sense to have the base package as small as
>> possible and split out the rest?
>
> I'm in favor of (automatically?) splitting of "development" packages,
> including the headers and the static libs (much like the "-devel" or
> "-dev" packages in other distributions. One does not need them on a
> production system and they are just wasting space. When Guix needs to
> build a package, it automatically installs the ":devel" output of all
> it's inputs.

We could do that (the Nixpkgs folks did exactly that a while back), but
it won’t help that much.  What does help is running ‘guix size’, looking
at specific packages that are problematic, then finding a solution for
these packages—and often enough the solution is non-trivial.

But yeah, I think we should track packages that are big or have a
surprisingly build closure, and try to fix that incrementally!

> Regarding localization-files I'm unsure if for the average package this
> is worth the effort. But for big packages this could be worth the
> effort. Maybe we could even make them "noarch" packages, thus savine
> space and build time.

For things like Binutils, libc, or LO, it surely makes a difference.

For an FHS distro it’s easy to keep locale data separate.  In our case,
I’m not sure how to do it, as discussed earlier.

Thanks,
Ludo’.



Building Docker images of GuixSD

2017-10-28 Thread Ludovic Courtès
Hi Chris,

Nice work on building Docker images of GuixSD!

Chris Marusich  skribis:

> [1.345843] FS-Cache: Loaded
> [1.362140] 9pnet: Installing 9P2000 support
> [1.366118] 9p: Installing v9fs 9p2000 file system support
> [1.368730] FS-Cache: Netfs '9p' registered for caching
> configuring QEMU networking...
> loading '/gnu/store/jy509dgcsz82y13fmizv2sqaj90s1vfg-linux-vm-loader'...
> ERROR: In procedure dynamic-link:
> ERROR: In procedure dynamic-link: file: 
> "/gnu/store/hwygv5jwd47amhp1m67iy3bkvxqjlbhm-libgcrypt-1.8.1/lib/libgcrypt", 
> message: "file not found"

The code above is running in the initrd, which means that it’s executed
by ‘guile-static-stripped’, which does not support dlopening:

--8<---cut here---start->8---
$ guix environment -C --ad-hoc guile-static-stripped libgcrypt -- guile

[...]

GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (file-exists? (string-append (getenv "GUIX_ENVIRONMENT") 
"/lib/libgcrypt.so"))
$1 = #t
scheme@(guile-user)> (dynamic-link (string-append (getenv "GUIX_ENVIRONMENT") 
"/lib/libgcrypt"))
ERROR: In procedure dynamic-link:
ERROR: In procedure dynamic-link: file: 
"/gnu/store/wplxvw0mxxy35j7019j6mkjvpgl0hs1g-profile/lib/libgcrypt", message: 
"file not found"

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]>
--8<---cut here---end--->8---

(The “file not found” message is misleading.)

So we should either make a big initrd with the dynamically-linked Guile,
but then we may need to pass “-m 512” or similar to qemu…

Or we mount the host store over 9p and exec a dynamically-linked Guile
from there.

I realize it’s a bit sketchy, but I hope it makes sense.

Thanks,
Ludo’.



ESC/P-R package

2017-10-28 Thread Diego Nicola Barbato
Hello,

I would like to create a package for the ESC/P-R printer driver.  The
recipe works on my machine (GuixSD on x86_64).  Yet I am not sure about
the source URL as it appears to break as soon as a new version is made
available because the old link is not preserved.  Should we get the
source from
http://http.debian.net/debian/pool/main/e/epson-inkjet-printer-escpr/
instead, even though it is an older version?

Greetings

Diego


diff -u ~/Programs/Guix/cups.scm.old ~/Programs/Guix/cups.scm
--- ~/Programs/Guix/cups.scm.old2017-10-28 23:26:11.356064722 +0200
+++ ~/Programs/Guix/cups.scm2017-10-29 00:03:38.820338060 +0200
@@ -599,3 +599,30 @@
 protocols, which cover printers made by Konica, HP (LaserJet), Oki, Samsung,
 and more.  See @file{README} for details.")
 (license license:gpl2+)))
+
+(define-public escpr
+  (package
+   (name "escpr")
+   (version "1.6.17")
+   ;; This currently works.  But it will break as soon as a newer
+   ;; version is available since the URLs for older versions are not
+   ;; preserved.  An alternative would be to download the source (for
+   ;; an older version) from this Debian repository:
+   ;; http://http.debian.net/debian/pool/main/e/epson-inkjet-printer-escpr/
+   (source (origin
+   (method url-fetch)
+   (uri 
"https://download3.ebz.epson.net/dsc/f/03/00/06/66/09/4ac2bf69bb1ddf4a9ad525596615cbb40fe4dad5/epson-inkjet-printer-escpr-1.6.17-1lsb3.2.tar.gz";)
+   (sha256
+(base32
+  "0m6v1wdavw4r25jfywqchsx0v9ss1l5fr8vq9d0d8cmjnz8mqblv"
+   (build-system gnu-build-system)
+   (arguments
+`(#:configure-flags
+  `(,(string-append "--prefix=" (assoc-ref %outputs "out"))
+,(string-append "--with-cupsfilterdir=" (assoc-ref %outputs "out") 
"/lib/cups/filter")
+,(string-append "--with-cupsppddir=" (assoc-ref %outputs "out") 
"/share/ppd"
+   (inputs `(("cups" ,cups-minimal)))
+   (synopsis "ESC/P-R printer driver")
+   (description "ESC/P-R driver supporting a multitude of Epson printers.")
+   (home-page "http://download.ebz.epson.net/dsc/search/01/search";)
+   (license license:gpl2+)))

Diff finished.  Sun Oct 29 00:04:01 2017



Packaging goldendict with support for optionally installed dictionaries

2017-10-28 Thread Brendan Tildesley
I'm working on packaging goldendict, a dictionary reader, along with
many free dictionaries in various languages. This essentially requires
"optional dependencies", a concept alien to Guix's functional model.
However some by default goldendict checks directories such as
/usr/share/stardict/dicfor dictionaries, but Guix has 2 other locations
dictionaries may be found; /run/current-system/profile/share/..., and
$GUIX_PROFILE/share/...
A couple packages like ibus and aspell solve this using
'native-search-paths' which seems to require the program to have an
environment variable it checks for search paths, which goldendict
doesn't. There isn't much documentation on native-search-paths so I
don't know what it actually does.
libxt has a patch that hard codes the rule to check
/run/current-system/profile, and if GUIX_PROFILE exists, check that,
otherwise if HOME exists check $HOME/.guix-profile/...
That's the only solution I can see working unless anyone has a better
suggestion, I'd like to ask for some help writing the patch though since
I've never written any C/C++ before, I was stuck figuring out how to
define a string :(.

I think it can be done by making a copy of this code block and wrapping
it in the above logic:
https://github.com/goldendict/goldendict/blob/master/config.cc#L335
It would be good to keep the original /usr/share search paths so that
goldendict will interoperate if guix is installed on a foreign distro.