suckless-extra

A collection of suckless programs that are not in the main repo as well as their dependencies and setup scripts
git clone git://git.stellar-nexus.ru/suckless-extra
Log | Files | Refs

commit 3d0bc00214cfa6d557499dea9bb57582074c3d13
Author: Plat <plat@stellar-nexus.ru>
Date:   Sun,  4 Aug 2024 19:26:03 +0000

Initial commit

Diffstat:
Ametadata/layout.conf | 3+++
Anet-misc/sdhcp/Manifest | 1+
Anet-misc/sdhcp/metadata.xml | 11+++++++++++
Anet-misc/sdhcp/sdhcp-0.1.ebuild | 39+++++++++++++++++++++++++++++++++++++++
Aprofiles/eapi | 1+
Aprofiles/repo_name | 1+
Asys-apps/littkit/Manifest | 1+
Asys-apps/littkit/littkit-0.90.ebuild | 18++++++++++++++++++
Asys-apps/littkit/metadata.xml | 11+++++++++++
Asys-apps/sinit-scripts/Manifest | 1+
Asys-apps/sinit-scripts/files/alsa-wo-udev/run | 29+++++++++++++++++++++++++++++
Asys-apps/sinit-scripts/files/sinit-scripts-1.0-alsa-wo-udev.diff | 15+++++++++++++++
Asys-apps/sinit-scripts/files/sinit-scripts-1.0-fs-fix.diff | 14++++++++++++++
Asys-apps/sinit-scripts/metadata.xml | 14++++++++++++++
Asys-apps/sinit-scripts/sinit-scripts-1.0-r1.ebuild | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asys-apps/sinit/Manifest | 1+
Asys-apps/sinit/metadata.xml | 11+++++++++++
Asys-apps/sinit/sinit-1.1.ebuild | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 files changed, 288 insertions(+), 0 deletions(-)

diff --git a/metadata/layout.conf b/metadata/layout.conf @@ -0,0 +1,3 @@ +masters = gentoo +thin-manifests = true +sign-manifests = false diff --git a/net-misc/sdhcp/Manifest b/net-misc/sdhcp/Manifest @@ -0,0 +1 @@ +DIST sdhcp-0.1.tar.gz 153600 BLAKE2B ad8d7a4d0e62dc64613ed0ee74a60df366d2a3bcfdc2d7ca4a1578677a22dc4d121bf71941387a81b09cd47c869e752eadfce6fd0ed83264e4314db0b09383ab SHA512 31e370a53db5157dc3f4adf751d9e3151599a32632e305785ee59ee8bbc4d48bd102d7da85cc0d0cf7e67e52a58ca508d21221705d7087fd6293bc345fddecd6 diff --git a/net-misc/sdhcp/metadata.xml b/net-misc/sdhcp/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> +<email>plat@stellar-nexus.ru</email> +<name>Plat</name> +</maintainer> +<longdescription> +sdhcp is a simple, tiny DHCP client. It runs until it enters the "Bound" state, then forks to the background and runs as a daemon to keep the lease alive. +</longdescription> +</pkgmetadata> diff --git a/net-misc/sdhcp/sdhcp-0.1.ebuild b/net-misc/sdhcp/sdhcp-0.1.ebuild @@ -0,0 +1,39 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="simple dhcp client" +HOMEPAGE="https://core.suckless.org/sdhcp +https://git.2f30.org/sdhcp/files.html" +SRC_URI="https://dl.2f30.org/releases/${P}.tar.gz" + +S="${S%-0.1}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +src_unpack() { + cd "${WORKDIR}" + tar xf "${WORKDIR}"/../distdir/sdhcp-0.1.tar.gz +} + +src_prepare() { + default + + sed -i \ + -e "s/ -Os / /" \ + -e "/^\(LDFLAGS\|CFLAGS\|CPPFLAGS\)/{s| = | += |g;s|-s ||g}" \ + config.mk +} + +src_compile() { + emake CC="$(tc-getCC)" +} + +src_install() { + emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install +} diff --git a/profiles/eapi b/profiles/eapi @@ -0,0 +1 @@ +8 diff --git a/profiles/repo_name b/profiles/repo_name @@ -0,0 +1 @@ +suckless-extra diff --git a/sys-apps/littkit/Manifest b/sys-apps/littkit/Manifest @@ -0,0 +1 @@ +DIST littkit_0_90.tgz 4325 BLAKE2B 9bbcb45ba13b33caf0b37c89cc30ccc83fee4e67df3c12ceb95f5c9e8e862a6be262b9886985c1130c28ac1ae0f36cae9198299440ff5573a1d24803329ab9b6 SHA512 3c0473a9e641ad577fc94ebdb31edca7c7c09460217b3daa0e72a48a7fdf117ba76b2fd7246dff9fcefbe69143ff5c61b3c8b2f9523d92d21c04393ef5933219 diff --git a/sys-apps/littkit/littkit-0.90.ebuild b/sys-apps/littkit/littkit-0.90.ebuild @@ -0,0 +1,18 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="a set of shell scripts to implement oredered-startup and run-once capabilities" +HOMEPAGE="https://troubleshooters.com/projects/littkit" +SRC_URI="https://troubleshooters.com/projects/${PN}/downloads/${PN}_${PV//./_}.tgz" + +S="${WORKDIR}"/littkit_0_90 + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +src_install() { + dobin lk_* +} diff --git a/sys-apps/littkit/metadata.xml b/sys-apps/littkit/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> +<email>plat@stellar-nexus.ru</email> +<name>Plat</name> +</maintainer> +<longdescription> +LittKit is a set of shellscripts to implement ordered-startup and run-once capabilities within daemontools, daemontools-encore, and other daemontools-inspired software. +</longdescription> +</pkgmetadata> diff --git a/sys-apps/sinit-scripts/Manifest b/sys-apps/sinit-scripts/Manifest @@ -0,0 +1 @@ +DIST main.tar.gz 25163 BLAKE2B 57829490ae929b6e9fd84a66bb82847f4ba450223cde12c85304063f289d6bac578ff45cb8035fb5a91c9146073133f5684aa355cfb83afb463de0f74d24c03a SHA512 36959ae403f85425d68123b304cd8a901bdd1a16ffd0caa234605b5287f1d04ec2973c15790f426442c955d0aec2ec1baa2e443115e39d71f650c74602b4dd0f diff --git a/sys-apps/sinit-scripts/files/alsa-wo-udev/run b/sys-apps/sinit-scripts/files/alsa-wo-udev/run @@ -0,0 +1,29 @@ +#!/bin/sh +#Fix for sound in alsa without udev +#Code mostly copied from OpenRC +alsastatedir=/var/lib/alsa +alsascrdir=/etc/alsa.d +alsahomedir=/run/alsasound +cards="$(sed -n -e 's/^ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)" +for cardnum in $cards; do + [ -e /dev/snd/controlC$cardnum ] || sleep 2 + [ -e /dev/snd/controlC$cardnum ] || sleep 2 + [ -e /dev/snd/controlC$cardnum ] || sleep 2 + [ -e /dev/snd/controlC$cardnum ] || sleep 2 + alsactl -E HOME="$alsahomedir" -I -f "$alsastatedir/asound.state" restore $cardnum +done + +for ossfile in "$alsastatedir"/oss/card*_pcm* ; do + [ -e "$ossfile" ] || continue + # We use cat because I'm not sure if cp works properly on /proc + procfile=$ossfile$alsastatedir/oss + procfile="$(echo "$procfile" | sed -e 's,_,/,g')" + if [ -e /proc/asound/"$procfile"/oss ] ; then + cat "$ossfile" > /proc/asound/"$procfile"/oss + fi +done +sleep 3 +chown root:audio /dev/snd/* +chown root:audio /dev/snd +chmod -R a+rw /dev/snd +lk_forever 3600 diff --git a/sys-apps/sinit-scripts/files/sinit-scripts-1.0-alsa-wo-udev.diff b/sys-apps/sinit-scripts/files/sinit-scripts-1.0-alsa-wo-udev.diff @@ -0,0 +1,15 @@ +Fixes sound in alsa in case udev is not installed or an alternative implementation is used +Patch by Plat + +--- sinit-scripts-main/var/rc/dtinit/dtinit.sh ++++ sinit-scripts-main/var/rc/dtinit/dtinit.sh +@@ -33,6 +33,9 @@ + lk_runsvc /etc/rc/tty5 0 + lk_runsvc /etc/rc/tty6 0 + ++log "alsa-without-udev-fix" ++lk_runsvc /etc/rc/alsa-wo-udev ++ + # Uncomment if needed + # lk_runsvc /etc/rc/sddm 0 + diff --git a/sys-apps/sinit-scripts/files/sinit-scripts-1.0-fs-fix.diff b/sys-apps/sinit-scripts/files/sinit-scripts-1.0-fs-fix.diff @@ -0,0 +1,14 @@ +A simple fix for some systems failing to boot without remounting +Patch by Plat + +--- sinit-scripts-main/bin/rc.init ++++ sinit-scripts-main/bin/rc.init +@@ -58,6 +58,8 @@ + [ "$HOSTNAME" ] && echo "$HOSTNAME" >| /proc/sys/kernel/hostname + + echo; ++mount -o remount / ++echo; + echo "Starting daemontools-encore..." + + lk_prepare /etc/rc diff --git a/sys-apps/sinit-scripts/metadata.xml b/sys-apps/sinit-scripts/metadata.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<upstream> +<remote-id type="github">Andrey0189/sinit-scripts</remote-id> +</upstream> +<maintainer type="person"> +<email>plat@stellar-nexus.ru</email> +<name>Plat</name> +</maintainer> +<longdescription> +Collection of services for suckless init with daemontools-encore process manager and LittKit for process ordering. +</longdescription> +</pkgmetadata> diff --git a/sys-apps/sinit-scripts/sinit-scripts-1.0-r1.ebuild b/sys-apps/sinit-scripts/sinit-scripts-1.0-r1.ebuild @@ -0,0 +1,62 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit savedconfig + +DESCRIPTION="Collection of services for suckless init" +HOMEPAGE="https://github.com/Andrey0189/sinit-scripts" +SRC_URI="https://github.com/Andrey0189/sinit-scripts/archive/refs/heads/main.tar.gz" + +S="${S%1.0}main" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" + +DEPEND="sys-apps/sinit" +RDEPEND="${DEPEND} +sys-process/daemontools-encore +sys-apps/littkit" + +PATCHES=( + "${FILESDIR}/${P}-fs-fix.diff" + "${FILESDIR}/${P}-alsa-wo-udev.diff" +) + +src_prepare() { + default + + cp -r "${FILESDIR}"/alsa-wo-udev ./var/rc/ + chmod +x ./var/rc/alsa-wo-udev/run + restore_config var/rc/dtinit/dtinit.sh +} + +src_install() { + dodir var/rc + cp -r ./var/rc "${D}"/var/ + keepdir etc/rc + into / + dobin ./bin/* + dosbin ./sbin/* + save_config var/rc/dtinit/dtinit.sh +} + +pkg_postinst() { + ln -s /sbin/shutdown /sbin/reboot + ln -s /sbin/shutdown /sbin/poweroff + ln -s /var/rc/* /etc/rc/ + ewarn "You may need to add new services." + ewarn "To add new services run:" + ewarn "mkdir /var/rc/service_name" + ewarn "touch /var/rc/service_name/run # main execution script for the service." + ewarn "#Note: daemontools-encore is going to restart the service every time it finishes execution of the run file." + ewarn "#If you want to avoid this add \"lk_forever 3600\" at the end of the script." + ewarn "chmod u+x /var/rc/service_name/run" + ewarn "ln -s /var/rc/service_name /etc/rc/" + ewarn "# Add \"log 'service_name'\" (optionally) and \"lk_runsvc /etc/rc/service_name 0\" to /etc/rc/dtinit/dtinit.sh" + elog " -< Succeeded. Now you can reboot >- " + [ -f ${ROOT}/etc/hostname ] || + ewarn "File ${ROOT}/etc/hostname is missing. Copy /etc/localhost or create one" +} diff --git a/sys-apps/sinit/Manifest b/sys-apps/sinit/Manifest @@ -0,0 +1 @@ +DIST sinit-1.1.tar.gz 112640 BLAKE2B 29c1fa93b5f65dc61c8f229012611d23b7955f4393951a5bb06b0969d595d59b129e0c36fff3649feb2d300f0410f25b83ff60a23cbbf9d9c4ada099293dca21 SHA512 16094142756921e050f425a59cf35874c706b54fc01499a7fb940bb659c0d8bf8833118a7720f934825ed3c1b51f969b5456ed2ee583c110115347ad1aae1016 diff --git a/sys-apps/sinit/metadata.xml b/sys-apps/sinit/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="person"> +<email>plat@stellar-nexus.ru</email> +<name>Plat</name> +</maintainer> +<longdescription> +sinit is a simple init. It is configured by modifying "config.h" and recompiling the code. +</longdescription> +</pkgmetadata> diff --git a/sys-apps/sinit/sinit-1.1.ebuild b/sys-apps/sinit/sinit-1.1.ebuild @@ -0,0 +1,55 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="suckless init" +HOMEPAGE="https://core.suckless.org/sinit" +SRC_URI="https://dl.suckless.org/${PN}/${P}.tar.gz" + +S="${S%-1.1}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="minimal" + +RDEPEND=" + !minimal? ( sys-process/daemontools-encore ) + !minimal? ( sys-apps/littkit )" +PDEPEND="!minimal? ( sys-apps/sinit-scripts )" + +src_unpack() { + cd "${WORKDIR}" + tar xf "${WORKDIR}"/../distdir/sinit-1.1.tar.gz +} + +src_prepare() { + default + + sed -i \ + -e "s/ -Os / /" \ + -e "/^\(LDFLAGS\|CFLAGS\|CPPFLAGS\)/{s| = | += |g;s|-s ||g}" \ + config.mk +} + +src_compile() { + emake CC="$(tc-getCC)" +} + +src_install() { + emake DESTDIR="${D}" PREFIX="/usr/" install + use !minimal && + cp /usr/bin/sinit "${D}"/sbin/ +} + +pkg_postinst() { + use minimal && + ewarn "Please disable the minimal flag" && + ewarn "unless you know what you are doing." && + ewarn "Do not delete your current init system" && + ewarn "unless you are sure that everything is" && + ewarn "set up correctly" +}