From: Luis Felipe via Guix-patches via <guix-patches@gnu.org>
To: Jelle Licht <jlicht@fsfe.org>
Cc: "Ludovic Courtès" <ludo@gnu.org>, 60386@debbugs.gnu.org
Subject: [bug#60386] [PATCH] gnu: Add guile-proba.
Date: Wed, 15 Feb 2023 21:56:07 +0000 [thread overview]
Message-ID: <kAHFGz-9oKkqwkhd_oxPlA_VS2jqFuwsRPysoiD_bdwnoVYViCvCnzXxTuonohbnE7M2ntFWfdaYCt1-KSOaqp4cOkNGxyE2azjU86Jm_DY=@protonmail.com> (raw)
In-Reply-To: <87pmadr86d.fsf@fsfe.org>
[-- Attachment #1.1: Type: text/plain, Size: 4036 bytes --]
Hi Jelle, thanks for taking a look.
I'm sending a new patch after this message, but I'm replying to your review below.
On Monday, February 13th, 2023 at 13:44, Jelle Licht <jlicht@fsfe.org> wrote:
> > + (native-inputs (list guile-3.0 texinfo))
>
>
> I think guile should be a normal input. Other packages like this
> (e.g. guilescript, ccwl) seem to do it that way.
I moved it to inputs now. But I placed it in native-inputs following the guile-build-system documentation in the manual:
"Packages built with ‘guile-build-system’ must provide a Guile package in their ‘native-inputs’ field."
Did I misunderstand or should that part of the manual be updated?
> > + (propagated-inputs (list guile-config guile-lib))
> > + (arguments
> > + (list
> > + #:phases
> > + #~(modify-phases %standard-phases
> > + (add-after 'build 'check
> > + (lambda _
> > + (invoke "guile" "proba.scm" "run" "tests")))
> > + (add-after 'install 'install-wrapped-script
> > + (lambda* (#:key outputs #:allow-other-keys)
> > + (let* ((out (assoc-ref outputs "out"))
> > + (version (target-guile-effective-version))
> > + (scm (string-append "/share/guile/site/" version))
> > + (go (string-append "/lib/guile/" version "/site-ccache"))
> > + (bin-dir (string-append out "/bin"))
> > + (script (string-append bin-dir "/proba")))
> > + (mkdir-p bin-dir)
> > + (copy-file "proba.scm" script)
> > + (chmod script #o555)
> > + (wrap-program script
> > + `("GUILE_LOAD_PATH" prefix + (,(string-append out scm))) +` ("GUILE_LOAD_COMPILED_PATH" prefix
> > + (,(string-append out go)))))))
>
>
> This seems almost correct, as it extends the GUILE_LOAD_{,COMPILED}PATH
> at runtime; the user would for still need to have the guile-config and
> guile in their profile. Although guile-config is also listed as a
> propagated input, when the guile search paths specifications are not
> active, the following would not work:
>
> `guix shell --pure guile-proba -- proba run tests'
>
> You could have a look at the 'wrap phase of the ccwl package; they use
> the value of (getenv "GUILE_LOAD{,COMPILED}_PATH") retrieved while
> building the package to wrap their script.
I added a new phase to set Guile load paths so that they take (getenv "GUILE_LOAD{,COMPILED}_PATH") into account, and modified the wrapping accordingly. In my test, running "guix shell --pure guile-proba -- proba run tests" works now.
> > + (add-after 'install 'install-manual
> > + (lambda* (#:key outputs #:allow-other-keys)
> > + (let* ((out (assoc-ref outputs "out"))
> > + (info-dir (string-append out "/share/info")))
> > + (mkdir-p info-dir)
> > + (invoke "makeinfo" "manual/main.texi")
> > + (install-file "guile-proba" info-dir)))))
>
> Nitpick, so feel free to ignore:
> You could split up building and installing the manual.
I put building into a separate phase.
> > + #:not-compiled-file-regexp
> > + "((bogus|bogus-tests|packages|tests)\\/.*.scm|(proba|manifest).scm)$"))
>
>
> All of the files listed in this regex are still installed in
> <out>/share/guile/site/3.0. Do you think it would be possible to ensure
> these files are not installed?
It was possible. Now it looks like this:
/gnu/store/xaqmf7n83h5dq9xv6is46ybjk98ssakr-guile-proba-0.3.0
|-- bin
| `-- proba
|-- lib
| `-- guile
| `-- 3.0
| `-- site-ccache
| `-- proba
| |-- cli.go
| |-- commands.go
| |-- runners.go
| |-- templates.go
| `-- utils.go
`-- share
|-- doc
| `-- guile-proba-0.3.0
| |-- README.org
| `-- index.html
|-- guile
| `-- site
| `-- 3.0
| `-- proba
| |-- cli.scm
| |-- commands.scm
| |-- runners.scm
| |-- templates.scm
| `-- utils.scm
`-- info
`-- guile-proba
[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]
next prev parent reply other threads:[~2023-02-15 21:57 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-28 18:07 [bug#60386] [PATCH] gnu: Add guile-proba Luis Felipe via Guix-patches via
2023-01-10 10:48 ` Ludovic Courtès
2023-01-13 15:41 ` Luis Felipe via Guix-patches via
2023-01-17 13:50 ` Ludovic Courtès
2023-01-18 18:20 ` Luis Felipe via Guix-patches via
2023-01-23 22:25 ` Ludovic Courtès
2023-01-25 1:11 ` Luis Felipe via Guix-patches via
2023-01-26 9:35 ` Ludovic Courtès
2023-01-26 14:29 ` Luis Felipe via Guix-patches via
2023-02-06 15:40 ` Luis Felipe via Guix-patches via
2023-02-13 13:44 ` Jelle Licht
2023-02-15 21:56 ` Luis Felipe via Guix-patches via [this message]
2023-02-21 17:54 ` bug#60386: " Jelle Licht
2023-02-15 21:59 ` [bug#60386] [PATCH v4] " sirgazil--- via Guix-patches via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='kAHFGz-9oKkqwkhd_oxPlA_VS2jqFuwsRPysoiD_bdwnoVYViCvCnzXxTuonohbnE7M2ntFWfdaYCt1-KSOaqp4cOkNGxyE2azjU86Jm_DY=@protonmail.com' \
--to=guix-patches@gnu.org \
--cc=60386@debbugs.gnu.org \
--cc=jlicht@fsfe.org \
--cc=ludo@gnu.org \
--cc=luis.felipe.la@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.