archlinux-s390x/patches/pkgbuild/libsasl.sh

65 lines
2.9 KiB
Bash
Raw Normal View History

[FIX] four hooks the closure's second round needed e2fsprogs builds fuse2fs, deletes it, and repackages it. Without fuse3 on the host it was never compiled, so the delete aborted package() after a clean build -- and its sub-package declares fuse3, which this port does not ship, so even a success would have been uninstallable. Three reasons, one direction. libsasl said `libpq-fe.h: No such file or directory` about a file that is there, in /usr/include/postgresql. mysql.h is in /usr/include/mariadb, the same shape one step behind it. Two headers that exist on paths configure does not try is a queue, and this port already wrote down what a queue means: a single missing library is a host dependency, a queue of them is a feature to disable. Arch declares depends=(glibc) for libsasl and says why -- the SQL plugins are dlopened, never linked. python-audit and python-capng go the way python-brotli went, but the reason is stated differently on purpose. Cost was the argument then; measured now, python costs three packages rather than a subtree, so that argument no longer holds. The ABI does: both are cp313 wheels and Arch ships 3.14. --- FR --- e2fsprogs bâtit fuse2fs, le supprime, puis le rempaquette. Sans fuse3 sur l'hôte il n'a jamais été compilé : la suppression interrompait donc package() après une compilation propre — et son sous-paquet déclare fuse3, que ce portage ne livre pas, si bien qu'une réussite aurait été ininstallable. Trois raisons, une seule direction. libsasl annonçait « libpq-fe.h: No such file or directory » à propos d'un fichier présent, sous /usr/include/postgresql. mysql.h est sous /usr/include/mariadb, même forme un cran derrière. Deux en-têtes qui existent sur des chemins que configure n'essaie pas font une file d'attente, et ce dépôt a déjà consigné ce qu'une file signifie : une bibliothèque manquante est une dépendance hôte, une file en est une fonctionnalité à désactiver. Arch déclare depends=(glibc) pour libsasl et explique pourquoi — les greffons SQL sont chargés dynamiquement, jamais liés. python-audit et python-capng suivent python-brotli, mais le motif est énoncé autrement à dessein. C'était le coût alors ; mesuré maintenant, python coûte trois paquets et non un sous-arbre, cet argument ne tient donc plus. L'ABI, si : les deux sont des roues cp313 quand Arch livre la 3.14. Assisted-by: Claude Opus 5
2026-08-19 06:24:11 -04:00
#!/usr/bin/env bash
# libsasl: --enable-sql, and the message names a file that exists.
#
# sql.c:192:10: fatal error: libpq-fe.h: No such file or directory
#
# THE TRAP: the header is there.
#
# /usr/include/postgresql/libpq-fe.h
#
# Debian and Ubuntu put the PostgreSQL client headers in a subdirectory, and
# the PKGBUILD passes --with-pgsql=/usr/lib, which sends configure looking
# somewhere else. "No such file or directory" is true of the path it tried and
# false of the file, so the obvious move -- install libpq-dev -- changes
# nothing, because it is already installed.
#
# AND IT IS A QUEUE, WHICH IS THE REAL POINT. The same PKGBUILD passes
# --with-mysql=/usr, and mysql.h is at /usr/include/mariadb/mysql.h -- another
# subdirectory, another header that exists and cannot be found. Fixing the
# first uncovers the second. This port already wrote the rule down, in
# install_host_deps, after dbus asked for three documentation tools in a row:
# a single missing library is a host dependency; a queue of them is a feature
# that should be disabled.
#
# So the SQL auxprop plugin goes, along with the three --with-*sql flags that
# feed it. What it costs is worth stating precisely, because it is nothing:
# Arch itself declares depends=(glibc) for this package and says why in a
# comment at the top of its own PKGBUILD -- "else this would require mariadb
# and postgresql in [core]". The plugins are dlopened, never linked, so
# dropping them removes no dependency Arch was tracking and no capability
# anything in this port uses. libsasl is here because libldap wants SASL
# authentication; that is the DIGEST/GSSAPI/PLAIN side, all still enabled.
#
# Deferred, not architectural: a server that wants SQL auxprop rebuilds this
# with the include paths supplied. TODO.md records it.
set -euo pipefail
python3 - <<'PY'
import io, re
s = io.open("PKGBUILD", encoding="utf-8").read()
old = " --enable-sql\n"
assert s.count(old) == 1, "libsasl: expected exactly one --enable-sql"
s = s.replace(old, " --disable-sql\n", 1)
# The three database locations exist only to serve the plugin just disabled.
n = 0
for flag in ("--with-mysql=", "--with-pgsql=", "--with-sqlite3="):
pat = re.compile(r"^\s*" + re.escape(flag) + r".*\n", re.M)
found = pat.findall(s)
assert len(found) == 1, "libsasl: expected one %s line, found %d" % (flag, len(found))
s = pat.sub("", s, count=1)
n += 1
assert n == 3
io.open("PKGBUILD", "w", encoding="utf-8").write(s)
PY
grep -q -- '--disable-sql' PKGBUILD || {
echo "libsasl: sql plugin still enabled" >&2; exit 1; }
for f in -- '--with-mysql' '--with-pgsql' '--with-sqlite3'; do
[ "$f" = "--" ] && continue
grep -qF -- "$f" PKGBUILD && {
echo "libsasl: $f survived" >&2; exit 1; }
done
grep -q -- '--enable-gssapi' PKGBUILD || {
echo "libsasl: gssapi lost -- libldap needs SASL auth" >&2; exit 1; }
echo "libsasl: SQL auxprop disabled (two headers that exist, on paths it does not try)"