Subject: [bug#49685] [PATCH] gnu: Add task-spooler.

From: Ivan Gankevich <[email-masked]>
Date: Fri, 23 Jul 2021 21:22:52 +0300

>> +    (arguments
>> +      `(#:make-flags
>> +        (let ((c-flags "-g -O2"))
>> +          (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
>> +                "CC=gcc"
>
>This shoul be ,(string-append "CC=" (cc-for-target)), such that the cross-compiler
>is used when cross-compililng.

Fixed!

>> +                (string-append "CFLAGS=" c-flags)
>> +                (string-append "LDFLAGS=" c-flags)))
>
>Why are you adding "-g -O2" to LDFLAGS? I understand adding it to CFLAGS,
>but I don't see why it would be added to CFLAGS.

You’re right. Removed LDFLAGS.

>> +              ;; Patch gzip/sendmail/shell paths.
>> +              (substitute* "execute.c"
>> +                (("execlp\\(\"gzip\"") (format #f "execlp(\"~a\"" (which "gzip"))))
>
>This needs to be (search-input-file "bin/gzip") instead of (which "gzip")
>for cross-compilation purposes ('which' searches for a native "gzip" in $PATH)
>'search-input-file' is not yet defined on 'master' (it's only on 'core-updates'
>currently), so you could do something like
>
>  (string-append (assoc-ref inputs "gzip") "/bin/gzip")

Changed “which” to “string-append” here and everywhere else.

>If you fix 'sendemail' to install things in "sbin" instead of
>"usr/sbin", then you can do (search-input-file inputs "bin/sendmail").

I’ve sent a separate patch that fixes /sbin and /bin directories for “sendmail”.

Thank you for the review, Maxime!