commit: 6106ac6e60bd2dfe36550ab5ba301d156d0db6c6
parent d8a5ad6508b495f2f6c3a61151ea88f061bc8434
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 25 Dec 2024 08:40:09 +0100
only pick what we need from heirloom
Diffstat:
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/init.sh b/init.sh
@@ -98,7 +98,7 @@ build_hierloom_devtools() {
}
build_hierloom() {
- cd /src/heirloom-0*/
+ cd /src/heirloom/
mkdir -p /usr/5bin /usr/5lib /etc/default /usr/5bin/s42 /usr/5bin/posix2001 /usr/ucb/
for cmd in libcommon diff tar sort comm find stty
do
diff --git a/make-root.sh b/make-root.sh
@@ -207,6 +207,16 @@ sed -i \
heirloom-devtools-*/lex/Makefile.mk heirloom-devtools-*/m4/Makefile.mk \
|| die "Failed patching .c.o: inferred targets in heirloom-devtools"
+# Only pick what we need from heirloom
+mkdir -p heirloom
+cd heirloom-0*/
+mv \
+ makefile Makefile.mk build \
+ libcommon diff tar sort comm find stty \
+ ../heirloom/ || die "Failed copying heirloom files"
+cd -
+rm -r heirloom-0*/ || die "Failed removing old heirloom unpacked directory"
+
# - maninst Fails to create parent dir, just noop it, we don't have man anyway
# -e 's;MANINST =.*;MANINST = $(SHELL) ../build/maninst.sh;' \
# - Turns out tcc comes with an ar(1)
@@ -218,38 +228,29 @@ sed -i \
-e 's;SPELLHIST =.*;SPELLHIST = /dev/null;' \
-e 's;UCBINST =.*;UCBINST = install;' \
-e 's;MANINST =.*;MANINST = true;' \
- heirloom-0*/build/mk.config \
+ heirloom/build/mk.config \
|| die "Failed configuring heirloom (toolchest)"
sed -i \
-e 's;__GLIBC__;__linux__;' \
-e '/#define getdents/s;^;//;' \
- heirloom-070715/libcommon/getdir.c || die "Failed fixing heirloom libcommon for musl"
+ heirloom/libcommon/getdir.c || die "Failed fixing heirloom libcommon for musl"
sed -i \
-e 's;#ifdef _AIX;#if defined(_AIX) || defined(__linux__);' \
-e '/static int utf8/avoid writerr(struct oblok *op, int count, int written) {}' \
- heirloom-070715/tar/tar.c || die "Failed fixing heirloom tar for musl"
+ heirloom/tar/tar.c || die "Failed fixing heirloom tar for musl"
sed -i \
-e 's;#ifdef _AIX;#if defined(_AIX) || defined(__linux__);' \
- heirloom-070715/find/find.c || die "Failed fixing heirloom find for musl"
-
-sed -i -e 's;libwchar.a: fake;libwchar.a:;' heirloom-070715/libwchar/Makefile.mk || die
-
-sed -i -e 's;getdir.o regexpr.o gmatch.o;getdir.o gmatch.o;' heirloom-*/libcommon/Makefile.mk || die
+ heirloom/find/find.c || die "Failed fixing heirloom find for musl"
-rm -r heirloom-*/libuxre heirloom-*/libcommon/regexp.h || die
+sed -i -e 's;getdir.o regexpr.o gmatch.o;getdir.o gmatch.o;' heirloom/libcommon/Makefile.mk || die
rm -r pigz-*/zopfli || die
rm -r heirloom-devtools-*/make heirloom-devtools-*/sccs || die
-for i in cpio spell mail nawk oawk
-do
- rm -r heirloom-0*/$i || die
-done
-
rm -r awk-*/testdir || die
cd "${out_base}/"