Jean Pierre De Jesus DIAZ via Guix-patches via schreef op ma 27-06-2022
om 10:52 [+0000]:
Toggle quote (15 lines)
> + (replace 'build
> + (lambda* (#:key inputs make-flags parallel-build?
> + #:allow-other-keys)
> + ;; When cross-compiling, the bash script
> + ;; must be accessible during the configure phase.
> + (when target
> + (setenv "PATH"
> + (string-append
> + (dirname
> + (search-input-file inputs
> + "bin/libgcrypt-
It would be simpler to replace 'libgcrypt-config --libs' by 'pkg-config
--libs' (with a substitute*, post-unpack) and likewise for
'libgcrypt-config --libs', to avoid executing a script compiled for
another architecture locally (it works because of a preceding $(shell
..., though doesn't seem great to me).
(Additionally, maybe upstream would be interested in pkg-config which
mostly just works when cross-compiling, in constrast to ...-config
Toggle quote (2 lines)
> + #~(let ((out (assoc-ref %outputs "out")))
If you're using G-exps, you might as well replace (assoc-ref %outputs
"out") by #$output. Also, there's no configure phase, it has been
Toggle quote (12 lines)
>+ ;; manpage. This step is not necessary when the target is
>+ ;; the host.
>+ (when target
>+ (apply invoke "make" "vpnc.8" "CC=gcc"
>+ (if parallel-build?
>+ (list "-j" (number->string (parallel-job-count)))
>+ (install-file "vpnc.8"
>+ (string-append (assoc-ref outputs "out")
>+ (invoke "make" "clean"))))
You can simplify this by adding vpnc itself to the native-inputs (conditional
on %current-target-system to avoid a cycle) and when cross-compiling, copy the
man page from the native input to vpnc.8 (pre-build, instead of replacing build,
then you don't needd to fiddle with parallelism flags or the install phase).
Toggle quote (1 lines)
>+ ;; Remove installation of COPYING as 'install-
Toggle quote (4 lines)
>+ ;; phase does it with a proper version number.
>+ (substitute* "Makefile"
>+ (("install -m644 COPYING.*") "")))))))
Independent change, so for a separate commit. Also, I don't think it's
worth it to remove the double installation -- we would be deviating
from upstream and at most some KB would be saved but we have automated
depulication. Or maybe it's nice for consistency, dunno.
Toggle quote (7 lines)
>+ (license (list license:gpl2+
>+ ;; dh.c
>+ ;; dh.h
>+ ;; math_group.c
>+ ;; math_group.h
Again independent change -- I don't think it was necessary to mention
the file names (but I don't think they have to be removed either). More
precise license information looks nice.