[FIX] gcc: s390x installs to lib64, Arch expects lib

package_gcc() reached its very last step and stopped on one file:

  mv: cannot stat 'usr/lib/libgfortran.spec': No such file or directory

The file exists, in usr/lib64/libgfortran.spec. lib64 is GCC's default
MULTILIB_OSDIRNAMES for 64-bit Z, while Arch puts everything in
usr/lib. So this is not one stray path: the whole package layout
differs, and every _pick naming usr/lib would miss the same way.

The trees are merged before any _pick runs, which leaves the upstream
package definitions working unchanged rather than rewriting each path
one at a time -- and keeps working if Arch adds a _pick later.

curl now builds, with HTTP/3 disabled and patchelf on the host.

--- FR ---

package_gcc() atteignait sa toute derniere etape et s arretait sur un
seul fichier :

  mv: cannot stat 'usr/lib/libgfortran.spec': No such file or directory

Le fichier existe, dans usr/lib64/libgfortran.spec. lib64 est le
MULTILIB_OSDIRNAMES par defaut de GCC pour Z en 64 bits, quand Arch
place tout dans usr/lib. Ce n est donc pas un chemin isole : toute la
disposition du paquet differe, et chaque _pick nommant usr/lib
echouerait de la meme facon.

Les arbres sont fusionnes avant le premier _pick, ce qui laisse les
definitions amont fonctionner sans retouche plutot que de reecrire
chaque chemin un a un -- et continue de tenir si Arch ajoute un _pick
plus tard.

curl se construit desormais, HTTP/3 desactive et patchelf pose sur
l hote.

Assisted-by: Claude Opus 5
This commit is contained in:
Mathieu Benoit 2026-08-16 16:59:53 -04:00
parent 115ea48fb4
commit bcc6d63bed

View file

@ -94,6 +94,37 @@ sed -i '/_pick .*\/32\//d' PKGBUILD
# expands to the normal and the 32-bit path in one go. Deleting the line
# would lose the normal path too, so only the 32-bit alternative goes.
sed -i 's|{,32/}||g; s|{,32}||g' PKGBUILD
# s390x GCC installs 64-bit libraries into usr/lib64; Arch's layout is usr/lib
# everywhere. package_gcc() therefore looked for files that were one directory
# away:
#
# mv: cannot stat 'usr/lib/libgfortran.spec': No such file or directory
#
# while the file sat in usr/lib64/libgfortran.spec. This is not one stray
# file -- lib64 is GCC's default MULTILIB_OSDIRNAMES for 64-bit Z, so the
# whole package layout is affected, and every _pick that names usr/lib would
# miss in the same way.
#
# The trees are merged before any _pick runs, which keeps the upstream
# package definitions working unchanged rather than rewriting each path.
python3 - <<'PY'
import io, re
s = io.open("PKGBUILD", encoding="utf-8").read()
merge = """ # s390x installs 64-bit libraries to lib64; Arch expects lib.
if [ -d usr/lib64 ]; then
mkdir -p usr/lib
cp -a usr/lib64/. usr/lib/
rm -rf usr/lib64
fi
"""
i = s.index(" _pick ")
s = s[:i] + merge + s[i:]
io.open("PKGBUILD", "w", encoding="utf-8").write(s)
PY
grep -q 'installs 64-bit libraries to lib64' PKGBUILD || {
echo "gcc: lib64 merge not inserted" >&2; exit 1; }
echo "gcc: lib64 merged into lib before packaging"
if grep -qE '_pick .*(\{,32|/32/)' PKGBUILD; then
echo "gcc: a 32-bit _pick path remains" >&2; exit 1
fi