From 87d540f7d607ef23df07479d7c9fe595f9a205a9 Mon Sep 17 00:00:00 2001 From: Alexander Hill Date: Sun, 8 Feb 2026 07:10:59 -0500 Subject: [PATCH] Replaced util-linux with ubase --- docs/SOFTWARE.md | 2 +- docs/STATUS.md | 2 +- docs/licensebar.svg | 6 ++-- scripts/pkgconflict.sh | 14 ++++++++++ sources/ubase/ubase.spec | 28 +++++++++++++++++++ sources/util-linux/util-linux-byacc.patch | 20 ------------- sources/util-linux/util-linux.spec | 34 ----------------------- 7 files changed, 47 insertions(+), 59 deletions(-) create mode 100755 scripts/pkgconflict.sh create mode 100644 sources/ubase/ubase.spec delete mode 100644 sources/util-linux/util-linux-byacc.patch delete mode 100644 sources/util-linux/util-linux.spec diff --git a/docs/SOFTWARE.md b/docs/SOFTWARE.md index b09d24e..ff07245 100644 --- a/docs/SOFTWARE.md +++ b/docs/SOFTWARE.md @@ -56,7 +56,7 @@ | GNU tar | Free Software Foundation, Inc. | GNU General Public License version 3 | Copyleft | | tinyramfs | illiliti | GNU General Public License version 3 | Copyleft | | tinytoml | Fourier Transformer | MIT License | Free | -| util-linux | Various | GNU General Public License version 2 | Copyleft | +| Unportable Base | Various | MIT/X Consortium License | Free | | xz | Various | Mostly BSD 0-Clause License | Slightly Copyleft | | Zlib | Jean-loup Gailly and Mark Adler | Zlib License | Free | | Zsh | The Zsh development group | Mostly MIT License (Modern Variant) | Slightly Copyleft | diff --git a/docs/STATUS.md b/docs/STATUS.md index 6b17aa9..5720316 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -75,7 +75,7 @@ Definitions: | `tar` | Yes | Yes | | `tinyramfs` | Yes | Yes | | `tinytoml` | Yes | Yes | -| `util-linux` | Yes | Yes | +| `ubase` | Yes | No | | `xlibre-xserver` | | `xz` | Yes | Yes | | `zlib` | Yes | Yes | diff --git a/docs/licensebar.svg b/docs/licensebar.svg index bd35ec1..56b7450 100644 --- a/docs/licensebar.svg +++ b/docs/licensebar.svg @@ -1,8 +1,8 @@ - - - + + + diff --git a/scripts/pkgconflict.sh b/scripts/pkgconflict.sh new file mode 100755 index 0000000..d1921ca --- /dev/null +++ b/scripts/pkgconflict.sh @@ -0,0 +1,14 @@ +#!/bin/sh +if [ -z "$1" ]; then + echo "Usage: pkgconflict.sh " >&2 + exit 1 +fi +BUFFER=$(mktemp) +for pkg in $1/*.cpio.xz; do + # NOTE: This only highlights the need for machine-readable filenames. ~ahill + NAME=$(basename $pkg | sed -E "s/-[0-9].+$//") + bsdcpio -iJt < $pkg | sed -E "/^\.(\/(bin|boot|etc|lib|usr|usr\/include|usr\/share|usr\/share\/man|usr\/share\/man\/man[1-8]))?$/d" | sed "s/$/:$NAME/" >> $BUFFER +done +# First time using Lua for something like this. Is there a better way to write this? ~ahill +sort -k1,1 -t: $BUFFER | lua -e "l, s = nil, {} for p, n in io.read(\"*all\"):gmatch(\"([^:]+):(%S+)\") do if p == l then table.insert(s, n) else if #s > 1 then io.write(l .. \":\" .. table.concat(s, \",\")) end l, s = p, {n} end end" +rm $BUFFER diff --git a/sources/ubase/ubase.spec b/sources/ubase/ubase.spec new file mode 100644 index 0000000..1366e35 --- /dev/null +++ b/sources/ubase/ubase.spec @@ -0,0 +1,28 @@ +# Maintainer: Alexander Hill +SRC_HASH="962ea0f6e91f9557121bc1c9e44fb9b303dd33a4ba39c3ac0d18c5eb0db3d1c6" +SRC_NAME="ubase" +SRC_URL="https://linux.maple.camp/git/mirror/ubase/archive/e8249b49ca3e02032dece5e0cdac3d236667a6d9.tar.gz" +SRC_VERSION="e8249b4" + +# NOTE: ubase hasn't had a tag created in twelve years, and significant progress +# has been made since then. To get the version number, I'm using: +# git describe --always --tags +# This seems to work well, but I'm not sure why it doesn't detect the last +# tag that was created. Doing a deeper dive reveals a different commit +# hash for the tagged version, despite being the same thing. Maybe someone +# smarter than me can figure it out? +# https://linux.maple.camp/git/mirror/ubase/commit/c3341ac588dd6675f8e8725b72ab214c1042721d +# https://linux.maple.camp/git/mirror/ubase/commit/fffdb91ada0cc1af981ad8a36a4f5a64b5fa819d + +SRC_FILENAME="ubase-$SRC_VERSION.tar.gz" + +build() { + tar xf ../$SRC_FILENAME + cd ubase/ + sed -E -i "s|^PREFIX.+|PREFIX = $TT_PREFIX|" config.mk + sed -E -i "s|^MANPREFIX.+|MANPREFIX = $TT_DATADIR/man|" config.mk + # NOTE: Basic system utilities should be statically linked anyways. ~ahill + sed -E -i "/^(C|LD)FLAGS/s/$/ -static/" config.mk + make -j $TT_PROCS + make -j $TT_PROCS install DESTDIR=$TT_INSTALLDIR +} diff --git a/sources/util-linux/util-linux-byacc.patch b/sources/util-linux/util-linux-byacc.patch deleted file mode 100644 index f461542..0000000 --- a/sources/util-linux/util-linux-byacc.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- vanilla/meson.build 2025-12-15 07:50:01.000000000 -0500 -+++ maple/meson.build 2026-02-06 21:58:53.463319033 -0500 -@@ -952,7 +952,7 @@ - have = get_option('use-tty-group') - conf.set('USE_TTY_GROUP', have ? 1 : false) - --bison = find_program('bison') -+bison = find_program('byacc') - flex = find_program('flex') - sed = find_program('sed') - -@@ -960,7 +960,7 @@ - bison_gen = generator( - bison, - output : ['@BASENAME@.tab.c', '@BASENAME@.tab.h'], -- arguments : ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']) -+ arguments : ['--defines', '@OUTPUT1@', '--output', '@OUTPUT0@', '@INPUT@']) - - python_program = find_program('python3', 'python', native : true) - diff --git a/sources/util-linux/util-linux.spec b/sources/util-linux/util-linux.spec deleted file mode 100644 index 6eb3df3..0000000 --- a/sources/util-linux/util-linux.spec +++ /dev/null @@ -1,34 +0,0 @@ -# Maintainer: Alexander Hill -SRC_HASH="25dc2fd70c6b6bec1c0c97cb11636edd2d5b2645df2324eef4820db3677bd412" -SRC_NAME="util-linux" -SRC_URL="https://github.com/util-linux/util-linux/archive/refs/tags/v2.41.3.tar.gz" -SRC_VERSION="2.41.3" - -SRC_FILENAME="util-linux-$SRC_VERSION.tar.gz" -SRC_PATCHES=" -64867fc3cd34263137f8db91839fad44f0096f76602a4281b3e542e344ae97cc util-linux-byacc.patch -" - -build() { - tar xf ../$SRC_FILENAME - cd util-linux-$SRC_VERSION/ - # NOTE: util-linux is hard-coded to use bison, so we need to patch the build - # script to use byacc. In addition to the difference in name, byacc - # has slightly different arguments, resulting in an error later on in - # the build. Because of this, the command line arguments are patched - # as well. ~ahill - patch -p1 < ../util-linux-byacc.patch - # NOTE: I'm not sure why, but muon doesn't seem to be able to build libfdisk - # and libmount, so they are disabled for now. ~ahill - # NOTE: libsmartcols appears to rely on some bison-specific behavior that - # byacc seems to lack, so we aren't able to build the software at this - # time. ~ahill - muon setup $TT_MESON_COMMON \ - -Dbuild-libfdisk=disabled \ - -Dbuild-libmount=disabled \ - -Dbuild-libsmartcols=disabled \ - -Dbuild-python=disabled \ - build - muon samu -C build - muon -C build install -d $TT_INSTALLDIR -}