Re: ci.guix.info 504 gateway timeout (was Re: guix package builds, subsitutes and --no-build)

2019-02-25 Thread Mathieu Lirzin
Hello,

Ricardo Wurmus  writes:

> Giovanni Biscuolo  writes:
>
>> I still have to learn how to find a guix commit giving me one of those
>> specific derivations... or just check if one specific commit provides
>> one of those
>
> You generally can’t do that.  You can’t compute the commit from only a
> derivation file name.

I guess that ‘guix weather’ checks the presence of substitutes for a
current derivation of a package definition, so if in the same
environment ‘guix weather’ tells that a substitute is available and
‘guix package’ doesn't fetch it, it sounds fishy no?

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: ci.guix.info 504 gateway timeout (was Re: guix package builds, subsitutes and --no-build)

2019-02-21 Thread Mathieu Lirzin
Hello,

Ricardo Wurmus  writes:

> Hi Giovanni,
>
>> I think my specific problem is caused by the "Gateway Timeout" error
>> from ci.guix.info, see below for details
>
> I cannot reproduce this.

I can reproduce here (on GuixSD) and like Giovanni I am unable to use
the substitutes for ‘ungoogled-chromium’.

--8<---cut here---start->8---
$ guix weather --manifest=foo.scm 
calcul de 1 dérivations de paquets pour x86_64-linux…
recherche de 1 éléments du dépôt sur https://ci.guix.info...
https://ci.guix.info
  100.0% substituts disponibles (1 sur 1)
  99,3 Mo de fichiers nar (compressés)
  288,3 Mo sur le disque (décompressé)
  0,003 secondes par requête (0,0 secondesen tout)
  358,9 requêtes par seconde
  « https://ci.guix.info/api/queue?nr=1000 » a renvoyé 504 ("Gateway Time-out")
$ guix package -i ungoogled-chromium
construction de 
/gnu/store/w54r150nj8ksyznj6b8q92fgr1n0l20h-ungoogled-chromium-72.0.3626.109.tar.xz.drv...
\  C-c C-c
--8<---cut here---end--->8---

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: Using Eclipse IDE on GuixSD

2018-07-08 Thread Mathieu Lirzin
Mathieu Lirzin  writes:

> I would like to have a package definition that uses an official
> prebuilt tarball [1] as origin.  Does anybody has a custom package
> definition in their GUIX_PACKAGE_PATH for doing that?  If not, I will
> try to convert the Nix package definition [2] myself.  But I would be
> pleased not to have to.

Just in case it interests anyone here is my package definition.

 eclipse.scm -- Mthl's eclipse package definition
;;; Copyright © 2018 Mathieu Lirzin 
;;;
;;; This program is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.

(define-module (mthl packages eclipse)
  #:use-module (guix packages)
  #:use-module (gnu packages base)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages java)
  #:use-module (gnu packages xorg)
  #:use-module (guix download)
  #:use-module (guix build-system trivial)
  #:use-module ((guix licenses) #:prefix license:))

(define-public eclipse-java
  ;; XXX: This package is not built from source.
  (package
(name "eclipse-java")
(version "oxygen")
;; TODO: Handle i686 alternate origin and augment 'supported-systems'.
(source (origin
	  (method url-fetch)
	  (uri (string-append
		"https://www.eclipse.org/downloads/download.php?;
		"r=1=1=/technology/epp/downloads/release/"
		version "/3a/" name "-"
		version "-3a-linux-gtk-x86_64.tar.gz"))
	  (sha256
	   (base32
		"0m7y7jfm059w01x9j5b5qkinjjmhkyygpjabhjf19fg2smxmwcim"
(build-system trivial-build-system)
(arguments
 `(#:modules ((guix build utils))
   #:builder
   (begin
	 (use-modules (guix build utils))
	 (let* ((source  (assoc-ref %build-inputs "source"))
		(out (assoc-ref %outputs "out"))
		(eclipse (string-append out "/eclipse/eclipse")))
	   (mkdir-p (string-append out "/bin"))
	   (set-path-environment-variable "PATH" '("bin")
	  (map cdr %build-inputs))
	   (and
	(invoke "tar" "xvf" source "-C" out)
	(let ((ld-so (string-append (assoc-ref %build-inputs "libc")
	"/lib/ld-linux-x86-64.so.2")))
	  (invoke "patchelf" "--set-interpreter" ld-so eclipse))
	(let ((jdk (assoc-ref %build-inputs "jdk")))
	  (define (libdir input)
		(string-append (assoc-ref %build-inputs input) "/lib"))

	  (wrap-program eclipse
		`("PATH" prefix (,(string-append jdk "/bin")))
		`("LD_LIBRARY_PATH" prefix ,(map libdir
		 '("gtk+" "libxtst" "glib"
	  (symlink eclipse (string-append out "/bin/eclipse"))
	  #t))
(native-inputs
 `(("tar" ,tar)
   ("gzip" ,gzip)
   ("patchelf" ,patchelf)))
(inputs
 `(("bash" ,bash)
   ("glib" ,glib)
   ("gtk+" ,gtk+)
   ("jdk" ,icedtea-8)
   ("libc" ,glibc)
   ("libxtst" ,libxtst)))
(supported-systems '("x86_64-linux"))
(synopsis "Java Integrated Development Environment")
(description
 "Eclipse is an integrated development environment (IDE) used in computer
programming, in particular for Java development.  It contains a base workspace
and an extensible plug-in system for customizing the environment.")
(home-page "https://www.eclipse.org/;)
(license license:mpl2.0)))

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37


Re: dvorak

2018-05-09 Thread Mathieu Lirzin
Hello,

Divan Santana <di...@santanas.co.za> writes:

> There's been several mails and configs I've seen for dvorak
> configuration.
>
> Though, I can't seem to find any info or examples on how to configure
> dvorak for grub. I have an encrypted boot and on boot up grub asks for
> crypt passphrase as does the system on boot up.

Same problem here but with an azerty layout.

I would be interested in finding a solution for this annoyance too. :-)

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: units_cur

2018-04-01 Thread Mathieu Lirzin
Hello,

Pierre Neidhardt <ambre...@gmail.com> writes:

> Or, at the user level:
>
>   (job '(next-minute-from (next-hour '(12 19)) '(15))
>   (string-append (getenv "HOME") "/.guix-profile/bin/mkid src"))
>
>   > mcron -s 1
>   mcron: Cannot read files in your ~/.config/cron (or ~/.cron) directory.
>
> More specifically, it seems that mcron fails to take a list as second
> argument to the ~next-*~ functions.
>
> Can anyone confirm?

I confirm this bug which is present in mcron 1.1

It will be fixed in mcron 1.1.1 which should be released in the
following week.

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: How to install prerelease package versions (particularly Emacs)

2018-03-30 Thread Mathieu Lirzin
Pierre Neidhardt <ambre...@gmail.com> writes:

> Oleg, I tried reusing your package snippet from
> http://lists.gnu.org/archive/html/help-guix/2017-09/msg00074.html
> by setting
>
>(url "git://localhost/~ambrevar/projects/emacs")
>
> but it fails for me:
[...]
> I'm not very familiar with the "git" protocol: does it require some
> special configuration?
>
> I also tried specifying a local path:
>
>(url "/home/ambrevar/projects/emacs")
>
> but it seems that Guix' `git-reference` does not like it:

I think you have to use the ‘local-file’ procedure in place of ‘origin’
in the ‘source’ field.

Unless I am not up-to-date with current Guix practices, it is still not
convenient since you still need to manually filter git related files and
build results with the ‘#:select’ keyword argument of ‘local-file’.

HTH,

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: ‘guix pack’ automatic environment for Docker format

2018-02-15 Thread Mathieu Lirzin
Hello,

l...@gnu.org (Ludovic Courtès) writes:

> Mathieu Lirzin <m...@gnu.org> skribis:
>
>> in order for the compilation environment to be fully ready I need to
>> source the /gnu/store...-profile/etc/profile for things like
>> CMAKE_PREFIX_PATH, LIBRARY_PATH, ...
>>
>> While one obvious available solution is to add an extra symlink ‘-S
>> /etc/profile=etc/profile’ and then source it manually.
>
> Actually, if you also do ‘-S /bin/bash=bin/bash’ and then run /bin/bash
> in the environment, Bash will source /etc/profile.  That should be a
> good short-term solution.

Yes it works fine when you add the ‘--login’ option when calling bash

   $ docker run -it IMAGE_ID /bin/bash --login

>> I was thinking that maybe 'guix pack -f docker' could set the ‘Env’
>> part in the ‘config.json’ [1] with the appriopriate environment
>> variables automatically.
>>
>> I would like to know if it would be a good idea, and if it is easily
>> doable?
>
> It’s definitely a good idea, and I think it wouldn’t be hard to do.
> Essentially, you’d have to follow the same approach as the one used for
> etc/profile creation in (guix profiles).  See ‘profile-derivation’ as
> well as ‘build-etc/profile’ in (guix build profiles).

Great, I will see if I can do something.

Thanks for the feedback.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



‘guix pack’ automatic environment for Docker format

2018-02-14 Thread Mathieu Lirzin
Hello,

I am trying to use ‘guix pack’ to provide my colleagues an easy to use
compilation environment to run with Docker.  My command to create the
container image is the following

  $ guix pack -f docker -S /bin=bin gcc-toolchain bash cmake make pkg-config 
python@2 coreutils eigen jsoncpp googletest

Then I run that image like this:

  $ IMAGE=`docker load -i docker-pack.tar.gz | cut -d' ' -f3` 
  $ docker run -it $IMAGE  /bin/bash

in order for the compilation environment to be fully ready I need to
source the /gnu/store...-profile/etc/profile for things like
CMAKE_PREFIX_PATH, LIBRARY_PATH, ...

While one obvious available solution is to add an extra symlink ‘-S
/etc/profile=etc/profile’ and then source it manually.  I was thinking
that maybe 'guix pack -f docker' could set the ‘Env’ part in the
‘config.json’ [1] with the appriopriate environment variables
automatically.

I would like to know if it would be a good idea, and if it is easily
doable?

Thanks.

[1] 
https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-description

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: How to compile LaTeX with 'hyperref' package?

2018-01-23 Thread Mathieu Lirzin
Hello Ricardo,

Ricardo Wurmus <rek...@elephly.net> writes:

>> Mathieu Lirzin <m...@gnu.org> writes:
>>
>>> I will try with ‘texlive-full’ to see if things work better.
>>
>> s/texlive-full/texlive
>>
>> The installation was quicker that I expect since it was already
>> compiled.  I confirm that compiling with ‘texlive’ succeed since
>> ‘hyperref.sty’ is found directly in ‘texlive’ store output directory.
>>
>> Maybe the environment variable TEXINPUTS should be generated in
>> “~/.guix-profile/etc/profile”?
>>
>> Shall I open a bug for this?
>
> That’s not necessary as the broken up texlive-* packages are currently
> not sufficient to build a usable Texlive subset in a profile.  I’m
> working on a profile hook, which is similar to what the texlive-union
> procedure does.
>
> I consider this to be the same as bug 27217.

I agree.

Thanks for pointing me to this bug.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



How to compile LaTeX with 'hyperref' package?

2018-01-22 Thread Mathieu Lirzin
Hello,

My profile contains the following packages:

--8<---cut here---start->8---
texlive-tiny44591   out 
/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591
texlive-latex-listings  44591   out 
/gnu/store/pj62c2n9cfxq92l0sb4rcja2sh4bjjgp-texlive-latex-listings-44591
texlive-latex-hyperref  6.84a2  out 
/gnu/store/z00alqpxjainhwlss44fdvmlgkk6m0sp-texlive-latex-hyperref-6.84a2
--8<---cut here---end--->8---

I fail to compile a “main.tex” containing ‘\usepackage{hyperref}’ with
the command ‘pdflatex main.tex’ on GuixSD.  The error message is the
following:

--8<---cut here---start->8---
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded 
format=pdflatex)
 restricted \write18 enabled.
entering extended mode
LaTeX2e <2017-04-15>

(./main.tex
(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class

(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/latex/base/size12.clo))
(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/generic/babel/babel.sty
(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/generic/babel/switch.def)
(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/generic/babel-english/english.ldf
(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/generic/babel/babel.def I couldn't find the file language.def)))
(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/latex/base/fontenc.sty
(/gnu/store/1yxy72j1m372g8w5npmqrpiq9gj3fzdx-texlive-tiny-44591/share/texmf-dis
t/tex/latex/base/t1enc.def)
kpathsea: Running mktextfm ecrm1200
mktextfm: Running mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; 
input ecrm1200
This is METAFONT, Version 2.7182818 (TeX Live 2017) (preloaded base=mf)


kpathsea: Running mktexmf ecrm1200
! I can't find file `ecrm1200'.
<*> ...ljfour; mag:=1; nonstopmode; input ecrm1200
  
Please type another input file name
! Emergency stop.
<*> ...ljfour; mag:=1; nonstopmode; input ecrm1200
  
Transcript written on mfput.log.
grep: ecrm1200.log: Aucun fichier ou dossier de ce type
mktextfm: `mf-nowin -progname=mf \mode:=ljfour; mag:=1; nonstopmode; input 
ecrm1200' failed to make ecrm1200.tfm.
kpathsea: Appending font creation commands to missfont.log.

! Font T1/cmr/m/n/12=ecrm1200 at 12.0pt not loadable: Metric (TFM) file not fou
nd.
 
   relax 
l.105 \fontencoding\encodingdefault\selectfont
  
)

! LaTeX Error: File `hyperref.sty' not found.

Type X to quit or  to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
 
 
l.5 \usepackage
   {url}^^M
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on main.log.
--8<---cut here---end--->8---

I am not sure if this is just me being ignorant or if this is a bug.
This command was succeeding both on Fedora and Debian.

I will try with ‘texlive-full’ to see if things work better.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: Samba user mounts

2018-01-15 Thread Mathieu Lirzin
Hello Ricardo,

Ricardo Wurmus <rek...@elephly.net> writes:

>> I want to connect to my NAS using the Samba protocol.  While I can use ‘gvfs’
>> for that it is not convenient for me to access it from the command line via
>> the “/run/user/1000/gvfs/smb-share:server=nas,share=home/” filename.  On my
>> previous system I was able to add the following line in my “/etc/fstab” file:
>>
>>//nas/home /mnt/mthl/nas-home  cifs  
>> credentials=/home/mthl/.smbfile,rw,noauto,user 0 0
>>
>> which allowed me to execute the following command as a regular user:
>>
>>$ mount /mnt/mthl/nas-home
>>
>> Does anybody know how to achieve similar thing on GuixSD?
>
> I have this in my config:
>
> (file-system
>  (device "//my.nas/the-share")
>  (title 'device)
>  (options "uid=1000,gid=1000,credentials=/etc/samba.credentials")
>  (mount-point "/nas")
>  (type "cifs")
>  (mount? #f)
>  (create-mount-point? #t))
>
> And it does the right thing when I run “mount /nas”.
>
> Does this help?

Indeed this helps greatly.  The only remaining minor issue is that the
‘mount’ command still needs to be run as root.  I have added the “user”
option and turn ‘mount.cifs’ into a setuid program.

  (file-system
   (device "//192.168.1.100/home")
   (title 'device)
   (options "uid=1000,gid=1000,credentials=/home/mthl/.smbfile,user")
   (mount-point "/mnt/nas-home")
   (type "cifs")
   (mount? #f)
   (create-mount-point? #t))

  (setuid-programs (cons (file-append cifs-utils "/sbin/mount.cifs")
 %setuid-programs))

However I am still unable to mount this as a regular user:

--8<---cut here---start->8---
  $ mount /mnt/nas-home
  This program is not installed setuid root -  "user" CIFS mounts not supported.
--8<---cut here---end--->8---

What happens I think is that ‘mount’ calls the ‘mount.cifs’ from the
store and not to the one in the “/run/current-system/setuid-programs”
directory.  I don't know how this could be fixed.

Thank you very much for this very helpful snippet.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Samba user mounts

2018-01-14 Thread Mathieu Lirzin
Hello,

I want to connect to my NAS using the Samba protocol.  While I can use ‘gvfs’
for that it is not convenient for me to access it from the command line via
the “/run/user/1000/gvfs/smb-share:server=nas,share=home/” filename.  On my
previous system I was able to add the following line in my “/etc/fstab” file:

   //nas/home /mnt/mthl/nas-home  cifs  
credentials=/home/mthl/.smbfile,rw,noauto,user 0 0

which allowed me to execute the following command as a regular user:

   $ mount /mnt/mthl/nas-home

Does anybody know how to achieve similar thing on GuixSD?

Thanks.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Using Eclipse IDE on GuixSD

2018-01-12 Thread Mathieu Lirzin
Hello,

I would like to install the Eclipse IDE on GuixSD for the Java
development I am doing.  I know that despite Ricardo Wurmus hard work,
the Java story is still not shiny on Guix.  As a consequence I don't
expect to be able to build it from source.

Instead, I would like to have a package definition that uses an official
prebuilt tarball [1] as origin.  Does anybody has a custom package
definition in their GUIX_PACKAGE_PATH for doing that?  If not, I will
try to convert the Nix package definition [2] myself.  But I would be
pleased not to have to.

Thanks.

[1] https://www.eclipse.org/downloads/packages/release/Oxygen/2
[2] 
https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/eclipse

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



Re: string-append plus package

2016-12-29 Thread Mathieu Lirzin
Hi,

Hartmut Goebel <h.goe...@crazy-compilers.com> writes:

> Am 19.12.2016 um 10:47 schrieb Ludovic Courtès:
>> Hartmut Goebel <h.goe...@crazy-compilers.com> skribis:
>>
>>> Am 08.12.2016 um 20:56 schrieb Leo Famulari:
>>>>> Here is the service-definition I use:
>>>>>
>>>>>  (nginx-service #:vhost-list
>>>>>(list (nginx-vhost-configuration 
>>>>>   (root (string-append nginx "/share/nginx/html"))
>>>> I believe that file-append is intended for this use case.
>>> Maybe, but I can't get it to work. This minimal system declarision fails
>>> with "In procedure string-append: Wrong type (expecting string):
>>> #< base: #>> 2a236c0> suffix: ("/")>"
>>>
>>> (use-modules (gnu))
>>> (use-package-modules networking web)
>>> (define NGINX (file-append nginx "/bin/nginxctl"))
>>> (define TEST (string-append NGINX ""))
>> […]For example:
>>
>>   (scheme-file "foo" #~(foo bar #$(file-append nginx "/foo/bar")))
>>
>> leads to a file “foo” containing:
>>
>>   (foo bar "/gnu/store/…-nginx-1.2.3/foo/bar")
>>
>> HTH!
>
> I now found time trying this out. Unfortunately this does not do what I
> expect. I do not need some string "(foo bar
> \"/gnu/store/…-nginx-1.2.3/foo/bar\")".
>
> I need the string "/gnu/store/…-nginx-1.2.3/bin/nginxctl". No gexpr, no
> scheme magic, no string representing scheme code. But simply a string
> containing the path of a file with the package (nginx in the example)
> which I can assign to some variable (NGINX as shown in the example) and
> then be used for other string operations (like when defining TEST in the
> example).

The trick is that "…" in the above string depends on the actual hash of
nginx which will change every time nginx (or its dependencies) is
updated.  So you need to "ask" the Guix API what is the string, like
this:

  (use-modules (guix)
   (gnu packages web))
  (define conn (open-connection))
  (package-output conn nginx) ;returns the actual string

However I guess this would not be that useful in the context of writing
a service.

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37