GNU bug report logs - #45972
[PATCH] Add julia-json with dependencies

Previous Next

Package: guix-patches;

Reported by: Nicolò Balzarotti <anothersms <at> gmail.com>

Date: Mon, 18 Jan 2021 23:49:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 45972 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Nicolò Balzarotti <anothersms <at> gmail.com>, Ludovic
 Courtès <ludo <at> gnu.org>
Cc: 45972 <at> debbugs.gnu.org
Subject: Re: [bug#45972] Julia importer?
Date: Sat, 30 Jan 2021 15:46:02 +0100
Hi,

On Thu, 28 Jan 2021 at 01:30, Nicolò Balzarotti <anothersms <at> gmail.com> wrote:

> Sure, I'd just read it from Package.toml (nowadays almost all the
> packages have this file, and for when it's missing we also have the
> julia-create-package-toml procedure that creates it).
>
> The file is toml, but I don't see a toml parser in guix.  So, I'd use a
> function like the following:
>
> #+begin_src scheme
> (define (package.toml->name file)
>   (call-with-input-file file
>     (lambda (in)
>       (let loop ((line (read-line in 'concat)))
>         (if (eof-object? line)
>             #f                          ;What to do?
>             (let ((m (string-match "name\\s*=\\s*\"(.*)\"" line)))
>               (if m (match:substring m 1)
>                   (loop (read-line in 'concat)))))))))
> #+end_src

[...]

> The other way I think this is easily solvable is by asking julia
> directly, by reading the output of:
>
> (invoke-julia "using Pkg; Pkg.TOML.parsefile("Project.toml")["name"] |> println")

With a bit more glue, could this be transformed into something like
“julia->guix-package”?  And so have a Julia package importer, even if it
fails for some cases.

WDYT?


All the best,
simon




This bug report was last modified 4 years and 169 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.