feat(installer): install PacManager on the target system only
PacManager (FWS-PacManage 1.2.1) is packaged like fws-dnd: a local PKGBUILD with the sources vendored in the repository, because the upstream Gitea is private and makepkg cannot fetch from it during the build. It is deliberately absent from packages.x86_64. On a live system one is about to replace, a package manager serves no purpose, and it would drag qt6-base into the squashfs for nothing. build.sh drops the built package into the image instead, and the kickstart %post installs it into the target, then deletes the file. Two conditions there: only when a desktop was chosen (it is a GUI application, nothing could launch it on a command-line install), and never blocking -- "pacman -U" resolves qt6-base over the network, and no PacManager is not a failed installation. The binary goes to /usr/lib/fws-pacmanage rather than /usr/bin: PluginManager looks for its plugins in applicationDirPath()/plugins, so /usr/bin would mean a /usr/bin/plugins directory polluting a PATH entry. Binary and plugins stay together in a private directory and /usr/bin/fws-pacmanage is a symlink -- Qt resolves /proc/self/exe, so the plugins are still found. Upstream ships no .desktop file, so one is provided here. build.sh also gains a guard: it now checks, before any lengthy step, that every package only local-repo can provide is actually built. Until now a missing one surfaced as a bare "target not found" from pacman, after the mirror refresh, the full upgrade and the whole mkarchiso setup -- several minutes for an error detectable in one second. Signed-off-by: nocode <suzuku295@gmail.com>
This commit is contained in:
6 files changed
+183
-1
No files matched your search
@@ -320,6 +320,60 @@ else
|
||||
echo "==> Aucun repo local détecté."
|
||||
fi
|
||||
|
||||
# ============================================================
|
||||
# Garde-fou : les paquets FWS doivent EXISTER dans local-repo
|
||||
#
|
||||
# packages.x86_64 liste des paquets que seul le dépôt local fournit (fws-*,
|
||||
# anaconda, winboat-bin, deps python…). S'ils n'ont pas encore été construits,
|
||||
# pacman ne le découvre qu'à la toute fin — après le -Syu, les miroirs et
|
||||
# toute la préparation de mkarchiso — avec un « target not found » sec et
|
||||
# plusieurs minutes de perdues. On vérifie donc AVANT de lancer quoi que ce
|
||||
# soit de long, et on dit quoi faire.
|
||||
# ============================================================
|
||||
echo "==> Vérification des paquets fournis par local-repo..."
|
||||
_missing=()
|
||||
# Paquets construits depuis les PKGBUILD du dépôt (le nom du dossier est le
|
||||
# pkgname), plus la liste AUR lue dans setup-aur.sh — sa seule source de vérité.
|
||||
_local_pkgs=()
|
||||
for _d in "$WORK_DIR"/pkgbuilds/*/; do
|
||||
[ -f "$_d/PKGBUILD" ] || continue
|
||||
_local_pkgs+=("$(basename "$_d")")
|
||||
done
|
||||
# shellcheck disable=SC2207
|
||||
_local_pkgs+=($(sed -n 's/^AUR_PACKAGES=(\(.*\))[[:space:]]*$//p' "$WORK_DIR/setup-aur.sh" 2>/dev/null))
|
||||
for _p in "${_local_pkgs[@]}"; do
|
||||
grep -qx "$_p" /tmp/fws-build/releng/packages.x86_64 || continue
|
||||
ls "$WORK_DIR/local-repo/$_p"-[0-9]*.pkg.tar.* >/dev/null 2>&1 || _missing+=("$_p")
|
||||
done
|
||||
if [ "${#_missing[@]}" -gt 0 ]; then
|
||||
echo -e "\e[31m[ERR] Ces paquets sont demandés par packages.x86_64 mais absents de local-repo :\e[0m" >&2
|
||||
printf ' - %s\n' "${_missing[@]}" >&2
|
||||
echo "" >&2
|
||||
echo " Construis-les d'abord : ./setup-aur.sh" >&2
|
||||
echo " (incrémental : il saute ce qui est déjà à jour dans local-repo/)" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo " ${#_local_pkgs[@]} paquets locaux attendus, tous présents ✔"
|
||||
|
||||
# ============================================================
|
||||
# PacManager : embarqué dans l'image, installé seulement sur la CIBLE
|
||||
#
|
||||
# Volontairement absent de packages.x86_64 : sur un live qu'on s'apprête à
|
||||
# remplacer, un gestionnaire de paquets n'a aucun sens (et il tirerait qt6-base
|
||||
# dans le squashfs pour rien). On dépose donc le .pkg dans l'airootfs et c'est
|
||||
# le %post du kickstart qui fait « pacman -U » dans le système installé, puis
|
||||
# supprime le fichier.
|
||||
# ============================================================
|
||||
_PM_PKG="$(ls "$WORK_DIR/local-repo"/fws-pacmanage-[0-9]*.pkg.tar.* 2>/dev/null | head -1)"
|
||||
if [ -n "$_PM_PKG" ]; then
|
||||
install -Dm644 "$_PM_PKG" \
|
||||
"/tmp/fws-build/releng/airootfs/usr/local/share/fws/packages/$(basename "$_PM_PKG")"
|
||||
echo "==> PacManager embarqué pour l'installation : $(basename "$_PM_PKG")"
|
||||
else
|
||||
echo -e "\e[33m[!] fws-pacmanage absent de local-repo — PacManager ne sera pas installé.\e[0m" >&2
|
||||
echo " Lance ./setup-aur.sh pour le construire." >&2
|
||||
fi
|
||||
|
||||
echo "==> Correction des retours à la ligne Windows (dos2unix)..."
|
||||
pacman -S --needed --noconfirm dos2unix
|
||||
find /tmp/fws-build/releng -type f -exec dos2unix {} + 2>/dev/null
|
||||
|
||||
@@ -697,6 +697,29 @@ MOTD
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- 4ter bis) PacManager : le gestionnaire de paquets graphique de FWS ------
|
||||
# Il n'est PAS dans packages.x86_64, donc absent du live : sur un système qu'on
|
||||
# s'apprête à remplacer, un gestionnaire de paquets ne sert à rien. build.sh
|
||||
# dépose son .pkg dans l'image et il est installé ICI, dans la cible seulement.
|
||||
# Conditionné à un bureau : c'est une application graphique, elle n'a aucun
|
||||
# moyen d'être lancée sur une install « ligne de commande ».
|
||||
if [ "$DESK" != "cli" ]; then
|
||||
_PM_PKG="$(ls /usr/local/share/fws/packages/fws-pacmanage-*.pkg.tar.* 2>/dev/null | head -1)"
|
||||
if [ -n "$_PM_PKG" ]; then
|
||||
# « -U » va chercher qt6-base sur le réseau ; avec un bureau KDE il est
|
||||
# déjà là. Non bloquant : pas de PacManager n'est pas une install ratée.
|
||||
if pacman -U --noconfirm "$_PM_PKG"; then
|
||||
echo "[FWS] PacManager installé"
|
||||
else
|
||||
echo "[FWS] PacManager NON installé (réseau, ou dépendance qt6-base absente)"
|
||||
fi
|
||||
else
|
||||
echo "[FWS] paquet PacManager absent de l'image (build.sh ne l'a pas embarqué)"
|
||||
fi
|
||||
fi
|
||||
# Le .pkg ne doit pas rester sur le disque de l'utilisateur.
|
||||
rm -rf /usr/local/share/fws/packages
|
||||
|
||||
# --- 4quater) ADN FWS : détection matériel + drivers + stack « Windows » ------
|
||||
# Script dédié (NON bloquant ; réseau requis) : drivers GPU détectés via lspci +
|
||||
# outils invité VM, son/micro/casque (PipeWire), Bluetooth, Podman, et — si un
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# Maintainer: FWS
|
||||
# ============================================================================
|
||||
# fws-pacmanage — PacManager, le gestionnaire de paquets graphique de FWS.
|
||||
#
|
||||
# Source VENDUE dans le dépôt (même choix que fws-dnd) : le dépôt amont
|
||||
# FWS-PacManage vit sur un Gitea PRIVÉ, makepkg ne peut donc pas la
|
||||
# télécharger pendant le build. Le tarball est régénéré depuis les sources à
|
||||
# chaque montée de version (cf. « Mise à jour » plus bas).
|
||||
#
|
||||
# MISE À JOUR :
|
||||
# 1. bump du fichier « version » côté FWS-PacManage
|
||||
# 2. tar -C <parent> -czf pkgbuilds/fws-pacmanage/fws-pacmanage-<v>.tar.gz \
|
||||
# fws-pacmanage-<v> (sans build/ ni .git/)
|
||||
# 3. pkgver ci-dessous, puis ./setup-aur.sh && ./build.sh
|
||||
# ============================================================================
|
||||
pkgname=fws-pacmanage
|
||||
pkgver=1.2.1
|
||||
pkgrel=1
|
||||
pkgdesc="PacManager — gestionnaire de paquets graphique de FWS (pacman + Flatpak, Qt6)"
|
||||
arch=('x86_64')
|
||||
url="https://gitea.nocode-var.tech/FWS/FWS-PacManage"
|
||||
license=('MIT')
|
||||
# sudo : les opérations privilégiées passent par « sudo -S » avec le mot de
|
||||
# passe de session (cf. include/pacman-manager.h), pas par polkit.
|
||||
depends=('qt6-base' 'pacman' 'sudo')
|
||||
# Le fournisseur Flatpak est un PLUGIN chargé au démarrage : sans le binaire
|
||||
# flatpak l'application marche, elle n'affiche simplement pas cette source.
|
||||
optdepends=('flatpak: gestion des paquets Flatpak')
|
||||
makedepends=('cmake' 'gcc')
|
||||
source=("${pkgname}-${pkgver}.tar.gz"
|
||||
"${pkgname}.desktop")
|
||||
sha256sums=('SKIP'
|
||||
'SKIP')
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
# Le plugin d'exemple n'a d'intérêt que pour les développeurs de plugins :
|
||||
# on ne construit que le fournisseur Flatpak, réellement utile à l'usage.
|
||||
cmake -B build \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DFWS_BUILD_EXAMPLE_PLUGIN=OFF
|
||||
cmake --build build -j"$(nproc)"
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "${srcdir}/${pkgname}-${pkgver}"
|
||||
|
||||
# POURQUOI /usr/lib et pas /usr/bin : PluginManager cherche ses greffons dans
|
||||
# « applicationDirPath()/plugins » (src/plugin-manager.cpp). Installer le
|
||||
# binaire dans /usr/bin imposerait donc un dossier /usr/bin/plugins, ce qui
|
||||
# pollue un répertoire du PATH. On garde binaire + greffons ensemble dans un
|
||||
# dossier privé, et on expose une seule commande par lien symbolique : Qt
|
||||
# résout /proc/self/exe, applicationDirPath() renvoie donc bien /usr/lib/…
|
||||
# et les greffons sont trouvés.
|
||||
install -Dm755 build/PacManager "${pkgdir}/usr/lib/${pkgname}/PacManager"
|
||||
|
||||
# Le greffon est cherché, pas codé en dur : CMake préfixe les bibliothèques
|
||||
# MODULE par « lib » (build/libflatpak-provider.so) mais la règle POST_BUILD
|
||||
# en dépose aussi une copie dans build/plugins/. Un chemin figé casserait au
|
||||
# moindre changement de l'un ou l'autre — et le nom n'a aucune importance
|
||||
# au chargement, PluginManager scanne simplement « *.so ».
|
||||
local _plugin
|
||||
_plugin="$(find build -maxdepth 2 -name '*flatpak-provider*.so' -print -quit)"
|
||||
if [ -z "$_plugin" ]; then
|
||||
echo "ERREUR : greffon Flatpak introuvable dans build/ après compilation" >&2
|
||||
return 1
|
||||
fi
|
||||
install -Dm755 "$_plugin" \
|
||||
"${pkgdir}/usr/lib/${pkgname}/plugins/flatpak-provider.so"
|
||||
install -d "${pkgdir}/usr/bin"
|
||||
ln -s "/usr/lib/${pkgname}/PacManager" "${pkgdir}/usr/bin/${pkgname}"
|
||||
|
||||
# Intégration bureau (l'amont ne fournit ni .desktop ni icône).
|
||||
install -Dm644 "${srcdir}/${pkgname}.desktop" \
|
||||
"${pkgdir}/usr/share/applications/${pkgname}.desktop"
|
||||
|
||||
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
|
||||
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
[Desktop Entry]
|
||||
# Lanceur fourni par FWS : le dépôt amont FWS-PacManage n'en livre aucun
|
||||
# (CMakeLists n'installe que le binaire et les en-têtes).
|
||||
#
|
||||
# Icon : nom d'icône standard, présent dans tous les thèmes — les SVG de
|
||||
# resources/icons/ sont des icônes d'INTERFACE (24 px, trait clair codé en dur
|
||||
# pour un fond sombre), inutilisables telles quelles dans un menu. À remplacer
|
||||
# le jour où le projet aura une vraie icône d'application.
|
||||
Type=Application
|
||||
# ATTENTION : « Version » est la version de la SPÉCIFICATION Desktop Entry
|
||||
# (1.0 à 1.5), PAS celle de l'application — y mettre 1.2.1 fait échouer
|
||||
# desktop-file-validate : « value "1.2.1" is not a known version ».
|
||||
Version=1.0
|
||||
Name=Gestionnaire de paquets
|
||||
Name[en]=Package Manager
|
||||
GenericName=Gestionnaire de paquets
|
||||
GenericName[en]=Package Manager
|
||||
Comment=Rechercher, installer et mettre à jour les logiciels
|
||||
Comment[en]=Search, install and update software
|
||||
Exec=fws-pacmanage
|
||||
Icon=system-software-install
|
||||
Terminal=false
|
||||
Categories=System;PackageManager;
|
||||
Keywords=paquet;paquets;logiciel;pacman;flatpak;installer;mise à jour;package;software;update;
|
||||
StartupNotify=true
|
||||
+1
-1
@@ -352,7 +352,7 @@ done
|
||||
# --- PKGBUILD locaux FWS (ordre explicite, feuilles d'abord, anaconda dernier) ---
|
||||
LOCAL_PKGBUILDS_DIR="$SCRIPT_DIR/pkgbuilds"
|
||||
LOCAL_BUILD_ORDER=(
|
||||
fws-dnd
|
||||
fws-dnd fws-pacmanage
|
||||
pykickstart python-productmd python-requests-file python-simpleline
|
||||
python-crypt_r python-iso639 python-langtable python-meh python-blivet
|
||||
anaconda-widgets anaconda
|
||||
|
||||
Reference in new issue
Block a user