suckless-extra

A collection of gentoo ebuilds for suckless programs as well as their dependencies and setup scripts
git clone git://git.stellar-nexus.ru/suckless-extra
Log | Files | Refs

sinit-1.1.ebuild (1113B)


      1 # Copyright 2024 Gentoo Authors
      2 # Distributed under the terms of the GNU General Public License v2
      3 
      4 EAPI=8
      5 
      6 inherit toolchain-funcs
      7 
      8 DESCRIPTION="suckless init"
      9 HOMEPAGE="https://core.suckless.org/sinit"
     10 SRC_URI="https://dl.suckless.org/${PN}/${P}.tar.gz"
     11 
     12 S="${WORKDIR}"/"${PN}"
     13 
     14 LICENSE="MIT"
     15 SLOT="0"
     16 KEYWORDS="~amd64"
     17 IUSE="minimal"
     18 
     19 RDEPEND="
     20 	!minimal? ( sys-process/daemontools-encore )
     21 	!minimal? ( sys-apps/littkit )"
     22 PDEPEND="!minimal? ( sys-apps/sinit-scripts )"
     23 
     24 src_unpack() {
     25 	cd "${WORKDIR}"
     26 	tar xf "${WORKDIR}"/../distdir/sinit-1.1.tar.gz
     27 }
     28 
     29 src_prepare() {
     30 	default
     31 
     32 	sed -i \
     33 		-e "s/ -Os//" \
     34 		-e "/^\(LDFLAGS\|CFLAGS\|CPPFLAGS\)/{s| = | += |g;s|-s ||g}" \
     35 		config.mk
     36 }
     37 
     38 src_compile() {
     39 	emake CC="$(tc-getCC)"
     40 }
     41 
     42 src_install() {
     43 	emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" install
     44 	use !minimal &&
     45 	cp /usr/bin/sinit "${D}"/sbin/
     46 }
     47 
     48 pkg_postinst() {
     49 	use minimal &&
     50 	ewarn "Please disable the minimal flag" &&
     51 	ewarn "unless you know what you are doing." &&
     52 	ewarn "Do not delete your current init system" &&
     53 	ewarn "unless you are sure that everything is" &&
     54 	ewarn "set up correctly"
     55 }