110 lines
4.2 KiB
Python
110 lines
4.2 KiB
Python
# TODO update sddm qca caelestia shell qt6ct qcoro qtver wen updating qt6 ver
|
|
pkgname = "qt6"
|
|
pkgver = "6.10.1"
|
|
Pkgver = pkgver[:4]
|
|
source = f"https://download.qt.io/archive/qt/{Pkgver}/{pkgver}/single/qt-everywhere-src-{pkgver}.tar.xz"
|
|
fembuilddir = f"/var/fempkg/build/{pkgname}"
|
|
builddir = f"{fembuilddir}/qt-everywhere-src-{pkgver}"
|
|
deps = ["xorg-libs", "gstreamer", "gst-plugins-base"]
|
|
outputdir = "/home/gabry/lfs-repo/binpkg"
|
|
manifestdir = "/home/gabry/lfs-repo/manifests"
|
|
destdir = f"{fembuilddir}/DESTDIR"
|
|
|
|
build = [
|
|
# Extract and patch source
|
|
f"mkdir -p /var/fempkg/ /var/fempkg/build {fembuilddir} || true && "
|
|
f"cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/qt-everywhere-src-{pkgver}.tar.xz",
|
|
|
|
f"""cd {builddir} && sed -e '/!p->receivedExpose/i \\
|
|
if (e->isExposed) {{\\
|
|
p->positionAutomatic = false;\\
|
|
p->resizeAutomatic = false;\\
|
|
}}' \\
|
|
-i qtbase/src/gui/kernel/qguiapplication.cpp &&
|
|
|
|
sed -e '/Now that the window is created/,+5 d' \\
|
|
-i qtbase/src/gui/kernel/qwindow.cpp""",
|
|
|
|
# Configure
|
|
f"cd {builddir} && mkdir -pv {destdir}/opt/qt-{pkgver} && ln -sfnv qt-{pkgver} {destdir}/opt/qt6 && "
|
|
"./configure -prefix /opt/qt6 -sysconfdir /etc/xdg -dbus-linked -openssl-linked -system-sqlite "
|
|
"-nomake examples -no-rpath -no-sbom -syslog -skip qt3d -skip qtquick3dphysics -skip qtwebengine ",
|
|
# Build & install
|
|
f"cd {builddir} && ninja && DESTDIR={destdir} ninja install",
|
|
|
|
# Fix .prl files
|
|
f"cd {builddir} && find {destdir}/opt/qt6/ -name '*.prl' -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {{}} \\;",
|
|
|
|
# Install icons
|
|
f"cd {builddir} && pushd qttools/src && "
|
|
f"mkdir -p {destdir}/usr/share/pixmaps && "
|
|
f"install -v -Dm644 assistant/assistant/images/assistant-128.png {destdir}/usr/share/pixmaps/assistant-qt6.png && "
|
|
f"install -v -Dm644 designer/src/designer/images/designer.png {destdir}/usr/share/pixmaps/designer-qt6.png && "
|
|
f"install -v -Dm644 linguist/linguist/images/icons/linguist-128-32.png {destdir}/usr/share/pixmaps/linguist-qt6.png && "
|
|
f"install -v -Dm644 qdbus/qdbusviewer/images/qdbusviewer-128.png {destdir}/usr/share/pixmaps/qdbusviewer-qt6.png && popd",
|
|
|
|
# Desktop entries
|
|
f"""cd {builddir} && mkdir -p {destdir}/usr/share/applications && cat > {destdir}/usr/share/applications/assistant-qt6.desktop << EOF
|
|
[Desktop Entry]
|
|
Name=Qt6 Assistant
|
|
Comment=Shows Qt6 documentation and examples
|
|
Exec=/opt/qt6/bin/assistant
|
|
Icon=assistant-qt6.png
|
|
Terminal=false
|
|
Type=Application
|
|
Categories=Qt;Development;Documentation;
|
|
EOF
|
|
|
|
cat > {destdir}/usr/share/applications/designer-qt6.desktop << EOF
|
|
[Desktop Entry]
|
|
Name=Qt6 Designer
|
|
GenericName=Interface Designer
|
|
Comment=Design GUIs for Qt6 applications
|
|
Exec=/opt/qt6/bin/designer
|
|
Icon=designer-qt6.png
|
|
MimeType=application/x-designer;
|
|
Terminal=false
|
|
Type=Application
|
|
Categories=Qt;Development;
|
|
EOF
|
|
|
|
cat > {destdir}/usr/share/applications/linguist-qt6.desktop << EOF
|
|
[Desktop Entry]
|
|
Name=Qt6 Linguist
|
|
Comment=Add translations to Qt6 applications
|
|
Exec=/opt/qt6/bin/linguist
|
|
Icon=linguist-qt6.png
|
|
MimeType=text/vnd.trolltech.linguist;application/x-linguist;
|
|
Terminal=false
|
|
Type=Application
|
|
Categories=Qt;Development;
|
|
EOF
|
|
|
|
cat > {destdir}/usr/share/applications/qdbusviewer-qt6.desktop << EOF
|
|
[Desktop Entry]
|
|
Name=Qt6 QDbusViewer
|
|
GenericName=D-Bus Debugger
|
|
Comment=Debug D-Bus applications
|
|
Exec=/opt/qt6/bin/qdbusviewer
|
|
Icon=qdbusviewer-qt6.png
|
|
Terminal=false
|
|
Type=Application
|
|
Categories=Qt;Development;Debugger;
|
|
EOF""",
|
|
|
|
f"mkdir -p {destdir}/etc/profile.d && wget https://rocketleaguechatp.duckdns.org/qt6.sh -O {destdir}/etc/profile.d/qt6.sh",
|
|
|
|
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
|
|
f"cp -pv {builddir}/LICENSES/* {destdir}/usr/share/licenses/{pkgname}/",
|
|
|
|
# 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",
|
|
|
|
f"rm -rf {builddir} {fembuilddir}"
|
|
]
|
|
|
|
triggers = [
|
|
f'cd /tmp && find /opt -maxdepth 1 -type d -name "qt-6*" ! -name "qt-{pkgver}" ! -name "qt6" -exec rm -rf {{}} +',
|
|
{"rebuild_package": ["sddm", "quickshell", "qt6ct", "qca"]}
|
|
] |