forked from archsink/pkgbuilds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-pkgs
executable file
·38 lines (31 loc) · 863 Bytes
/
build-pkgs
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
#!/bin/bash
set -e
cd "$(dirname "$0")"
if ! command -v makepkg > /dev/null; then
echo "This script requires makepkg on your PATH!"
exit 1
fi
echo "==> Reading packages"
pkgs=()
while IFS= read -r line; do
if [[ "$line" != "#"* ]] && [[ -n "$line" ]]; then
pkgs+=("$line")
fi
done < packages.txt
echo "==> Setting up build directory"
builddir="$PWD/build"
mkdir -p "$builddir"
echo "==> Building the packages"
for pkg in "${pkgs[@]}"; do
(
cd "$pkg"
# Build the package (and compress later to speed things up under emulation)
if PKGDEST="$builddir" PKGEXT='.pkg.tar' makepkg -si --noconfirm --nocheck; then
echo "$pkg built successfully"
else
echo "::warning title=$pkg could not be built::See the build logs for details"
fi
# Clean up the src and pkg directories to save space
rm -rf src pkg
)
done