-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·112 lines (97 loc) · 2.96 KB
/
build.sh
File metadata and controls
executable file
·112 lines (97 loc) · 2.96 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
# Build script - see below for command information.
set -e
# Parse arguments
ARCH_BUILD=false
while [[ $# -gt 0 ]]; do
case $1 in
--arch)
ARCH_BUILD=true
shift
;;
*)
break
;;
esac
done
if [ "$ARCH_BUILD" = true ]; then
echo "Building Arch package..."
mkdir -p build
cmake --workflow --preset default
# Get version from debian/changelog
VERSION=$(dpkg-parsechangelog -SVersion 2>/dev/null || echo "25.09.02")
# Create package structure
mkdir -p pkg/usr/bin pkg/usr/share/polkit-1/actions pkg/usr/share/applications pkg/usr/lib/quick-system-info-gui pkg/usr/share/quick-system-info-gui/locale pkg/usr/share/icons/hicolor/48x48/apps pkg/usr/share/doc/quick-system-info-gui
# Install files
cp _build_/Release/quick-system-info-gui pkg/usr/bin/
cp actions/* pkg/usr/share/polkit-1/actions/
cp *.desktop pkg/usr/share/applications/
cp lib/* pkg/usr/lib/quick-system-info-gui/
cp _build_/*.qm pkg/usr/share/quick-system-info-gui/locale/
cp icons/* pkg/usr/share/icons/hicolor/48x48/apps/
cp help/* pkg/usr/share/doc/quick-system-info-gui/
# Create .PKGINFO file
cat > pkg/.PKGINFO << EOF
pkgname = quick-system-info-gui
pkgver = $VERSION-1
pkgdesc = A utility to show quick-system-info (inxi, etc...) in a gui
url = https://github.com/MX-Linux/quick-system-info-gui
builddate = $(date +%s)
packager = opencode
size = $(du -sb pkg/usr | cut -f1)
arch = x86_64
license = GPL3
depend = qt6-base
depend = libarchive
depend = polkit
optdepend = inxi: for system information display
optdepend = grep: for text processing
EOF
# Skip .MTREE file
# Create tar.zst package
cd pkg
tar -c .PKGINFO usr/ | zstd -T0 -19 > ../build/quick-system-info-gui-$VERSION-1-x86_64.pkg.tar.zst
cd ..
rm -rf pkg
echo "Arch package created: build/quick-system-info-gui-$VERSION-1-x86_64.pkg.tar.zst"
exit 0
fi
case "${1:-all}" in
clean)
echo "Performing ultimate clean..."
rm -rf _build_
;;
configure)
echo "Configuring project..."
cmake --preset default
;;
make-clean)
echo "Cleaning build artifacts..."
cmake --build --preset default --target clean
;;
make)
echo "Building project..."
cmake --build --preset default
;;
all)
echo "Configuring and building project..."
cmake --workflow --preset default
;;
fresh)
echo "Fresh build (clean first, then configure and build)..."
cmake --workflow --preset default --fresh
;;
*)
echo "Usage: $0 [options] [command]"
echo "Options:"
echo " --arch - Build tar.zst package for Arch Linux and place in build/"
echo "Commands:"
echo " clean - Ultimate clean (rm -rf build)"
echo " configure - Configure only"
echo " make-clean - Clean build artifacts only"
echo " make - Build only"
echo " all - Configure and build (default)"
echo " fresh - Clean first then configure and build"
exit 1
;;
esac