Files
snigdhaos-pkgbuilds/snigdhaos-calamares/PKGBUILD
2025-01-11 18:34:41 +05:30

152 lines
3.9 KiB
Bash

# PKGBUILD for snigdhaos-calamares
pkgname=snigdhaos-calamares
_pkgname=calamares
pkgver=3.3.13
pkgrel=06
pkgdesc="Distribution-independent installer framework"
arch=("i686" "x86_64")
url="https://github.com/calamares/calamares/releases"
license=("LGPL")
# Dependencies
provides=("calamares")
depends=(
'boost-libs'
'ckbcomp'
'cryptsetup'
'doxygen'
'efibootmgr'
'gptfdisk'
'gtk-update-icon-cache'
'hwinfo'
'icu'
'kconfig'
'kcoreaddons'
'kcrash'
'ki18n'
'kparts'
'kpmcore'
'kservice'
'kwidgetsaddons'
'libpwquality'
'mkinitcpio-openswap'
'polkit-qt6'
'rsync'
'qt6-declarative'
'solid'
'squashfs-tools'
'yaml-cpp'
)
conflicts=()
makedepends=(
'boost'
'cmake'
'extra-cmake-modules'
'git'
'ninja'
'python-jsonschema'
'python-pyaml'
'python-unidecode'
'qt6-tools'
)
backup=(
'usr/share/calamares/modules/bootloader.conf'
'usr/share/calamares/modules/displaymanager.conf'
'usr/share/calamares/modules/initcpio.conf'
'usr/share/calamares/modules/unpackfs.conf'
)
# Source files
source=(
"calamares::https://github.com/erikdubois/calamares/archive/refs/tags/$pkgver-$pkgrel.tar.gz"
"snigdhaos-calamares.desktop"
"snigdhaos-calamares-debug.desktop"
"calamares_polkit"
)
sha256sums=(
'SKIP' # Placeholder for proper checksum values
'SKIP'
'SKIP'
'SKIP'
)
# Prepare the build environment
prepare() {
cp -rv ../modules/* "${srcdir}/$_pkgname-${pkgver}-${pkgrel}/src/modules/"
# Modify default settings
sed -i -e 's/"Install configuration files" OFF/"Install configuration files" ON/' \
"${srcdir}/${_pkgname}-${pkgver}-${pkgrel}/CMakeLists.txt"
sed -i -e "s/desired_size = 512 \* 1024 \* 1024 # 512MiB/desired_size = 512 \* 1024 \* 1024 \* 4 # 2048MiB/" \
"${srcdir}/${_pkgname}-${pkgver}-${pkgrel}/src/modules/fstab/main.py"
cd "${_pkgname}-${pkgver}-${pkgrel}"
# Update versioning in CMakeLists
sed -i -e "s|CALAMARES_VERSION 3.3.5|CALAMARES_VERSION $pkgver-$pkgrel|g" CMakeLists.txt
# Remove redundant padding properties in QML
sed -i -e '/property real padding: 16;/d' \
"$srcdir/${_pkgname}-${pkgver}-${pkgrel}/src/qml/calamares-qt5/slideshow/Presentation.qml"
sed -i -e '/property real padding: 16;/d' \
"$srcdir/${_pkgname}-${pkgver}-${pkgrel}/src/qml/calamares-qt6/slideshow/Presentation.qml"
}
# Build the package
build() {
cd "${_pkgname}-${pkgver}-${pkgrel}"
cmake -S . -Bbuild \
-GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DWITH_APPSTREAM=OFF \
-DWITH_PYBIND11=OFF \
-DWITH_QT6=ON \
-DSKIP_MODULES="dracut \
dracutlukscfg \
dummycpp \
dummyprocess \
dummypython \
dummypythonqt \
initramfs \
initramfscfg \
interactiveterminal \
keyboardq \
license \
localeq \
oemid \
packagechooserq \
partitionq \
services-openrc \
services-systemd \
summaryq \
tracking \
usersq \
welcomeq \
zfs \
zfshostid"
cmake --build build
}
# Package installation
package() {
cd "${_pkgname}-${pkgver}-${pkgrel}/build"
DESTDIR="${pkgdir}" cmake --build . --target install
# Install desktop and polkit files
install -Dm644 "$srcdir/snigdhaos-calamares.desktop" "$pkgdir/usr/share/applications/snigdhaos-calamares.desktop"
install -Dm644 "$srcdir/snigdhaos-calamares-debug.desktop" "$pkgdir/usr/share/applications/snigdhaos-calamares-debug.desktop"
install -Dm755 "$srcdir/calamares_polkit" "$pkgdir/usr/bin/calamares_polkit"
# Remove default Calamares desktop file
rm "$pkgdir/usr/share/applications/calamares.desktop"
}