-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_appimage.sh
More file actions
executable file
·86 lines (72 loc) · 2.84 KB
/
Copy pathbuild_appimage.sh
File metadata and controls
executable file
·86 lines (72 loc) · 2.84 KB
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
80
81
82
83
84
85
86
#!/bin/bash
# AppImage Packaging Script for Pardus Boot Analyzer
set -e
PKG_NAME="pardus-boot-analyzer"
APP_DIR="AppDir"
echo "Creating clean AppDir structure..."
rm -rf "$APP_DIR"
mkdir -p "$APP_DIR/usr/share/$PKG_NAME"
mkdir -p "$APP_DIR/usr/share/applications"
mkdir -p "$APP_DIR/usr/share/icons/hicolor/48x48/apps"
cp -r main.py "$APP_DIR/usr/share/$PKG_NAME/"
cp -r src "$APP_DIR/usr/share/$PKG_NAME/"
cp -r ui "$APP_DIR/usr/share/$PKG_NAME/"
cp -r locale "$APP_DIR/usr/share/$PKG_NAME/"
cp pardus-boot-analyzer.svg "$APP_DIR/usr/share/$PKG_NAME/"
# Remove pycache
find "$APP_DIR" -type d -name "__pycache__" -exec rm -rf {} + || true
echo "Creating desktop entry..."
cat << EOF > "$APP_DIR/usr/share/applications/$PKG_NAME.desktop"
[Desktop Entry]
Name=Pardus Başlangıç Yöneticisi
Name[en]=Pardus Boot Analyzer
Comment=Sistem açılış süresini analiz et ve başlangıç programlarını yönet
Comment[en]=Analyze system boot time and manage startup applications
Exec=pardus-boot-analyzer
Icon=pardus-boot-analyzer
Terminal=false
Type=Application
Categories=System;Settings;GTK;
StartupNotify=true
EOF
# Copy desktop file to root of AppDir
cp "$APP_DIR/usr/share/applications/$PKG_NAME.desktop" "$APP_DIR/"
echo "Copying custom SVG icon..."
mkdir -p "$APP_DIR/usr/share/icons/hicolor/scalable/apps"
cp pardus-boot-analyzer.svg "$APP_DIR/usr/share/icons/hicolor/scalable/apps/pardus-boot-analyzer.svg"
cp pardus-boot-analyzer.svg "$APP_DIR/pardus-boot-analyzer.svg"
# Also make a copy with the app ID name at root for appimagetool compatibility
cp pardus-boot-analyzer.svg "$APP_DIR/.DirIcon"
echo "Creating AppRun entrypoint..."
cat << 'EOF' > "$APP_DIR/AppRun"
#!/bin/sh
SELF=$(readlink -f "$0")
HERE=$(dirname "$SELF")
# Run main.py using host python3
exec python3 "$HERE/usr/share/pardus-boot-analyzer/main.py" "$@"
EOF
chmod +x "$APP_DIR/AppRun"
echo "Locating appimagetool..."
TOOL_PATH="/home/ergin/Projects/python_gtk/appimagetool"
if [ -f "$TOOL_PATH" ] && [ -x "$TOOL_PATH" ]; then
echo "Found local appimagetool at $TOOL_PATH"
else
TOOL_PATH="./appimagetool-x86_64.AppImage"
if [ ! -f "$TOOL_PATH" ]; then
echo "Local tool not found, downloading appimagetool from GitHub releases..."
curl -L -o "$TOOL_PATH" "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x "$TOOL_PATH"
fi
fi
echo "Building AppImage..."
# Run tool with ARCH environment variable
ARCH=x86_64 "$TOOL_PATH" "$APP_DIR" "Pardus_Boot_Analyzer-x86_64.AppImage"
echo "Cleaning up AppDir..."
rm -rf "$APP_DIR"
echo "===================================================="
echo "AppImage successfully built:"
echo "-> Pardus_Boot_Analyzer-x86_64.AppImage"
echo ""
echo "You can run it on any system using:"
echo " ./Pardus_Boot_Analyzer-x86_64.AppImage"
echo "===================================================="