GNU bug report logs -
#45972
[PATCH] Add julia-json with dependencies
Previous Next
Full log
Message #31 received at 45972 <at> debbugs.gnu.org (full text, mbox):
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.