unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Tanguy LE CARROUR <tanguy@bioneland.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 54090@debbugs.gnu.org
Subject: [bug#54090] [PATCH 0/2] gnu: Add tessen.
Date: Sun, 06 Mar 2022 19:40:45 +0100	[thread overview]
Message-ID: <164659204547.2630.278024400267167099@localhost> (raw)
In-Reply-To: <87czj2vfcw.fsf_-_@gnu.org>

Hi Ludo’

Thanks for reviewing!


Quoting Ludovic Courtès (2022-03-03 23:30:23)
> Tanguy Le Carrour <tanguy@bioneland.org> skribis:
> 
> > * gnu/packages/password-utils.scm (tessen): New variable.
> 
> [...]
> 
> > +     (origin
> > +       (method url-fetch)
> > +       (uri
> > +        (string-append "https://raw.githubusercontent.com/ayushnix/tessen/"
> > +                       "v" version "/tessen"))
> 
> Is this a stable URL?

As stable as it can get, nowadays?! ^_^'
Anyway, might not be a problem any more once you've reached the end of
this email…


> > +       #:builder
> > +       (begin
> > +         (use-modules (guix build utils))
> > +         (let ((source (string-append (assoc-ref %build-inputs "source")))
> > +               (script "tessen")
> > +               (out (assoc-ref %outputs "out")))
> 
> Could you change that to use a gexp, along these lines:
> 
>   #:builder #~(begin
>                 …
>                 (let ((source #$(package-source this-package))
>                       (out    #$output)
>                       …)
>                   …))

Mmmm… I tried, but could not get anything to work! I ended up with:

```
#:builder #~(begin
             (use-modules (guix build utils))
             (let ((source #$(package-source this-package))
                   (out    #$output)
                   (wtype  #$(this-package-input "wtype"))
                   (script "tessen"))
               (copy-file source script)
               (chmod script #o555)
               (substitute* script
                 (("wtype") (string-append wtype "/bin/wtype")))
               (install-file script (string-append out "/bin"))))
```

But it failed with:

```
ERROR: In procedure %resolve-variable:
Unbound variable: gexp
```


> > +    (propagated-inputs
> > +     (list wtype))
> 
> Could you substitute* the absolute file name of ‘wtype’ in the script
> instead of propagating?

This, at least, I think I did properly! Without the Gexp, I wrote
something that works:

```
(begin
 (use-modules (guix build utils))
 (let ((source (string-append (assoc-ref %build-inputs "source")))
       (script "tessen")
       (out (assoc-ref %outputs "out")))
       (out    (assoc-ref %outputs "out"))
       (wtype  (assoc-ref %build-inputs "wtype"))
       (script "tessen"))
   (copy-file source script)
   (chmod script #o555)
   (install-file script (string-append out "/bin"))))))
```

But actually, I figured out that Tessen was not "just" a Bash script and
could be "properly" `make install`-ed. So, I'll try to rewrite a proper
package definition, fetching the source from Git and installing it the
good old way! I can then use a more familiar `modify-phases` to
substitute `wtype` in the script.

Sounds like a plan to you?!

Regards,

-- 
Tanguy




  reply	other threads:[~2022-03-06 18:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 17:43 [bug#54090] [PATCH 0/2] gnu: Add tessen Tanguy Le Carrour
2022-02-21 18:33 ` [bug#54090] [PATCH 1/2] gnu: Add wtype Tanguy Le Carrour
2022-02-21 18:33   ` [bug#54090] [PATCH 2/2] gnu: Add tessen Tanguy Le Carrour
2022-03-03 22:30     ` [bug#54090] [PATCH 0/2] " Ludovic Courtès
2022-03-06 18:40       ` Tanguy LE CARROUR [this message]
2022-03-06 19:33         ` Maxime Devos
2022-03-03 22:28   ` Ludovic Courtès
2022-03-10  6:53 ` [bug#54090] [PATCH v2] " Tanguy Le Carrour
2022-03-10 18:56   ` Nicolas Goaziou
2022-03-11  7:52     ` Tanguy LE CARROUR
2022-03-11  7:54 ` [bug#54090] [PATCH v3] " Tanguy Le Carrour
2022-03-16 14:45   ` bug#54090: [PATCH 0/2] " Ludovic Courtès
2022-03-16 15:01     ` [bug#54090] " Tanguy LE CARROUR
2022-03-25 15:10   ` [bug#54090] [PATCH v3] " Andrew Tropin
2022-03-25 16:22     ` Tanguy LE CARROUR
2022-03-25 17:14       ` Andrew Tropin
2022-03-29  7:45         ` Tanguy LE CARROUR

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=164659204547.2630.278024400267167099@localhost \
    --to=tanguy@bioneland.org \
    --cc=54090@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).