do not edit — generated by btf.
git.druid.rocksindexdruid520portsports/coreutils/sbase/pkg.conf

ports/coreutils/sbase/pkg.conf


pkg_name="sbase"
pkg_license="mit"
pkg_ver="git"
pkg_tags="coreutils"
pkg_pref="10"
pkg_conflicts="busybox gnu-coreutils"
pkg_fetch="git:https://git.suckless.org/sbase"
 
# bc.c is generated from bc.y at build time (a real yacc grammar file,
# checked directly against sbase's own Makefile) -- and only ever
# worked by coincidence (byacc happening to already be installed for
# some unrelated reason whenever sbase last got built from scratch),
# confirmed for real hitting "yacc: inaccessible or not found"
# building sbase fresh in isolation with byacc genuinely absent.
# DELIBERATELY NOT declared as pkg_bdepend="%yacc" (tried for real,
# reverted): every package on this system, sbase included, gets
# %coreutils appended to its own effective deps via this tree's own
# GLOBAL_DEPS setting -- and %coreutils resolves to sbase itself. a
# real, unbreakable cycle at "mp reinstall sbase" (confirmed for real:
# "err: dependency cycle at sbase"), not a bootstrap-ordering quirk
# fixable by repointing a tag the way TAG_coreutils=coreutils/busybox
# breaks the analogous gnu-bison/gnu-m4 cycle elsewhere -- there is no
# alternative %coreutils provider left on this system to repoint to at
# all (busybox is gone; ubase deliberately doesn't claim this tag).
# sbase must stay entirely dependency-free; whoever rebuilds it from
# scratch needs byacc (or another real yacc) already present by hand.
 
# del.sh deliberately removes nothing (see remove:'s own comment
# below) -- mp's own manifest-driven remove: cleanup would otherwise
# unlink every one of sbase's ~90 basic utilities anyway once it
# exits, defeating the whole point the same way it did for
# languages/perl5, libcs/musl, coreutils/busybox, compression/zstd+
# zlib, and init/sinit.
pkg_manifest_cleanup="no"
 
install:
	# sbase's own bundled "make" clone (make/make, a genuine, real
	# utility it ships -- not a mistake in ITS OWN Makefile) is
	# deliberately dropped from what actually gets installed here: this
	# system already has a real, chosen %make default (see project
	# notes), and sbase's own minimal make landing at $MP_PREFIX/bin/make
	# would otherwise silently shadow it (confirmed for real: it broke a
	# completely unrelated later build, coreutils/ubase's own Makefile,
	# when this port's own bin dir came first on PATH for a sysroot
	# build -- sbase's own "make" doesn't support the GNU-isms ubase's
	# Makefile assumes). the OTHER ~90 sbase utilities are unaffected.
	grep -vE '^[[:space:]]*make/make\\?$' Makefile > Makefile.new && mv Makefile.new Makefile
	make CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" ASFLAGS="$ASFLAGS" -j$MP_JOBS
	make install PREFIX=$MP_PREFIX
	# sbase names this utility "xinstall" (avoiding a name collision
	# with GNU coreutils' own "install", presumably so both could
	# coexist on a system that has both) -- but with busybox gone,
	# NOTHING on this system provides the plain "install" name anymore,
	# and virtually every C project's own "make install" step calls
	# "install" directly. hit for real: installing compilers/tcc failed
	# outright ("install: inaccessible or not found") the very first
	# time anything else tried to install after this port's own busybox
	# replacement went live. real behavior, not just the name, is what
	# every consumer needs -- xinstall.c implements the standard
	# install(1) CLI (confirmed directly against its own source: -D/-m/
	# -o/-g, no divergent semantics), so a plain symlink is a correct,
	# not just convenient, fix.
	ln -sf xinstall $MP_PREFIX/bin/install
	# egrep/fgrep: sbase's own grep does NOT dispatch on argv0 like
	# busybox's multicall binary did (confirmed for real: a plain "ln
	# -sf grep egrep" symlink still runs in BRE mode, not ERE) -- it
	# just supports -E/-F as ordinary flags. real, standalone consumers
	# still invoke the bare "egrep"/"fgrep" names though (hit for real:
	# curl's own autoconf-generated configure script does "checking for
	# egrep..." unconditionally and hard-fails outright, "no acceptable
	# egrep could be found", when neither exists). thin wrapper scripts,
	# not symlinks, since the dispatch has to actually inject the flag.
	printf '#!/bin/sh\nexec grep -E "$@"\n' > $MP_PREFIX/bin/egrep
	printf '#!/bin/sh\nexec grep -F "$@"\n' > $MP_PREFIX/bin/fgrep
	chmod 755 $MP_PREFIX/bin/egrep $MP_PREFIX/bin/fgrep
	make clean || true
 
remove:
	# deliberately does nothing -- same reasoning as languages/perl5,
	# libcs/musl, coreutils/busybox, compression/zstd+zlib, and
	# init/sinit's own remove: sbase is the SOLE coreutils provider on
	# this system (ls, cp, mkdir, grep, sed, tr, cat, mv, rm, ...
	# essentially everything), with zero OS-level fallback once it's
	# gone (ubase only covers util-linux-style tools, nothing
	# overlapping). This was hit for real, hard: a "make uninstall" here
	# wiped ~90 basic utilities before the reinstall could complete,
	# breaking even mp itself (its own #!/usr/bin/env perl shebang
	# couldn't resolve once /usr/bin/env was gone) -- recovered by
	# hand-placing ~21 critical binaries directly via gcc, bypassing the
	# missing cp/install/mkdir entirely, in the same session this
	# comment was written. Never again: leave the old, working copy
	# alone; install:'s own "make install" overwrites every one of
	# these binaries in place, one at a time, only once the new build
	# has actually succeeded -- there is no window where a basic tool is
	# simply gone.
	true
powered by btf.