unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Jean Pierre De Jesus DIAZ <me@jeandudey.tech>, 56253@debbugs.gnu.org
Subject: [bug#56253] [PATCH]: gnu: vpnc: Fix cross-compilation.
Date: Mon, 27 Jun 2022 13:27:27 +0200	[thread overview]
Message-ID: <e0cdb67c368e01d028063d9e9d824735031f8c00.camel@telenet.be> (raw)
In-Reply-To: <FLlgKC6siW3VOq_B4lWQxjFA3AAfEeBHTzV6qw0FIAP_isJ8bLu0QF0hr3LNVzfW2lre7jAAb3AHD4UgIpGfGQDdGhtSSYwQ386OVu_U5tE=@jeandudey.tech>

[-- Attachment #1: Type: text/plain, Size: 3602 bytes --]

Jean Pierre De Jesus DIAZ via Guix-patches via schreef op ma 27-06-2022
om 10:52 [+0000]:
> +               (replace 'build
> +                 (lambda* (#:key inputs make-flags parallel-build?
> target
> +                           #:allow-other-keys)
> +                   ;; When cross-compiling, the bash script
> 'libgcrypt-config'
> +                   ;; must be accessible during the configure phase.
> +                   (when target
> +                     (setenv "PATH"
> +                             (string-append
> +                               (dirname
> +                                 (search-input-file inputs
> +                                                    "bin/libgcrypt-
> config"))

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
scripts?)

> +           #~(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
removed.


>+                   ;; 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")
>+                                                  "/share/man/man8"))
>+                     (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).

>+                   ;; Remove installation of COPYING as 'install-
license-files
>+                   ;; 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.

>+   (license (list license:gpl2+
>+                  ;; dh.c
>+                  ;; dh.h
>+                  ;; math_group.c
>+                  ;; math_group.h
>+                  license:bsd-2))

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.

Greetings,
Maxime.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2022-06-27 11:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-27 10:52 [bug#56253] [PATCH]: gnu: vpnc: Fix cross-compilation Jean Pierre De Jesus DIAZ via Guix-patches via
2022-06-27 11:27 ` Maxime Devos [this message]
2022-06-29 11:09   ` Maxime Devos
2022-06-29 11:04 ` Jean Pierre De Jesus DIAZ via Guix-patches via
2022-06-29 11:09   ` Maxime Devos
     [not found]     ` <E8aSXjBDzXnEnG_vsKAVAnIJCpw8ynAH8Ea99oyvrOj7BSa_UM7a5jhnbz8qkgIO6MYnDVnv88hTaPmqRhj69gbbSOIpctK1gRD9MExRmp8=@jeandudey.tech>
2022-06-29 18:35       ` Maxime Devos
2022-06-29 19:01         ` Jean Pierre De Jesus DIAZ via Guix-patches via
2022-07-04 10:28           ` bug#56253: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e0cdb67c368e01d028063d9e9d824735031f8c00.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=56253@debbugs.gnu.org \
    --cc=me@jeandudey.tech \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).