diff mbox series

[bug#54260,2/3] gnu: ucsim: Don't explicitly return #t from phases.

Message ID 49559efd0d392df29393ac7441b83f14c2840b21.1646484354.git.simon@simonsouth.net
State Accepted
Headers show
Series gnu: ucsim: Update to 0.7.1. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Simon South March 5, 2022, 12:59 p.m. UTC
* gnu/packages/embedded.scm (ucsim)[arguments]: Don't explicitly return #t
from phases.
---
 gnu/packages/embedded.scm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

M March 5, 2022, 3:23 p.m. UTC | #1
Simon South schreef op za 05-03-2022 om 07:59 [-0500]:
>           (add-after 'install 'remove-empty-directory
>             (lambda* (#:key outputs #:allow-other-keys)
>               (delete-file-recursively
> -              (string-append (assoc-ref outputs "out") "/share/man"))
> -             #t)))))
> +              (string-append (assoc-ref outputs "out") "/share/man")))))))

Additionally, you could make the #:configure-flags a G-exp and
eliminate input labels (or, in this case, output labels):

(list #:phases
      #~(modify-phases ...
          (add-after ... ...
            (lambda _
              ... (string-append #$output "/share/man") ...))))

Greetings,
Maxime.
Simon South March 5, 2022, 4:39 p.m. UTC | #2
Maxime Devos <maximedevos@telenet.be> writes:
> Additionally, you could make the #:configure-flags a G-exp and
> eliminate input labels (or, in this case, output labels)

This occurred to me, but is it not better in this case to rely on the
"output" parameter passed into the procedure?  Using "#$output" in this
context feels like a violation of the Law of Demeter, like using a
global variable where a local one would be appropriate.

I'll drop the first patch though; I'd missed seeing the definition of
"gnu-cross-build".
M March 11, 2022, 10:39 p.m. UTC | #3
Simon South schreef op za 05-03-2022 om 11:39 [-0500]:
> This occurred to me, but is it not better in this case to rely on the
> "output" parameter passed into the procedure?  Using "#$output" in this
> context feels like a violation of the Law of Demeter, like using a
> global variable where a local one would be appropriate.

'outputs' is an argument to the phase procedure, but as I understand
it, it is only due to historical reasons (G-exps are relatively new-
ish) and because the procedures in (guix build FOO-build-system) have
no other method for determining the outputs.

Might be a good idea to confirm with chief gexpologist ludo though.

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/embedded.scm b/gnu/packages/embedded.scm
index 43fba510da..1d232e471a 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -1507,13 +1507,11 @@  (define-public ucsim
          (add-after 'unpack 'patch-makefiles
            (lambda _
              (substitute* (find-files "." "(\\.mk$|\\.in$)")
-               (("/bin/sh") (which "sh")))
-             #t))
+               (("/bin/sh") (which "sh")))))
          (add-after 'install 'remove-empty-directory
            (lambda* (#:key outputs #:allow-other-keys)
              (delete-file-recursively
-              (string-append (assoc-ref outputs "out") "/share/man"))
-             #t)))))
+              (string-append (assoc-ref outputs "out") "/share/man")))))))
     (native-inputs
      (list bison flex))
     (home-page "http://mazsola.iit.uni-miskolc.hu/ucsim/")