[FIX] canonical CHOST, and a reachable libassuan source

CHOST was the Debian-style triplet. gcc -dumpmachine reports
s390x-linux-gnu on this host, but config.sub canonicalises that to
s390x-ibm-linux-gnu and GCC builds its tree under the canonical name.

Arch PKGBUILDs assume the canonical form -- theirs is
x86_64-pc-linux-gnu, vendor field present -- so gcc's own PKGBUILD
looked for $CHOST/libstdc++-v3/doc and found nothing:

  make: *** s390x-linux-gnu/libstdc++-v3/doc: No such file or directory

while the build had created s390x-ibm-linux-gnu/libstdc++-v3/doc. This
is a port-wide setting, not a gcc quirk: every PKGBUILD that derives a
path from CHOST was pointing one directory sideways.

libassuan fetches from dev.gnupg.org, which is unreachable from this
build host -- measured HTTP 000, while github.com/gpg/libassuan.git and
gnupg.org/ftp both answer. That is a network fact, not a port problem,
so only the transport changes: the pinned tag is untouched and what
gets built is what Arch specifies.

Host dependencies again: doxygen for xz, libunistring for libpsl,
systemd-dev for util-linux. Every one of them was invisible until a
build stopped on it, because --nodeps means pacman never checks
makedepends.

--- FR ---

CHOST portait le triplet de style Debian. Sur cet hote, gcc
-dumpmachine rend s390x-linux-gnu, mais config.sub le canonise en
s390x-ibm-linux-gnu, et GCC batit son arbre sous le nom canonique.

Les PKGBUILD d Arch supposent la forme canonique -- la leur est
x86_64-pc-linux-gnu, champ constructeur present -- si bien que le
PKGBUILD de gcc cherchait $CHOST/libstdc++-v3/doc sans rien trouver :

  make: *** s390x-linux-gnu/libstdc++-v3/doc: No such file or directory

alors que la compilation avait cree s390x-ibm-linux-gnu/libstdc++-v3/doc.
C est un reglage de portage, pas une bizarrerie de gcc : tout PKGBUILD
derivant un chemin de CHOST visait un repertoire a cote.

libassuan se telecharge depuis dev.gnupg.org, injoignable depuis cet
hote -- mesure : HTTP 000, quand github.com/gpg/libassuan.git et
gnupg.org/ftp repondent tous deux. C est un fait de reseau, pas un
probleme de portage : seul le transport change, l etiquette epinglee
reste intacte et ce qui se batit est ce qu Arch specifie.

Dependances d hote, encore : doxygen pour xz, libunistring pour libpsl,
systemd-dev pour util-linux. Chacune est restee invisible jusqu a ce
qu une compilation s y arrete, parce que --nodeps interdit a pacman de
verifier les makedepends.

Assisted-by: Claude Opus 5
This commit is contained in:
Mathieu Benoit 2026-08-16 00:45:50 -04:00
parent c9cc17bd01
commit a61890d83a
2 changed files with 30 additions and 0 deletions

17
patches/pkgbuild/libassuan.sh Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
# libassuan: fetch from the GitHub mirror instead of dev.gnupg.org.
#
# fatal: unable to access 'https://dev.gnupg.org/source/libassuan.git/'
#
# This is NOT a port problem. dev.gnupg.org is simply unreachable from this
# build host -- measured: HTTP 000, while github.com/gpg/libassuan.git and
# gnupg.org/ftp both answer. The GnuPG project publishes the same history to
# GitHub, so the mirror is the upstream content, not a third-party copy.
#
# The commit the PKGBUILD pins is untouched: only the transport changes, so
# what gets built is bit-for-bit what Arch specifies.
set -euo pipefail
sed -i 's|https://dev\.gnupg\.org/source/libassuan\.git|https://github.com/gpg/libassuan.git|' PKGBUILD
grep -q 'dev.gnupg.org' PKGBUILD && { echo "libassuan: dev.gnupg.org still referenced" >&2; exit 1; }
grep -m1 'github.com/gpg/libassuan' PKGBUILD | sed 's/^\s*//'
echo "libassuan: source switched to the GitHub mirror (dev.gnupg.org unreachable here)"

View file

@ -74,6 +74,19 @@ configure_makepkg() {
# pacman refuses to initialise alpm without its database directory. The # pacman refuses to initialise alpm without its database directory. The
# error is only a warning during packaging, but it hides real ones. # error is only a warning during packaging, but it hides real ones.
sudo mkdir -p /var/lib/pacman sudo mkdir -p /var/lib/pacman
# CHOST must be the CANONICAL triplet, not the Debian-style one.
#
# gcc -dumpmachine reports s390x-linux-gnu here, but config.sub
# canonicalises that to s390x-ibm-linux-gnu, and GCC builds its tree
# under the canonical name. Arch PKGBUILDs assume the canonical form --
# theirs is x86_64-pc-linux-gnu, with the vendor field present -- so
# gcc's own PKGBUILD looked for $CHOST/libstdc++-v3/doc and found
# nothing:
#
# make: *** s390x-linux-gnu/libstdc++-v3/doc: No such file or directory
#
# while the build had created s390x-ibm-linux-gnu/libstdc++-v3/doc.
sudo sed -i 's|^CHOST=.*|CHOST="s390x-ibm-linux-gnu"|' /etc/makepkg.conf
grep -E '^(CARCH|CHOST|MAKEFLAGS)=' /etc/makepkg.conf grep -E '^(CARCH|CHOST|MAKEFLAGS)=' /etc/makepkg.conf
} }