Subject: [bug#56354] [PATCH] gnu: engineering: Add candle.

From: Jean Pierre De Jesus DIAZ <[email-masked]>
Date: Mon, 11 Jul 2022 11:55:52 +0000

Hello Artyom,

>It seems to me from the message that the issue is not in the candle
>package itself.

Probably one of the dependencies can't (currently) be cross-compiled,
anyway, thanks for setting the QMAKE_CC variable in the qmake invocation,
once perl build system gains cross-compilation (if possible) then it
would be easier to cross-compile later without modifications to the
package.

>+                            (lambda* (#:key outputs #:allow-other-keys)
>+                              (let ((out (assoc-ref outputs "out")))
>+                                (chdir "src")
>+                                (invoke "qmake"
>+                                        (string-append "QMAKE_CC="
>+                                                       #$(cc-for-target))))))

The `out' variable is not used, so the let can be safely removed and the lambda
simplified, also instead of `chdir', `with-directory-excursion' could be used,
but's a matter of preference (don't know if one or other style is preferred
inside GNU Guix).

For example:

(lambda _
  (with-directory-excursion "src"
    (invoke "qmake"
      (string-append "QMAKE_CC="
                     #$(cc-for-target)))))

>+                          (replace 'install
>+                            (lambda* (#:key outputs #:allow-other-keys)
>+                              (let ((out (assoc-ref outputs "out")))
>+                                (install-file "Candle"
>+                                              (string-append out "/bin"))))))))

The `out' binding can be also replaced by `#$output', e.g.:

(lambda* _
  (install-file "Candle"
                (string-append #$output "/bin")))

Other than that the package definition looks good to me, and did a quick pass
over the Candle source code to check that it doesn't contain any malware.

Only a bundled font is present (src/fonts/Ubuntu-Regular.tff), but that one is
not provided by GNU Guix (don't know the specific reasons, but got added then
removed) so no need to replace it with provided ones.

—
Jean-Pierre De Jesus DIAZ