From 81dde829f6035d6eeae6268b9ac1797352d6a33d Mon Sep 17 00:00:00 2001 From: Kamil Monicz Date: Thu, 25 Sep 2025 11:49:56 +0200 Subject: [PATCH] ubase: init at 0-unstable-2024-03-07 --- pkgs/by-name/ub/ubase/package.nix | 85 +++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 pkgs/by-name/ub/ubase/package.nix diff --git a/pkgs/by-name/ub/ubase/package.nix b/pkgs/by-name/ub/ubase/package.nix new file mode 100644 index 000000000000..d6d1e7d58591 --- /dev/null +++ b/pkgs/by-name/ub/ubase/package.nix @@ -0,0 +1,85 @@ +{ + lib, + stdenv, + fetchgit, + libxcrypt, + testers, + unstableGitUpdater, + which, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "ubase"; + version = "0-unstable-2024-03-07"; + + src = fetchgit { + url = "https://git.suckless.org/ubase"; + rev = "a570a80ed1606bed43118cb148fc83c3ac22b5c1"; + hash = "sha256-afsTkctATIZ6ug9S2gIGoxtFM1h/esgsexyuxXpocs0="; + }; + + strictDeps = true; + enableParallelBuilding = true; + + buildInputs = [ libxcrypt ]; + + makeFlags = [ "PREFIX=${placeholder "out"}" ]; + buildFlags = [ "ubase-box" ]; + installTargets = [ "ubase-box-install" ]; + + passthru = { + updateScript = unstableGitUpdater { }; + + tests = { + ddCopiesBytes = testers.runCommand { + name = "ubase-dd-copies-bytes"; + buildInputs = [ finalAttrs.finalPackage ]; + script = '' + dd if=/dev/zero of=test.bin bs=1 count=4 + set -- $(stat -t test.bin) + [ "$1" = "test.bin" ] && [ "$2" = "4" ] + touch $out + ''; + }; + + idMatchesUid = testers.runCommand { + name = "ubase-id-matches-uid"; + buildInputs = [ finalAttrs.finalPackage ]; + script = '' + [ "$(id -u)" = "$UID" ] + touch $out + ''; + }; + + pagesizePositive = testers.runCommand { + name = "ubase-pagesize-positive"; + buildInputs = [ finalAttrs.finalPackage ]; + script = '' + [ "$(pagesize)" -gt 0 ] + touch $out + ''; + }; + + whichIdIsBox = testers.runCommand { + name = "ubase-which-id-is-box"; + buildInputs = [ + which + finalAttrs.finalPackage + ]; + script = '' + [ $(which id) -ef $(which ubase-box) ] + touch $out + ''; + }; + }; + }; + + meta = { + description = "Linux base utilities from suckless.org"; + homepage = "https://core.suckless.org/ubase/"; + license = lib.licenses.mit; + platforms = lib.platforms.linux; + mainProgram = "ubase-box"; + maintainers = with lib.maintainers; [ Zaczero ]; + }; +})