From d8f1b1253741f7c357def6ac79535100b974ab73 Mon Sep 17 00:00:00 2001 From: TheK0tYaRa Date: Sat, 23 Aug 2025 13:34:19 +0000 Subject: [PATCH] x11-misc/ly-1.1.2 --- x11-misc/ly/Manifest | 4 + x11-misc/ly/ly-1.1.2.ebuild | 159 +++++++++++++++++++++++++++ x11-misc/ly/ly-9999.ebuild | 211 ++++++++++++++++++++++++++++++++++++ x11-misc/ly/metadata.xml | 18 +++ 4 files changed, 392 insertions(+) create mode 100644 x11-misc/ly/Manifest create mode 100644 x11-misc/ly/ly-1.1.2.ebuild create mode 100644 x11-misc/ly/ly-9999.ebuild create mode 100644 x11-misc/ly/metadata.xml diff --git a/x11-misc/ly/Manifest b/x11-misc/ly/Manifest new file mode 100644 index 0000000..1ecaf69 --- /dev/null +++ b/x11-misc/ly/Manifest @@ -0,0 +1,4 @@ +DIST ly-1.1.2.tar.gz 129306 BLAKE2B 4242075ae247722c589ef3b58b029f95206f4948f569a5c20220dd40e7f6ec8ae1a315b903a13d32e3244a9bdcd45084493152c737526fdceb2d7f44403a3cdf SHA512 a3841ae8a29aba3c17c715de3caa7e7450602f8a824f07b8749816f77c8fdfe7b103ed4cc890da71e8582a28c166ad2dd09fc2178854ebf8a99e3f0cece753a3 +DIST zig-clap-0.10.0.tar.gz 27187 BLAKE2B dbf4152f07b8097dd5288db4431ab65b64ffc66a3e1622fd3274fdea591238beddb077e973ffd70fce8f584980b7f0a5264fa8ea642a9b4f05010ff1e2f8aa03 SHA512 612b114c731270cb44c05ad4dbc915210485d9451a2cb5d6fcfd225f50ade04ef15b7f56c9e4b27daa54a51fc51417cd9e9cf38a36ff4d2feaba015d52481365 +DIST zigini-2ed3d417f17fab5b0ee8cad8a63c6d62d7ac1042.tar.gz 6108 BLAKE2B f6851646b7de6fad81249d39ea92b4fd896014a7d97e1751219b6c7b2cd68c7a109d42e1e9f4b75da680476a7ca4a4429dbf4b30562a851c6067e64721265742 SHA512 d4b206cd4c7aef04e91aa739ec73ba22604dcf3da9d9750905edc057a712361a7b478d8097766c5fa856faddbedbef0f90e5c17d5735e3ca24a1dba929f83c99 +DIST ziglibini-e18d36665905c1e7ba0c1ce3e8780076b33e3002.tar.gz 7398 BLAKE2B e8f8a026c876d120340f57beb4fda3fba396fe4f1f0aa5515f76399a68291087aa0909dde69139e4153a60587e37dd8b4ba94c5f481ce42c60a0cfee5f31cbe6 SHA512 3d18368d5e0e06e24a580698bec9eb35d85dfc528d4b24a354e41b402b31c06a547a3e85d59254781b1e0eafe13c1db23bebbd4a531c6a6a789af2e833e5a693 diff --git a/x11-misc/ly/ly-1.1.2.ebuild b/x11-misc/ly/ly-1.1.2.ebuild new file mode 100644 index 0000000..e977b23 --- /dev/null +++ b/x11-misc/ly/ly-1.1.2.ebuild @@ -0,0 +1,159 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit edo pam systemd prefix + +DESCRIPTION="Ly - a TUI display manager" +HOMEPAGE="https://github.com/fairyglade/ly" + +CLAP="0.10.0" +ZIGINI="2ed3d417f17fab5b0ee8cad8a63c6d62d7ac1042" #"0bba97a12582928e097f4074cc746c43351ba4c8" +ZIGLIBINI="e18d36665905c1e7ba0c1ce3e8780076b33e3002" + +SRC_URI=" + https://github.com/fairyglade/ly/archive/v${PV}/${P}.tar.gz + https://github.com/Hejsil/zig-clap/archive/${CLAP}.tar.gz -> zig-clap-${CLAP}.tar.gz + https://github.com/Kawaii-Ash/zigini/archive/${ZIGINI}.tar.gz -> zigini-${ZIGINI}.tar.gz + https://github.com/ziglibs/ini/archive/${ZIGLIBINI}.tar.gz -> ziglibini-${ZIGLIBINI}.tar.gz +" + +LICENSE="WTFPL-2" +SLOT="0" +KEYWORDS="~amd64" + +EZIG_MIN="0.14" +EZIG_MAX_EXCLUSIVE="0.15" + +DEPEND=" + || ( dev-lang/zig-bin:${EZIG_MIN} dev-lang/zig:${EZIG_MIN} ) + sys-libs/pam + x11-libs/libxcb +" +RDEPEND=" + x11-base/xorg-server + x11-apps/xauth + x11-apps/xrdb + x11-apps/xmessage + sys-libs/ncurses +" + +# https://github.com/ziglang/zig/issues/3382 +QA_FLAGS_IGNORED="usr/bin/ly" + +RES="${S}/res" + +PATCHES=( +) + +# copied from sys-fs/ncdu::gentoo +# Many thanks to Florian Schmaus (Flowdalic)! +# Adapted from https://github.com/gentoo/gentoo/pull/28986 +# Set the EZIG environment variable. +zig-set_EZIG() { + [[ -n ${EZIG} ]] && return + + if [[ -n ${EZIG_OVERWRITE} ]]; then + export EZIG="${EZIG_OVERWRITE}" + return + fi + + local candidate selected selected_ver ver + + for candidate in "${BROOT}"/usr/bin/zig-*; do + if [[ ! -L ${candidate} || ${candidate} != */zig?(-bin)-+([0-9.]) ]]; then + continue + fi + + ver=${candidate##*-} + + if [[ -n ${EZIG_EXACT_VER} ]]; then + ver_test "${ver}" -ne "${EZIG_EXACT_VER}" && continue + + selected="${candidate}" + selected_ver="${ver}" + break + fi + + if [[ -n ${EZIG_MIN} ]] \ + && ver_test "${ver}" -lt "${EZIG_MIN}"; then + # Candidate does not satisfy EZIG_MIN condition. + continue + fi + + if [[ -n ${EZIG_MAX_EXCLUSIVE} ]] \ + && ver_test "${ver}" -ge "${EZIG_MAX_EXCLUSIVE}"; then + # Candidate does not satisfy EZIG_MAX_EXCLUSIVE condition. + continue + fi + + if [[ -n ${selected_ver} ]] \ + && ver_test "${selected_ver}" -gt "${ver}"; then + # Candidate is older than the currently selected candidate. + continue + fi + + selected="${candidate}" + selected_ver="${ver}" + done + + if [[ -z ${selected} ]]; then + die "Could not find (suitable) zig installation in ${BROOT}/usr/bin" + fi + + export EZIG="${selected}" + export EZIG_VER="${selected_ver}" +} + +ezig() { + zig-set_EZIG + edo "${EZIG}" "${@}" +} + +src_unpack() { + default + + mkdir "${S}/deps" || die + ezig fetch --global-cache-dir "${S}/deps" "${DISTDIR}/zig-clap-${CLAP}.tar.gz" + ezig fetch --global-cache-dir "${S}/deps" "${DISTDIR}/zigini-${ZIGINI}.tar.gz" + ezig fetch --global-cache-dir "${S}/deps" "${DISTDIR}/ziglibini-${ZIGLIBINI}.tar.gz" +} + +src_prepare(){ + default + # Adjusting absolute paths in the following files to use Gentoo's ${EPREFIX} + hprefixify "${RES}/config.ini" "${RES}/setup.sh" + #"${RES}/xsetup.sh" "${RES}/wsetup.sh" +} + +src_compile() { + # Building ly & accomodate for prefixed environment + ezig build --system "${S}/deps/p/" -Doptimize=ReleaseSafe #-Ddata_directory="${EPREFIX}/etc/ly" +} + +src_install() { + dobin "${S}/zig-out/bin/${PN}" + newinitd "${RES}/${PN}-openrc" ly + systemd_dounit "${RES}/${PN}.service" + insinto /etc/ly + doins "${RES}/config.ini" "${RES}/setup.sh" + #"${RES}/xsetup.sh" "${RES}/wsetup.sh" + insinto /etc/ly/lang + doins "${RES}"/lang/*.ini + newpamd "${RES}/pam.d/ly" ly + fperms +x /etc/${PN}/setup.sh + #{x,w}setup.sh +} + +pkg_postinst() { + systemd_reenable "${PN}.service" + + ewarn + ewarn "The init scripts are installed only for systemd/openrc" + ewarn "If you are using something else like runit etc." + ewarn "Please check upstream for get some help" + ewarn "You may need to take a look at /etc/ly/config.ini" + ewarn "If you are using a window manager as DWM" + ewarn "Please make sure there is a .desktop file in /usr/share/xsessions for it" +} diff --git a/x11-misc/ly/ly-9999.ebuild b/x11-misc/ly/ly-9999.ebuild new file mode 100644 index 0000000..6f2cf12 --- /dev/null +++ b/x11-misc/ly/ly-9999.ebuild @@ -0,0 +1,211 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit edo pam systemd git-r3 prefix + +DESCRIPTION="Ly - a TUI display manager (live ebuild)" +HOMEPAGE="https://github.com/fairyglade/ly" + +EGIT_REPO_URI="https://github.com/fairyglade/ly.git" + +LICENSE="WTFPL-2" +SLOT="0" + +# Specify the required Zig version range +EZIG_MIN="0.13" +EZIG_MAX_EXCLUSIVE="0.14" + +DEPEND=" + || ( dev-lang/zig-bin:${EZIG_MIN} dev-lang/zig:${EZIG_MIN} ) + sys-libs/pam + x11-libs/libxcb +" +RDEPEND=" + x11-base/xorg-server + x11-apps/xauth + sys-libs/ncurses + x11-apps/xrdb +" + +# Ignore QA warnings about missing build-id for Zig binaries +# https://github.com/ziglang/zig/issues/3382 +QA_FLAGS_IGNORED="usr/bin/ly" + +RES="${S}/res" + +# Function to dynamically fetch dependency versions from build.zig.zon +fetch_deps_dynamically() { + local build_zig_zon="${S}/build.zig.zon" + local content + + if [[ ! -f "${build_zig_zon}" ]]; then + eerror "build.zig.zon not found at ${build_zig_zon}" + return 1 + fi + + content=$(<"${build_zig_zon}") + + # Extract CLAP version + if [[ "${content}" =~ clap.*?refs/tags/([0-9]+\.[0-9]+\.[0-9]+) ]]; then + CLAP="refs/tags/${BASH_REMATCH[1]}" + else + eerror "Failed to extract CLAP version" + return 1 + fi + + # Extract ZIGINI commit hash + if [[ "${content}" =~ zigini.*?/([a-f0-9]{40})\.tar\.gz ]]; then + ZIGINI="${BASH_REMATCH[1]}" + else + eerror "Failed to extract ZIGINI commit hash" + return 1 + fi + + einfo "Extracted CLAP version: ${CLAP}" + einfo "Extracted ZIGINI commit: ${ZIGINI}" +} + +# Function to fetch nested dependency versions +fetch_nested_deps_dynamically() { + local root_build_zig_zon="${S}/build.zig.zon" + local root_content + local zigini_hash + local nested_build_zig_zon + local nested_content + + # Read the root build.zig.zon + root_content=$(<"${root_build_zig_zon}") + + # Extract the hash for the zigini dependency + if [[ "${root_content}" =~ zigini.*hash[[:space:]]*=[[:space:]]*\"([a-f0-9]+)\" ]]; then + zigini_hash="${BASH_REMATCH[1]}" + else + eerror "Failed to extract zigini hash from root build.zig.zon" + return 1 + fi + + # Construct the path to the nested build.zig.zon + nested_build_zig_zon="${WORKDIR}/deps/p/${zigini_hash}/build.zig.zon" + + if [[ ! -f "${nested_build_zig_zon}" ]]; then + eerror "Nested build.zig.zon not found at ${nested_build_zig_zon}" + return 1 + fi + + # Read the nested build.zig.zon + nested_content=$(<"${nested_build_zig_zon}") + + # Extract the ZIGLIBINI value + if [[ "${nested_content}" =~ ini.*?/([a-f0-9]{40})\.tar\.gz ]]; then + ZIGLIBINI="${BASH_REMATCH[1]}" + else + eerror "Failed to extract ZIGLIBINI commit hash" + return 1 + fi + + einfo "Extracted ZIGLIBINI commit: ${ZIGLIBINI}" +} + +# Function to set the EZIG environment variable +zig-set_EZIG() { + [[ -n ${EZIG} ]] && return + if [[ -n ${EZIG_OVERWRITE} ]]; then + export EZIG="${EZIG_OVERWRITE}" + return + fi + local candidate selected selected_ver ver + for candidate in "${BROOT}"/usr/bin/zig-*; do + if [[ ! -L ${candidate} || ${candidate} != */zig?(-bin)-+([0-9.]) ]]; then + continue + fi + ver=${candidate##*-} + if [[ -n ${EZIG_EXACT_VER} ]]; then + ver_test "${ver}" -ne "${EZIG_EXACT_VER}" && continue + selected="${candidate}" + selected_ver="${ver}" + break + fi + if [[ -n ${EZIG_MIN} ]] \ + && ver_test "${ver}" -lt "${EZIG_MIN}"; then + # Candidate does not satisfy EZIG_MIN condition. + continue + fi + if [[ -n ${EZIG_MAX_EXCLUSIVE} ]] \ + && ver_test "${ver}" -ge "${EZIG_MAX_EXCLUSIVE}"; then + # Candidate does not satisfy EZIG_MAX_EXCLUSIVE condition. + continue + fi + if [[ -n ${selected_ver} ]] \ + && ver_test "${selected_ver}" -gt "${ver}"; then + # Candidate is older than the currently selected candidate. + continue + fi + selected="${candidate}" + selected_ver="${ver}" + done + if [[ -z ${selected} ]]; then + die "Could not find (suitable) zig installation in ${BROOT}/usr/bin" + fi + export EZIG="${selected}" + export EZIG_VER="${selected_ver}" +} + +# Wrapper function for zig command +ezig() { + zig-set_EZIG + edo "${EZIG}" "${@}" +} + +# Unpack source and fetch dependencies +src_unpack() { + git-r3_src_unpack + # Fetch CLAP and ZIGINI + fetch_deps_dynamically + mkdir "${WORKDIR}/deps" || die + ezig fetch --global-cache-dir "${WORKDIR}/deps" "https://github.com/Hejsil/zig-clap/archive/${CLAP}.tar.gz" + ezig fetch --global-cache-dir "${WORKDIR}/deps" "https://github.com/Kawaii-Ash/zigini/archive/${ZIGINI}.tar.gz" + # Fetch ZIGLIBINI + fetch_nested_deps_dynamically + ezig fetch --global-cache-dir "${WORKDIR}/deps" "https://github.com/ziglibs/ini/archive/${ZIGLIBINI}.tar.gz" +} + +src_prepare(){ + default + # Adjusting absolute paths in the following files to use Gentoo's ${EPREFIX} + hprefixify "${RES}/config.ini" "${RES}/setup.sh" +} + +src_compile() { + # Building ly & accomodate for prefixed environment + ezig build --system "${WORKDIR}/deps/p" -Doptimize=ReleaseSafe +} + +# Install the binary and configuration files +src_install() { + dobin "${S}/zig-out/bin/${PN}" + newinitd "${RES}/${PN}-openrc" ly + systemd_dounit "${RES}/${PN}.service" + insinto /etc/ly + doins "${RES}/config.ini" "${RES}/setup.sh" + insinto /etc/ly/lang + doins "${RES}"/lang/*.ini + newpamd "${RES}/pam.d/ly" ly + fperms +x /etc/${PN}/setup.sh +} + +# Post-installation messages and warnings +pkg_postinst() { + systemd_reenable "${PN}.service" + ewarn + ewarn "The init scripts are installed only for systemd/openrc" + ewarn "If you are using something else like runit etc." + ewarn "Please check upstream for get some help" + ewarn "You may need to take a look at /etc/ly/config.ini" + ewarn "If you are using a window manager as DWM" + ewarn "Please make sure there is a .desktop file in /usr/share/xsessions for it" + ewarn + ewarn "This is a live ebuild, which means it will always install the latest commit." + ewarn "If you encounter any issues, please report them to the upstream project." +} diff --git a/x11-misc/ly/metadata.xml b/x11-misc/ly/metadata.xml new file mode 100644 index 0000000..a7a0655 --- /dev/null +++ b/x11-misc/ly/metadata.xml @@ -0,0 +1,18 @@ + + + + + saigon-tech@tuta.io + Michal Vu + + + Ly is a lightweight TUI (Terminal User Interface) display manager for Linux. + It aims to be simple, fast, and easily configurable. Ly supports various + desktop environments and window managers, and provides a minimalistic + yet functional login experience. It's designed to be an alternative to + heavier graphical display managers while still offering essential features. + + + fairyglade/ly + +