guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#45972] Julia importer?


From: zimoun
Subject: [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@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]