161 lines
5.9 KiB
Python
161 lines
5.9 KiB
Python
pkgname = "kde-plasma"
|
|
pkgver = "6.5.2"
|
|
kf6_ver = "6.20.0"
|
|
source = f"https://rocketleaguechatp.duckdns.org/pappalaugh.jpg"
|
|
builddir = f"/tmp/fempkg/build/{pkgname}/{pkgname}-{pkgver}"
|
|
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
|
|
deps = [
|
|
# REQUIRED
|
|
"boost", "ffmpeg", "gtk3", "kf6", "kirigami-addons", "libdisplay-info", "libpwquality", "libqalculate", "libnl", "libxcvt",
|
|
"libxkbcommon", "mesa", "wayland", "opencv", "phonon", "pipewire", "pulseaudio-qt", "qca", "qcoro", "sassc", "taglib",
|
|
"xdotool", "xorg-evdev", "phonon-backend-vlc",
|
|
# Reccomended (practically required)
|
|
"gsettings-desktop-schemas", "libcanberra", "libinput", "libpcap", "libwacom", "xorg-wacom", "Linux-PAM", "lm-sensors",
|
|
"oxygen-icons", "pciutils", "power-profiles-daemon", "python",
|
|
# Reccomended (runtime)
|
|
"accountsservice", "breeze-icons", "xdg-desktop-portal", "xwayland", "noto-fonts", "system-config-printer", #"kio-extras", smartmontools
|
|
# optional
|
|
"appstream", "glu", "plymouth" # wont add more since no have :laugh:
|
|
]
|
|
|
|
build = [
|
|
# make fembuiasczxcx zxczxczxc
|
|
f"mkdir -p {fembuilddir}",
|
|
f"mkdir -p {destdir}/opt/kf6-{kf6_ver} && ln -sfn kf6-{kf6_ver} {destdir}/opt/kf6",
|
|
f"mkdir -p {destdir}/opt/kf6/{{etc,share}}",
|
|
|
|
f"""mkdir -p {destdir}$KF6_PREFIX/etc/dbus-1 &&
|
|
mkdir -p {destdir}$KF6_PREFIX/share/dbus-1 &&
|
|
mkdir -p {destdir}$KF6_PREFIX/share/polkit-1""",
|
|
|
|
f"mkdir -p {destdir}/etc/dbus-1 {destdir}/usr/share/dbus-1 {destdir}/usr/share/polkit-1",
|
|
|
|
f"cd {fembuilddir} && wget https://rocketleaguechatp.duckdns.org/plasma-{pkgver}.md5 && "
|
|
f"wget -r -nH -nd -A '*.xz' -np https://rocketleaguechatp.duckdns.org/plasma/ || true",
|
|
|
|
f"""cd {fembuilddir} && bash -e <<'EOF'
|
|
while read -r line; do
|
|
|
|
# Get the file name, ignoring comments and blank lines
|
|
if $(echo $line | grep -E -q '^ *$|^#' ); then continue; fi
|
|
file=$(echo $line | cut -d" " -f2)
|
|
|
|
pkg=$( echo $file|sed 's|^.*/||') # Remove directory
|
|
name=$( echo $pkg |sed 's|-6.*$||') # Isolate package name
|
|
packagedir=$(echo $pkg |sed 's|\\.tar.*||') # Source directory
|
|
|
|
tar -xvf $file
|
|
pushd $packagedir
|
|
|
|
mkdir build
|
|
cd build
|
|
|
|
cmake -D CMAKE_INSTALL_PREFIX=$KF6_PREFIX \\
|
|
-D CMAKE_INSTALL_LIBEXECDIR=libexec \\
|
|
-D CMAKE_BUILD_TYPE=Release \\
|
|
-D BUILD_QT5=OFF \\
|
|
-D BUILD_TESTING=OFF \\
|
|
-D ENABLE_DOCS=OFF \\
|
|
-W no-dev .. &&
|
|
|
|
make -j$(nproc)
|
|
make DESTDIR={destdir} install
|
|
|
|
# ---- license copying (best-effort) ----
|
|
licensedir={destdir}/usr/share/licenses/$name
|
|
mkdir -p $licensedir
|
|
|
|
find .. -type f \\( \\
|
|
-iname COPYING -o \\
|
|
-iname COPYRIGHT -o \\
|
|
-iname NOTICE -o \\
|
|
-iname LICENSE -o \\
|
|
-iname LICENCE \\
|
|
\\) -exec cp -pv {{}} $licensedir \\; || true
|
|
|
|
find .. -type d -iname LICENSES | while read -r licdir; do
|
|
cp -pvra $licdir/* $licensedir/ || true
|
|
done || true
|
|
|
|
popd
|
|
|
|
rm -rf $packagedir
|
|
/sbin/ldconfig || true
|
|
|
|
done < plasma-{pkgver}.md5
|
|
EOF""",
|
|
|
|
# DM & portals etc
|
|
f"""# Setup xsessions (X11 sessions)
|
|
install -dvm 755 {destdir}/usr/share/xsessions
|
|
cd {destdir}/usr/share/xsessions
|
|
|
|
[ -e plasma.desktop ] ||
|
|
ln -sfv $KF6_PREFIX/share/xsessions/plasmax11.desktop
|
|
|
|
# Setup wayland-sessions
|
|
install -dvm 755 {destdir}/usr/share/wayland-sessions
|
|
cd {destdir}/usr/share/wayland-sessions
|
|
|
|
[ -e plasmawayland.desktop ] ||
|
|
ln -sfv $KF6_PREFIX/share/wayland-sessions/plasma.desktop
|
|
|
|
# Setup xdg-desktop-portal
|
|
install -dvm 755 {destdir}/usr/share/xdg-desktop-portal
|
|
cd {destdir}/usr/share/xdg-desktop-portal
|
|
|
|
[ -e kde-portals.conf ] ||
|
|
ln -sfv $KF6_PREFIX/share/xdg-desktop-portal/kde-portals.conf
|
|
|
|
# Setup kde portal
|
|
install -dvm 755 {destdir}/usr/share/xdg-desktop-portal/portals
|
|
cd {destdir}/usr/share/xdg-desktop-portal/portals
|
|
|
|
[ -e kde.portal ] ||
|
|
ln -sfv $KF6_PREFIX/share/xdg-desktop-portal/portals/kde.portal""",
|
|
|
|
# remove useless systemd bloat
|
|
f"rm -rf {destdir}$KF6_PREFIX/lib/systemd",
|
|
|
|
# Linux-PAM setup
|
|
f"mkdir -p {destdir}/etc/pam.d",
|
|
f"wget https://rocketleaguechatp.duckdns.org/kde -O {destdir}/etc/pam.d/kde",
|
|
f"wget https://rocketleaguechatp.duckdns.org/kde-np -O {destdir}/etc/pam.d/kde-np",
|
|
f"wget https://rocketleaguechatp.duckdns.org/kscreensaver -O {destdir}/etc/pam.d/kscreensaver",
|
|
|
|
# Move payloads safely (no globbing, no dotfile loss)
|
|
f"""if [ -d {destdir}/opt/kf6/etc/dbus-1 ]; then
|
|
cp -aT {destdir}/opt/kf6/etc/dbus-1 {destdir}/etc/dbus-1 &&
|
|
rm -rf {destdir}/opt/kf6/etc/dbus-1
|
|
fi""",
|
|
|
|
f"""if [ -d {destdir}/opt/kf6/share/dbus-1 ]; then
|
|
cp -aT {destdir}/opt/kf6/share/dbus-1 {destdir}/usr/share/dbus-1 &&
|
|
rm -rf {destdir}/opt/kf6/share/dbus-1
|
|
fi""",
|
|
|
|
f"""if [ -d {destdir}/opt/kf6/share/polkit-1 ]; then
|
|
cp -aT {destdir}/opt/kf6/share/polkit-1 {destdir}/usr/share/polkit-1 &&
|
|
rm -rf {destdir}/opt/kf6/share/polkit-1
|
|
fi""",
|
|
|
|
# Replace directories with symlinks (explicit + safe)
|
|
f"""rm -rf {destdir}$KF6_PREFIX/etc/dbus-1 &&
|
|
ln -sfn /etc/dbus-1 {destdir}$KF6_PREFIX/etc/dbus-1""",
|
|
|
|
f"""rm -rf {destdir}$KF6_PREFIX/share/dbus-1 &&
|
|
ln -sfn /usr/share/dbus-1 {destdir}$KF6_PREFIX/share/dbus-1 &&
|
|
ln -sfn /usr/share/polkit-1 {destdir}$KF6_PREFIX/share/polkit-1""",
|
|
|
|
# Make tarball + manifests
|
|
f"mkdir -p {outputdir} && cd {destdir} && tar --transform 's|^\\.||' -I zstd -cf {outputdir}/{pkgname}-{pkgver}.tar.zst .",
|
|
f"mkdir -p {manifestdir} && tar -tf {outputdir}/{pkgname}-{pkgver}.tar.zst | grep -v '/$' > {manifestdir}/{pkgname}.txt",
|
|
|
|
# Cleanup
|
|
f"rm -rf {fembuilddir}"
|
|
]
|