Files
fempkg_recipes/hyprland.recipe.py
2026-01-28 17:53:44 +01:00

43 lines
2.0 KiB
Python

pkgname = "hyprland" # TODO wen update also update hyprland-libs and coressponding plugins
pkgver = "0.53.1"
source = f"https://github.com/hyprwm/Hyprland/releases/download/v{pkgver}/source-v{pkgver}.tar.gz"
builddir = f"/tmp/fempkg/build/{pkgname}/hyprland-source"
fembuilddir = f"/tmp/fempkg/build/{pkgname}"
outputdir = "/home/gabry/lfs-repo/binpkg"
manifestdir = "/home/gabry/lfs-repo/manifests"
destdir = f"{fembuilddir}/DESTDIR"
deps = [
"cairo", "cmake", "mesa", "libdisplay-info", "libdrm", "libinput",
"libjxl", "libpng", "librsvg", "libwebp", "libzip", "libglvnd", "pixman",
"pugixml", "qt6", "seatd", "tomlplusplus", "wayland", "wayland-protocols", "hwdata",
"glaze", "libliftoff", "re2", "xcb-util-errors", "xwayland", "cpio", "hyprland-libs"
]
build = [
# Extract
f"mkdir /tmp/fempkg/build {fembuilddir} || true && cd {fembuilddir} && tar -xvf /var/lib/fempkg/pkgs/source-v{pkgver}.tar.gz",
f"cd {builddir} && mkdir build && cd build && cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_INSTALL_RPATH=ON -W no-dev -G Ninja .. && ninja",
f"cd {builddir}/build && DESTDIR={destdir} ninja install",
f"""cd {builddir} && cat > {destdir}/usr/share/wayland-sessions/hyprland.desktop << EOF
[Desktop Entry]
Name=Hyprland
Comment=An intelligent dynamic tiling Wayland compositor
Exec=dbus-run-session -- Hyprland
Type=Application
DesktopNames=Hyprland
Keywords=tiling;wayland;compositor;
EOF""",
f"cd {builddir} && sudo chmod 644 {destdir}/usr/share/wayland-sessions/hyprland.desktop",
f"install -v -d -m755 {destdir}/usr/share/licenses/{pkgname}/",
f"install -v -m644 {builddir}/LICENSE {destdir}/usr/share/licenses/{pkgname}/LICENSE",
# 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 {builddir} {fembuilddir}"
]