summaryrefslogtreecommitdiffstats
path: root/coreutils-hybrid
diff options
context:
space:
mode:
authorkj-sh6042025-05-27 01:02:09 -0400
committerkj-sh6042025-05-27 01:02:09 -0400
commitefc9425de781cbe6c35ddc9b7e9ab4bf06cfcacf (patch)
tree9f5e682581221fa38bbc652def464d8226e99938 /coreutils-hybrid
parent20dd9649c35b09401fb511ad33892be6d25b9c9c (diff)
refactor: re-organize files²
Diffstat (limited to 'coreutils-hybrid')
-rw-r--r--coreutils-hybrid/.SRCINFO34
-rw-r--r--coreutils-hybrid/.gitignore6
-rw-r--r--coreutils-hybrid/PKGBUILD81
-rw-r--r--coreutils-hybrid/disable_selinux.patch13
4 files changed, 134 insertions, 0 deletions
diff --git a/coreutils-hybrid/.SRCINFO b/coreutils-hybrid/.SRCINFO
new file mode 100644
index 0000000..58b8ea5
--- /dev/null
+++ b/coreutils-hybrid/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = coreutils-hybrid
+ pkgdesc = (warning: use at own risk) Cross-platform Rust rewrite of the GNU coreutils being used as actual system coreutils
+ pkgver = 0.1.0
+ pkgrel = 1
+ url = https://github.com/uutils/coreutils
+ arch = x86_64
+ license = GPL3
+ license = MIT
+ makedepends = rust
+ makedepends = cargo
+ makedepends = python-sphinx
+ depends = glibc
+ depends = acl
+ depends = attr
+ depends = gmp
+ depends = libcap
+ depends = openssl
+ depends = gcc-libs
+ depends = libkeccak
+ depends = oniguruma
+ provides = coreutils
+ provides = b3sum
+ provides = sha3sum
+ conflicts = coreutils
+ conflicts = b3sum
+ conflicts = sha3sum
+ source = https://ftp.gnu.org/gnu/coreutils/coreutils-9.7.tar.xz
+ source = uutils-coreutils-0.1.0.tar.gz::https://github.com/uutils/coreutils/archive/0.1.0.tar.gz
+ source = disable_selinux.patch
+ sha256sums = e8bb26ad0293f9b5a1fc43fb42ba970e312c66ce92c1b0b16713d7500db251bf
+ sha256sums = 55c528f2b53c1b30cb704550131a806e84721c87b3707b588a961a6c97f110d8
+ sha256sums = 302614165d99f04600627222ddad0444a0144fcad6a1ff59ad43fb0b3162060e
+
+pkgname = coreutils-hybrid
diff --git a/coreutils-hybrid/.gitignore b/coreutils-hybrid/.gitignore
new file mode 100644
index 0000000..6b2b2ea
--- /dev/null
+++ b/coreutils-hybrid/.gitignore
@@ -0,0 +1,6 @@
+pkg/
+src/
+*.tar
+*.tar.zst
+*.tar.gz
+*.tar.xz
diff --git a/coreutils-hybrid/PKGBUILD b/coreutils-hybrid/PKGBUILD
new file mode 100644
index 0000000..d69783b
--- /dev/null
+++ b/coreutils-hybrid/PKGBUILD
@@ -0,0 +1,81 @@
+# Maintainer: kj_sh604 <406hs_jk@proton.me>
+
+pkgname=coreutils-hybrid
+_gnuver=9.7
+_uuver=0.1.0
+pkgver=${_uuver}
+pkgrel=1
+pkgdesc='(warning: use at own risk) Cross-platform Rust rewrite of the GNU coreutils being used as actual system coreutils'
+arch=('x86_64')
+license=('GPL3' 'MIT')
+url='https://github.com/uutils/coreutils'
+_url='https://www.gnu.org/software/coreutils/'
+depends=('glibc' 'acl' 'attr' 'gmp' 'libcap' 'openssl' 'gcc-libs' 'libkeccak' 'oniguruma')
+conflicts=('coreutils' 'b3sum' 'sha3sum')
+provides=('coreutils' 'b3sum' 'sha3sum')
+makedepends=('rust' 'cargo' 'python-sphinx')
+source=("https://ftp.gnu.org/gnu/coreutils/coreutils-$_gnuver.tar.xz"
+ "uutils-coreutils-$_uuver.tar.gz::$url/archive/$_uuver.tar.gz"
+ disable_selinux.patch)
+sha256sums=('e8bb26ad0293f9b5a1fc43fb42ba970e312c66ce92c1b0b16713d7500db251bf'
+ '55c528f2b53c1b30cb704550131a806e84721c87b3707b588a961a6c97f110d8'
+ '302614165d99f04600627222ddad0444a0144fcad6a1ff59ad43fb0b3162060e')
+
+prepare() {
+ cd coreutils-$_uuver
+ # the following is derived from the latest uutils-coreutils changes from Tobias Powalowski:
+ # disable selinux in Makefile, upstream seems broken in parameter parsing
+ # SELINUX_ENABLE=0 should not enable SELINUX but fails
+ patch -Np1 -i ../../disable_selinux.patch
+}
+
+build() {
+ # build gnu coreutils that are not implemented in the MULTICALL rust uutils
+ cd coreutils-$_gnuver
+ ./configure \
+ --prefix=/usr \
+ --libexecdir=/usr/lib \
+ --with-openssl \
+ --enable-no-install-program="[, arch, b2sum, b3sum, base32, base64, basename, basenc, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, expand, expr, factor, false, fmt, fold, groups, hashsum, head, hostid, hostname, id, install, join, kill, link, ln, logname, ls, md5sum, mkdir, mkfifo, mknod, mktemp, more, mv, nice, nl, nohup, nproc, numfmt, od, paste, pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, realpath, rm, rmdir, seq, sha1sum, sha224sum, sha256sum, sha3-224sum, sha3-256sum, sha3-384sum, sha3-512sum, sha384sum, sha3sum, sha512sum, shake128sum, shake256sum, shred, shuf, sleep, sort, split, stat, stdbuf, sum, sync, tac, tail, tee, test, timeout, touch, tr, true, truncate, tsort, tty, uname, unexpand, uniq, unlink, uptime, users, vdir, wc, who, whoami, yes"
+}
+
+package() {
+ export RUSTONIG_DYNAMIC_LIBONIG=1
+ cd coreutils-$_uuver
+ make \
+ DESTDIR="$pkgdir" \
+ PREFIX=/usr \
+ MANDIR=/share/man/man1 \
+ PROG_PREFIX= \
+ PROFILE=release \
+ MULTICALL=y \
+ install
+ # merge specified gnu coreutils with the rust uutils
+ cd $srcdir && cd coreutils-$_gnuver
+ make DESTDIR="$pkgdir" install
+ # add libstdbuf.so
+ mkdir -p $pkgdir/usr/lib/coreutils
+ cd $srcdir && cd coreutils-$_uuver/target/release/deps
+ mv liblibstdbuf.so $pkgdir/usr/lib/coreutils/libstdbuf.so
+ # clean conflicts, arch ships these in other apps
+ cd $pkgdir/usr/bin
+ rm groups hostname install kill more uptime
+ # symlink missing binaries
+ if [ -f "coreutils" ]; then
+ local binaries=(
+ "b2sum" "b3sum" "install" "md5sum" "sha1sum" "sha224sum"
+ "sha256sum" "sha3-224sum" "sha3-256sum" "sha3-384sum" "sha3-512sum"
+ "sha384sum" "sha3sum" "sha512sum" "shake128sum" "shake256sum"
+ )
+ for bin in "${binaries[@]}"; do
+ ln -s coreutils "$bin" || echo "warning: failed to create symlink for $bin"
+ done
+ else
+ echo "coreutils binary not found, skipping symlink creation."
+ fi
+ # additional cleanup
+ rm $pkgdir/usr/share/bash-completion/completions/*
+ rm $pkgdir/usr/share/man/man1/{groups.1,hostname.1,install.1,kill.1,more.1,uptime.1}
+}
+
+# vim: ts=2 sw=2 et:
diff --git a/coreutils-hybrid/disable_selinux.patch b/coreutils-hybrid/disable_selinux.patch
new file mode 100644
index 0000000..f6a5bff
--- /dev/null
+++ b/coreutils-hybrid/disable_selinux.patch
@@ -0,0 +1,13 @@
+diff --git a/GNUmakefile b/GNUmakefile
+index f46126a82..58bf7fbdd 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -181,8 +181,6 @@ SELINUX_PROGS := \
+
+ ifneq ($(OS),Windows_NT)
+ PROGS := $(PROGS) $(UNIX_PROGS)
+-# Build the selinux command even if not on the system
+- PROGS := $(PROGS) $(SELINUX_PROGS)
+ endif
+
+ UTILS ?= $(PROGS)