Hi,

Nikita Karetnikov <nik...@karetnikov.org> skribis:

> +    (arguments `(#:phases (alist-cons-before
> +                           'configure 'fix-sh
> +                           (lambda _
> +                             (substitute* "./src/configure"
> +                               (("-/bin/sh")
> +                                (string-append "-" (which "sh"))))
> +                             (substitute* "./src/configure"
> +                               (("= /bin/sh")
> +                                (string-append "= " (which "sh")))))

‘substitute*’ can have several clauses, so you can write:

  (substitute* "src/configure"
    (("-/bin/sh") (string-append "-" (which "sh")))
    (("= /bin/sh") (string-append "= " (which "sh"))))

> +                           (alist-replace
> +                            'configure
> +                            (lambda* (#:key outputs #:allow-other-keys)
> +                              (let ((out (assoc-ref outputs "out")))
> +                                (zero? (system
> +                                  (string-append "cd src && ./configure "
> +                                                 "--prefix=" out)))))
> +                            (alist-replace
> +                             'build
> +                             (lambda _
> +                               (zero? (system "cd src && make")))
> +                             (alist-replace
> +                              'check
> +                              (lambda _
> +                                (zero? (system "cd src && make check")))
> +                             (alist-replace
> +                              'install
> +                              (lambda _
> +                                (zero? (system "cd src && make install")))
> +                            %standard-phases)))))))

Instead of repeating “cd src”, you can just add a phase before the
‘configure’ phase that does:

  (chdir "src")

> +    (license '(gpl2+ lgpl3+))))

This should be (list gpl2+ lgpl3+), to refer to the ‘license’ objects.

HTH,
Ludo’.

Reply via email to