~mil/sxmo-build

ref: 871c98bd4a45a1a39b4734bd30dd0133b8f6e2dd sxmo-build/sxmo_build_all.sh -rwxr-xr-x 1.7 KiB
871c98bd — Jochen Sprickerhof Add Alpine Linux 2 months ago
                                                                                
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
#!/bin/sh

mkdir -p build-sxmo-dev || exit 1

cd build-sxmo-dev || exit 1


echo "Installing build dependencies (permanently, this may prompt for your sudo password)">&2
if [ -f /etc/os-release ]; then
    # freedesktop.org and systemd
    . /etc/os-release
    OS=$NAME
else
    OS="Unknown"
fi

case $OS in
    "Arch Linux ARM")
        sudo pacman -Syu --needed libxft libx11 libxinerama webkit2gtk xorgproto linux-headers fontconfig freetype2 libxext libinput ncurses base-devel || exit 1
        ;;
    "Alpine Linux"|postmarketOS)
	sudo apk add libxft-dev libx11-dev libxinerama-dev webkit2gtk-dev xproto linux-headers fontconfig-dev freetype-dev libxext-dev libinput-dev libudev-zero-dev ncurses alpine-sdk coreutils || exit 1
	;;
    "Debian GNU/Linux")
	sudo apt install libxft-dev libx11-dev libxinerama-dev libwebkit2gtk-4.0-dev x11proto-dev libx11-xcb-dev libxcb-res0-dev libinput-dev || exit 1
	;;
    *)
	echo "Unknown distribution! Exiting!"
	exit 1
	;;
esac

repos="~mil/sxmo-utils ~mil/sxmo-dwm ~mil/sxmo-dmenu ~mil/lisgd ~mil/sxmo-surf ~mil/sxmo-st ~proycon/svkbd ~mil/sxmo-xdm-config"

for repo in $repos; do
	echo "Obtaining $repo...">&2
	repodir="$(basename "$repo")"
	if [ -d "$repodir" ]; then
		cd "$repodir" || exit 1
		git pull --ff-only || exit 1
	else
		git clone "https://git.sr.ht/$repo" || exit 1
		cd "$repodir" || exit 1
	fi
	echo "Building $repo... (may request sudo password)">&2
	sudo make clean
	if [ -f config.def.h ] && [ -f config.h ]; then
		cp -f config.def.h config.h
	fi
	sudo make PREFIX=/usr install || exit 1
	if [ "$repo" = "~mil/sxmo-utils" ]; then
		rc-update add sxmo-pinephone default
	elif [ "$repo" = "~mil/sxmo-xdm-config" ]; then
		rc-update add xdm default
	fi
	cd .. || exit 1
done

cd .. || exit 1

echo "All done!"
exit 0