-
Notifications
You must be signed in to change notification settings - Fork 3
/
PKGBUILD
113 lines (96 loc) · 3.77 KB
/
PKGBUILD
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
# Maintainers: Portergos Linux <portergoslinux@gmail.com>
# Maintainers: TOS Linux <tom@odex.be>
# python-qt should be installed from the aur (and Boost.python in pip install pyboost)
pkgname=installer
_reponame=calamares
pkgver=3.2.62
pkgrel=2
pkgdesc="calamares installer for TOS"
arch=('any')
url="https://github.com/ODEX-TOS"
license=('GPL3')
optdepends=('update-mirrorlist')
makedepends=('git' 'cmake' 'extra-cmake-modules' 'kpmcore' 'boost-libs')
depends=(
qt5-svg
qt5-webengine
yaml-cpp
networkmanager
upower
qt5-webengine
yaml-cpp
boost
networkmanager
upower
kcoreaddons
kconfig
ki18n
kservice
kwidgetsaddons
kpmcore
squashfs-tools
rsync
cryptsetup
qt5-xmlpatterns
doxygen
dmidecode
gptfdisk
hwinfo
kparts
polkit-qt5
python
qt5ct
solid
qt5-tools
libpwquality)
provides=("${pkgname}")
options=(!strip !emptydirs)
source=(
"git+https://github.com/ODEX-TOS/installer.git#branch=master"
"https://github.com/calamares/calamares/releases/download/v$pkgver/$_reponame-$pkgver.tar.gz"
)
sha256sums=(
'SKIP'
'SKIP'
)
prepare() {
cd $srcdir
# tos' calamares is cloned at source variable, the original calamares is wget below
if [ ! -d $_reponame ]
then
# wget https://github.com/calamares/calamares/releases/download/v$pkgver/$_reponame-$pkgver.tar.gz
# tar -zxvf $_reponame-$pkgver.tar.gz
# rm $_reponame-$pkgver.tar.gz
mv $_reponame-$pkgver $_reponame
rsync -va $pkgname/* $_reponame
fi
# Build proccess can't understand our personal files, so we adjust here
cp -r $pkgname/src/modules/* $_reponame/src/modules/
mkdir -p $_reponame/build/$pkgname
# remove some calamares modules we don't need
rm -r $_reponame/src/modules/{dracut,dracutlukscfg,dummycpp,dummyprocess,dummypython,dummypythonqt,initramfs,plymouthcfg,tracking,webview} ||true
# change some files on the go - distro-specific
sed -i "s?configuration files\" OFF?configuration files\" ON?g" $_reponame/CMakeLists.txt
sed -i "s?username: live?username: liveuser?g" $_reponame/src/modules/removeuser/removeuser.conf
sed -i 's/\"mkinitcpio\", \"-p\", m_kernel/\"mkinitcpio\", \"-P\"/' $_reponame/src/modules/initcpio/InitcpioJob.cpp
sed -i "s?./example.sqfs?\"/run/archiso/bootmnt/tos/x86_64/airootfs.sfs\"?g" $_reponame/src/modules/unpackfs/unpackfs.conf
}
build() {
cd $_reponame/build
cmake .. -DBoost_NO_BOOST_CMAKE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_LIBDIR=/usr/lib -DCMAKE_INSTALL_PREFIX=/usr
export DESTDIR="$srcdir/$_reponame/build/$pkgname" && make -j4 install
}
package() {
local destdir="/usr"
cd $srcdir
# Build proccess can't understand our personal files, so we explicitly copy them here to be packed along calamares files
cp -r $pkgname/src/branding $_reponame/build/$pkgname/usr/share/calamares/
cp -r $pkgname/settings.conf $_reponame/build/$pkgname/usr/share/calamares/
cp -r $pkgname/src/modules/welcome/welcome.conf $_reponame/build/$pkgname/usr/share/calamares/modules/
cp -r $pkgname/src/modules/packages/packages.conf $_reponame/build/$pkgname/usr/share/calamares/modules/
cp -r $pkgname/src/modules/packagechooser/images $_reponame/build/$pkgname/usr/lib/calamares/modules/packagechooser
install -Dm755 "$srcdir"/installer/pacstrap-tos "$pkgdir"/usr/bin/pacstrap-tos
install -Dm755 "$srcdir"/installer/flatpaks.sh "$pkgdir"/etc/tos/flatpaks.sh
# Commom install -D doen't work
cp -r "${srcdir}/${_reponame}/build/$pkgname/"* "${pkgdir}"
}