aboutsummaryrefslogtreecommitdiffstats
path: root/community/calamares/APKBUILD
blob: 06b9cda7687cbab517b6b9d4cb70e288ac3a0386 (plain) (blame)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=calamares
pkgver=3.2.37
pkgrel=1
# ppc64le, s390x, mips, mips64 blocked by qt5-qtwebengine
# armhf blocked by qt5-qtdeclarative
arch="all !ppc64le !s390x !mips !mips64 !armhf"
url="https://calamares.io/"
pkgdesc="Distribution-independent installer framework"
license="GPL-3.0-or-later AND LGPL-2.1-only"
depends="
	ckbcomp
	musl-locales
	os-prober
	python3
	"
depends_dev="
	extra-cmake-modules
	kcoreaddons-dev
	qt5-qttools-dev
	yaml-cpp-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	kconfig-dev
	kcrash-dev
	ki18n-dev
	kpackage-dev
	kparts-dev
	kpmcore-dev
	kservice-dev
	kwidgetsaddons-dev
	libatasmart-dev
	libpwquality-dev
	plasma-framework-dev
	polkit-qt-1-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtsvg-dev
	qt5-qtwebengine-dev
	"
# required for several modules
makedepends="$makedepends
	boost-dev
	boost-python3
	parted-dev
	python3-dev
	"
checkdepends="xvfb-run tzdata"
source="https://github.com/calamares/calamares/archive/v$pkgver/calamares-$pkgver.tar.gz
	modules-load.conf
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"

# Modules to build:
# https://github.com/calamares/calamares/tree/master/src/modules
_modules="
	bootloader
	displaymanager
	finished
	fsresizer
	fstab
	grubcfg
	hostinfo
	hwclock
	interactiveterminal
	keyboard
	keyboardq
	locale
	localeq
	luksbootkeyfile
	luksopenswaphookcfg
	machineid
	mkinitfs
	mount
	netinstall
	networkcfg
	notesqml
	oemid
	packagechooser
	packages
	partition
	plasmalnf
	plymouthcfg
	preservefiles
	rawfs
	removeuser
	services-openrc
	shellprocess
	summary
	umount
	unpackfs
	users
	webview
	welcome
	welcomeq
	"

for i in $_modules; do
	subpackages="$pkgname-mod-$i:_module $subpackages"
done

# Check if $1 is in $_modules
is_module_enabled() {
	local i
	for i in $_modules; do
		[ "$i" = "$1" ] && return 0
	done
	return 1
}

prepare() {
	default_prepare

	local i
	cd "$builddir/src/modules"

	# Fill $_skip_modules, list disabled modules
	msg "Disabled modules:"
	for i in *; do
		if ! [ -d "$i" ] || is_module_enabled "$i"; then
			continue
		fi
		_skip_modules="$_skip_modules $i"
		echo " - $i"
	done

	# List enabled modules
	msg "Enabled modules:"
	for i in $_modules; do
		echo " - $i"
	done
}

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DINSTALL_CONFIG=ON \
		-DSKIP_MODULES="$_skip_modules"
	cmake --build build
}

check() {
	cd build
	# libcalamaresnetworktest requires network access
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "libcalamaresnetworktest"
}

_module() {
	local module=${subpkgname##calamares-mod-}
	local path="usr/lib/calamares/modules"

	mkdir -p "$subpkgdir/$path"
	mv "$pkgdir/$path/$module" "$subpkgdir/$path/$module"

	# Module-specific dependencies
	case "$module" in
		unpackfs)
			depends="$depends rsync"
			install="$install $subpkgname.post-install"
			install -Dm644 "$srcdir"/modules-load.conf \
				"$subpkgdir"/usr/lib/modules-load.d/calamares.conf
			;;
		mkinitfs) depends="$depends mkinitfs" ;;
		locale) depends="$depends tzdata" ;;
	esac
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="fc60381de0e0a1b07f41dd1c329ff9844a6efa06d9df647d3035226602713c8457e51c9c04217ea99f8e197ef3a02520029cdd0cf6b0ada37e5b1f9ee08371d6  calamares-3.2.37.tar.gz
c56ad3b92901abdb41cffaeceeff9a6c8dae3882aacf9a4b654a8898f1e26eeadda3ac3ac799b127b176cc31d397652f27a07bcdfbf7f4ede3c6826d08f7bd7d  modules-load.conf"