Subject: [bug#55606] [PATCH 2/2] gnu: Add hare.

From: Maxime Devos <[email-masked]>
Date: Tue, 24 May 2022 19:01:39 +0200

Antero Mejr via Guix-patches via schreef op ma 23-05-2022 om 21:21 [-
0400]:
> +      (arguments
> +       `(#:tests? #f ;no test suite
> +         #:make-flags
> +         (list (string-append "CC="
> +                              ,(cc-for-target))
> +               (string-append "DESTDIR="
> +                              (assoc-ref %outputs "out")) "PREFIX=")
> +         #:phases
> +         (modify-phases %standard-phases
> +           (replace 'configure
> +             (lambda* (#:key configure-flags #:allow-other-keys)
> +               (setenv "QBE"
> +                       (string-append (assoc-ref %build-inputs "qbe")
> +                                      "/bin/qbe"))
> +               ;; configure rejects unrecognized options
> +               (apply invoke "./configure" configure-flags))))))

input labels can be eliminated (see
<https://guix.gnu.org/en/blog/2021/the-big-change/>):

  (arguments
    (list ...
          #:phases
          #~(modify-phases ...
               (setenv "QBE" (which "qbe"))
               (apply invoke ...))))

Also, 'qbe' looks like a non-native input input, IIUC that 'harec'
invokes 'qbe' under the hood.  (in that case, use (search-input-file
inputs "/bin/qbe") instead). As a test, you can do "guix build harec"
and "guix gc --refences /gnu/store/HAS-harec-VERSION" to see if it ends
up in the references.

Greetings,
Maxime.