Installer une Appimage
Installer une Appimage
1 Installation (ex: PyCDCover)
- créer le dossier “PyCdCover-AppImage. Y enclure:
controleur
locale
Modele
ressourecs
vues
pycdvover.png
Pycdcover.pyw
README.md
- requirement.txt
Rendre exécutable “install.sh”:
1
chmod +x install.shexécuter “install.sh”:
1
./install.sh
l’AppImage est construite. La rendre exécutable:
1
chmod +x PyCDCover-x86_64.AppImageet puis l’exécuter:
1
./PyCDCover-x86_64.AppImage
2 intégration dans Ubuntu
1
sudo mkdir -p /opt/PyCDCover
1
sudo cp PyCDCover-x86_64.AppImage /opt/PyCDCover/1
sudo chmod +x /opt/PyCDCover/PyCDCover-x86_64.AppImage
Alacarte
Alacarte permet de créer un exécutable sur les bureaux GNU/Linux
4 Effacement
Effacer l’appimage:
1
sudo rm /opt/PyCDCover/PyCDCover-x86_64.AppImage(Optionnel) Nettoyer le cache d’icônes
1
update-desktop-database ~/.local/share/applications/
5 Scripts “Install.sh
5.1 Script “Install.sh - PyCDCover
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
set -e
APP=PyCDCover
ARCH=x86_64
APPDIR=AppDir
PYTHON=python3
echo "== PyCDCover AppImage builder =="
# 1) Nettoyage
rm -rf "$APPDIR"
rm -f "$APP-$ARCH.AppImage"
# 2) Arborescence AppDir
mkdir -p "$APPDIR/usr/bin"
mkdir -p "$APPDIR/usr/lib/python3/site-packages"
# 3) Copie du projet
cp -r \
Controleur \
Modele \
Vue \
locales \
ressources \
pycdcover.py \
pycdcover.png \
"$APPDIR/"
# 4) Exécutable principal (point d’entrée unique)
cat > "$APPDIR/usr/bin/pycdcover" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
export PYTHONPATH="$HERE/../lib/python3/site-packages:$HERE/../.."
exec python3 "$HERE/../../pycdcover.py"
EOF
chmod +x "$APPDIR/usr/bin/pycdcover"
# 5) AppRun
cat > "$APPDIR/AppRun" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
exec "$HERE/usr/bin/pycdcover"
EOF
chmod +x "$APPDIR/AppRun"
# 6) Fichier .desktop
cat > "$APPDIR/PyCDCover.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=PyCDCover
Exec=pycdcover
Icon=pycdcover
Categories=Audio;Utility;
Terminal=false
EOF
# 7) Icône
cp pycdcover.png "$APPDIR/"
# 8) Dépendances Python
$PYTHON -m pip install -r requirements.txt \
--target "$APPDIR/usr/lib/python3/site-packages" \
--break-system-packages \
--disable-pip-version-check
# 9) appimagetool
if [ ! -f appimagetool-x86_64.AppImage ]; then
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
# 10) Création AppImage
ARCH=$ARCH ./appimagetool-x86_64.AppImage "$APPDIR"
echo "✅ AppImage générée : $APP-$ARCH.AppImage"
5.2 Script “Install.sh - Piveo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -e
APP=Piveo
ARCH=x86_64
APPDIR=AppDir
PYTHON=python3
echo "== Piveo AppImage builder =="
# 1) Nettoyage
rm -rf "$APPDIR"
rm -f "$APP-$ARCH.AppImage"
# 2) Arborescence AppDir
mkdir -p "$APPDIR/usr/bin"
mkdir -p "$APPDIR/usr/lib/python3/site-packages"
# 3) Copie du projet (TOUT le code applicatif)
cp -r \
app \
locales \
ressources \
Piveo.pyw \
piveo.png \
"$APPDIR/"
# 4) Exécutable principal (POINT D’ENTRÉE UNIQUE)
cat > "$APPDIR/usr/bin/piveo" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
# AppDir = deux niveaux au-dessus de usr/bin
export PYTHONPATH="$HERE/../lib/python3/site-packages:$HERE/../.."
exec python3 "$HERE/../../Piveo.pyw"
EOF
chmod +x "$APPDIR/usr/bin/piveo"
# 5) AppRun
cat > "$APPDIR/AppRun" <<'EOF'
#!/bin/bash
HERE="$(dirname "$(readlink -f "$0")")"
exec "$HERE/usr/bin/piveo"
EOF
chmod +x "$APPDIR/AppRun"
# 6) Desktop file
cat > "$APPDIR/Piveo.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=Piveo
Exec=piveo
Icon=piveo
Categories=Education;Utility;
Terminal=false
EOF
# 7) Icône
cp piveo.png "$APPDIR/"
# 8) Dépendances Python (PySide6)
$PYTHON -m pip install PySide6 \
--target "$APPDIR/usr/lib/python3/site-packages" \
--break-system-packages \
--disable-pip-version-check
# 9) appimagetool
if [ ! -f appimagetool-x86_64.AppImage ]; then
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool-x86_64.AppImage
fi
# 10) Création AppImage
ARCH=$ARCH ./appimagetool-x86_64.AppImage "$APPDIR"
echo "✅ AppImage générée : $APP-$ARCH.AppImage"
This post is licensed under CC BY 4.0 by the author.