logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>
commit: 857ca16195cfd46700ebe6cb75a72a3818c54f99
parent 3ed5daa5aa28bc5a3d45e49e46cb604dc07f9c88
Author: fosslinux <fosslinux@aussies.space>
Date:   Sun, 15 May 2022 12:50:59 +1000

Merge pull request #160 from stikonas/sed

Move make immediately after tcc-0.9.26.

Diffstat:

Mparts.rst20+++++++++-----------
Msysa.py8++++----
Msysa/after.kaem12++++++------
Msysa/bash-2.05b/bash-2.05b.kaem2+-
Msysa/bzip2-1.0.8/bzip2-1.0.8.kaem2+-
Msysa/gzip-1.2.4/checksums2+-
Msysa/gzip-1.2.4/gzip-1.2.4.kaem28+++++-----------------------
Asysa/gzip-1.2.4/mk/main.mk23+++++++++++++++++++++++
Msysa/make-3.80/make-3.80.kaem4++--
Msysa/patch-2.5.9/patch-2.5.9.kaem4+---
Msysa/sed-4.0.9/checksums2+-
Msysa/sed-4.0.9/mk/main.mk21+++++++++++++++++----
Msysa/sed-4.0.9/sed-4.0.9.kaem37+++++++------------------------------
Msysa/sed-4.0.9/sed-4.0.9.sh1-
Asysa/tar-1.12/mk/main.mk36++++++++++++++++++++++++++++++++++++
Msysa/tar-1.12/tar-1.12.kaem52++++++++--------------------------------------------
16 files changed, 122 insertions(+), 132 deletions(-)

diff --git a/parts.rst b/parts.rst @@ -90,14 +90,19 @@ using older versions compilable by tinycc. Prior to this point, all tools have been adapted significantly for the bootstrap; now, we will be using old tooling instead. +make 3.80 +========= + +GNU ``make`` is now built so we have a more robust building system. +``make`` allows us to do things like define rules for files rather than +writing complex kaem scripts. + gzip 1.2.4 ========== ``gzip`` is the most common compression format used for software source -code. It is luckily distributed as a barebones uncompressed ``.tar``, -which we extract and then build. - -Going forward, we can now use ``.tar.gz`` for source code. +code. It is more capble than ``ungz`` from ``stage0-posix`` and also supports +compression. tar 1.12 ======== @@ -109,13 +114,6 @@ sed 4.0.9 You are most likely aware of GNU ``sed``, a line editor. -make 3.80 -========= - -GNU ``make`` is now built so we have a more robust building system. -``make`` allows us to do things like define rules for files rather than -writing complex kaem scripts. - patch 2.5.9 =========== diff --git a/sysa.py b/sysa.py @@ -92,13 +92,16 @@ class SysA(SysGeneral): def get_packages(self): """Prepare remaining sources""" - # mes-0.22 snapshot with m2 fixes + # mes-0.24 self.get_file(["https://mirrors.kernel.org/gnu/mes/mes-0.24.tar.gz", "https://download.savannah.gnu.org/releases/nyacc/nyacc-1.00.2.tar.gz"]) # tcc 0.9.26 patched by janneke self.get_file("https://lilypond.org/janneke/tcc/tcc-0.9.26-1136-g5bba73cc.tar.gz", output="tcc-0.9.26.tar.gz") + # make 3.80 + self.get_file("https://mirrors.kernel.org/gnu/make/make-3.80.tar.gz") + # gzip 1.2.4 self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar.gz") @@ -111,9 +114,6 @@ class SysA(SysGeneral): # patch 2.5.9 self.get_file("https://mirrors.kernel.org/gnu/patch/patch-2.5.9.tar.gz") - # make 3.80 - self.get_file("https://mirrors.kernel.org/gnu/make/make-3.80.tar.gz") - # bzip2 1.0.8 self.get_file("https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz") diff --git a/sysa/after.kaem b/sysa/after.kaem @@ -76,6 +76,12 @@ cd .. libdir=${libdir}/mes +# make +pkg="make-3.80" +cd ${pkg} +kaem --file ${pkg}.kaem +cd .. + # gzip pkg="gzip-1.2.4" cd ${pkg} @@ -94,12 +100,6 @@ cd ${pkg} kaem --file ${pkg}.kaem cd .. -# make -pkg="make-3.80" -cd ${pkg} -kaem --file ${pkg}.kaem -cd .. - # patch pkg="patch-2.5.9" cd ${pkg} diff --git a/sysa/bash-2.05b/bash-2.05b.kaem b/sysa/bash-2.05b/bash-2.05b.kaem @@ -13,7 +13,7 @@ cd build # Extract cp ${distfiles}/${pkg}.tar.gz ../src/ -gunzip -f ../src/${pkg}.tar.gz +gzip -d -f ../src/${pkg}.tar.gz tar xf ../src/${pkg}.tar rm -r ../src/ cd ${pkg} diff --git a/sysa/bzip2-1.0.8/bzip2-1.0.8.kaem b/sysa/bzip2-1.0.8/bzip2-1.0.8.kaem @@ -12,7 +12,7 @@ cd build # Extract cp ${distfiles}/${pkg}.tar.gz ../src/ -gunzip -f ../src/${pkg}.tar.gz +gzip -d -f ../src/${pkg}.tar.gz tar xf ../src/${pkg}.tar cd ${pkg} diff --git a/sysa/gzip-1.2.4/checksums b/sysa/gzip-1.2.4/checksums @@ -1 +1 @@ -3a0753ea8effb449d19d0fef091cabe27a937dc8545d1dd9fe28cd2991e846e8 /usr/bin/gzip +c310ba8e6df0b3e12934b5443079264656817a234b0417faa69a140447caf5a2 /usr/bin/gzip diff --git a/sysa/gzip-1.2.4/gzip-1.2.4.kaem b/sysa/gzip-1.2.4/gzip-1.2.4.kaem @@ -21,34 +21,16 @@ untar ../src/${pkg}.tar cd ${pkg} # Prepare +cp ../../mk/main.mk Makefile catm gzip.c.new ../../files/stat_override.c gzip.c cp gzip.c.new gzip.c -# Compile -tcc -c -DNO_UTIME gzip.c -tcc -c bits.c -tcc -c crypt.c -tcc -c deflate.c -tcc -c getopt.c -tcc -c inflate.c -tcc -c lzw.c -tcc -c trees.c -tcc -c unlzh.c -tcc -c unlzw.c -tcc -c unpack.c -tcc -c unzip.c -# strlwr is already defined in mes libc -tcc -c -Dstrlwr=unused util.c -tcc -c zip.c - -# Link -tcc -static -o ${bindir}/gzip gzip.o zip.o deflate.o trees.o bits.o unzip.o inflate.o util.o crypt.o lzw.o unlzw.o unpack.o unlzh.o getopt.o +# Build +make # Install -cp ${bindir}/gzip ${bindir}/gunzip -cp ${bindir}/gzip ${bindir}/zcat -chmod 755 ${bindir}/gunzip -chmod 755 ${bindir}/zcat +cp gzip ${bindir}/gzip +chmod 755 ${bindir}/gzip cd ../.. diff --git a/sysa/gzip-1.2.4/mk/main.mk b/sysa/gzip-1.2.4/mk/main.mk @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +CC = tcc +AR = tcc -ar + +# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic +# This is to avoid running configure test to determine sizeof(long long) +CPPFLAGS = -DNO_UTIME \ + -Dstrlwr=unused + +CFLAGS = -I . -static + +.PHONY: all + +GZIP_SRC = gzip bits crypt deflate getopt inflate lzw trees unlzh unlzw unpack unzip util zip +GZIP_OBJ = $(addsuffix .o, $(GZIP_SRC)) + +all: gzip + +gzip: $(GZIP_OBJ) + $(CC) $^ -o $@ diff --git a/sysa/make-3.80/make-3.80.kaem b/sysa/make-3.80/make-3.80.kaem @@ -11,8 +11,8 @@ cd build # Extract cp ${distfiles}/${pkg}.tar.gz ../src/ -gunzip -f ../src/${pkg}.tar.gz -tar xf ../src/${pkg}.tar +ungz ../src/${pkg}.tar.gz +untar ../src/${pkg}.tar cd ${pkg} # Create .h files diff --git a/sysa/patch-2.5.9/patch-2.5.9.kaem b/sysa/patch-2.5.9/patch-2.5.9.kaem @@ -11,7 +11,7 @@ cd build # Extract cp ${distfiles}/${pkg}.tar.gz ../src/ -gunzip -f ../src/${pkg}.tar.gz +gzip -d -f ../src/${pkg}.tar.gz tar xf ../src/${pkg}.tar cd ${pkg} cp ../../mk/main.mk Makefile @@ -24,8 +24,6 @@ catm patchlevel.h cp pch.c pch_patched.c sed -i 841,848d pch_patched.c -# Compile - # Build make -f Makefile PREFIX=${prefix} diff --git a/sysa/sed-4.0.9/checksums b/sysa/sed-4.0.9/checksums @@ -1 +1 @@ -19140fdea18e2d8f3ed1597f7d0d72baa7b2c3b69bf87edc35271df2da24bbfb /usr/bin/sed +092b2972a16ffe6919f52678c675ac29708f507ee800172ac139fb9c44ccb153 /usr/bin/sed diff --git a/sysa/sed-4.0.9/mk/main.mk b/sysa/sed-4.0.9/mk/main.mk @@ -12,11 +12,19 @@ CPPFLAGS = -DENABLE_NLS=0 \ -DSED_FEATURE_VERSION=\"4.0\" \ -DVERSION=\"4.0.9\" \ -DPACKAGE=\"sed\" -CFLAGS = -I . -I lib +CFLAGS = -I . -I lib -static +LDFLAGS = -L. -lsed .PHONY: all -LIB_SRC = alloca getopt1 getopt utils regex obstack strverscmp mkstemp +ifeq ($(LIBC),mes) + LIB_SRC = getline +else + LIB_SRC = alloca +endif + +LIB_SRC += getopt1 getopt utils regex obstack strverscmp mkstemp + LIB_OBJ = $(addprefix lib/, $(addsuffix .o, $(LIB_SRC))) SED_SRC = compile execute regexp fmt sed @@ -24,11 +32,16 @@ SED_OBJ = $(addprefix sed/, $(addsuffix .o, $(SED_SRC))) all: sed/sed +lib/regex.h: lib/regex_.h + cp $< $@ + +lib/regex.o: lib/regex.h + libsed.a: $(LIB_OBJ) $(AR) cr $@ $^ -sed/sed: $(SED_OBJ) libsed.a - $(CC) -o $@ $^ +sed/sed: libsed.a $(SED_OBJ) + $(CC) $^ $(LDFLAGS) -o $@ install: install -D sed/sed $(DESTDIR)$(PREFIX)/bin/sed diff --git a/sysa/sed-4.0.9/sed-4.0.9.kaem b/sysa/sed-4.0.9/sed-4.0.9.kaem @@ -13,43 +13,20 @@ cd build # Extract cp ${distfiles}/${pkg}.tar.gz ../src/ -gunzip -f ../src/${pkg}.tar.gz +gzip -d -f ../src/${pkg}.tar.gz tar xf ../src/${pkg}.tar cd ${pkg} +cp ../../mk/main.mk Makefile # Create config.h catm config.h -# Compile +# Build +make -f Makefile LIBC=mes -## libsed.a -cd lib - -tcc -c getopt1.c -tcc -c -I .. getopt.c -tcc -c -I .. -DENABLE_NLS=0 utils.c -cp regex_.h regex.h -tcc -c -DHAVE_ALLOCA_H -I . regex.c -tcc -c obstack.c -tcc -c strverscmp.c -tcc -c getline.c -tcc -c -DHAVE_FCNTL_H mkstemp.c - -tcc -ar cr libsed.a getopt1.o getopt.o utils.o regex.o obstack.o strverscmp.o getline.o mkstemp.o -cd .. - -## sed -tcc -c -I . -I lib -DSED_FEATURE_VERSION=\"4.0\" sed/compile.c -tcc -c -I . -I lib sed/execute.c -tcc -c -I . -I lib sed/regexp.c -tcc -c -I . -I lib sed/fmt.c -tcc -c -I . -I lib -DPACKAGE=\"sed\" -DVERSION=\"4.0.9\" sed/sed.c - -# Link -tcc -static -o ${bindir}/sed -L lib lib/libsed.a compile.o execute.o regexp.o fmt.o sed.o -lsed - -# Test -sed --version +# Install +cp sed/sed ${prefix}/bin/sed +chmod 755 ${prefix}/bin/sed cd ../.. diff --git a/sysa/sed-4.0.9/sed-4.0.9.sh b/sysa/sed-4.0.9/sed-4.0.9.sh @@ -5,7 +5,6 @@ src_prepare() { default - cp lib/regex_.h lib/regex.h touch config.h } diff --git a/sysa/tar-1.12/mk/main.mk b/sysa/tar-1.12/mk/main.mk @@ -0,0 +1,36 @@ +# SPDX-FileCopyrightText: 2022 Andrius Štikonas <andrius@stikonas.eu> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +CC = tcc +AR = tcc -ar + +# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic +# This is to avoid running configure test to determine sizeof(long long) +CPPFLAGS = -DHAVE_FCNTL_H \ + -DHAVE_DIRENT_H \ + -DHAVE_GETCWD_H \ + -DHAVE_GETCWD \ + -DSIZEOF_UNSIGNED_LONG=4 \ + -DVERSION=\"1.12\" \ + -DPACKAGE=\"tar\" + +CFLAGS = -I . -I lib -static +LDFLAGS = -L. -ltar + +.PHONY: all + +LIB_SRC = argmatch backupfile error fnmatch ftruncate getdate_stub getopt getopt1 getversion modechange msleep xgetcwd xmalloc xstrdup + +LIB_OBJ = $(addprefix lib/, $(addsuffix .o, $(LIB_SRC))) + +TAR_SRC = arith buffer compare create delete extract incremen list mangle misc names open3 rtapelib tar update +TAR_OBJ = $(addprefix src/, $(addsuffix .o, $(TAR_SRC))) + +all: tar + +libtar.a: $(LIB_OBJ) + $(AR) cr $@ $^ + +tar: libtar.a $(TAR_OBJ) + $(CC) $^ $(LDFLAGS) -o $@ diff --git a/sysa/tar-1.12/tar-1.12.kaem b/sysa/tar-1.12/tar-1.12.kaem @@ -13,59 +13,23 @@ cd build # Extract cp ${distfiles}/${pkg}.tar.gz ../src/ -gunzip -f ../src/${pkg}.tar.gz +gzip -d -f ../src/${pkg}.tar.gz untar ../src/${pkg}.tar cd ${pkg} +# Prepare +cp ../../mk/main.mk Makefile cp ../../files/getdate_stub.c lib/getdate_stub.c catm src/create.c.new ../../files/stat_override.c src/create.c cp src/create.c.new src/create.c -# Compile +# Build +make -f Makefile -## libtar.a -cd lib - -tcc -c argmatch.c -tcc -c -DHAVE_DIRENT_H backupfile.c -tcc -c -I . error.c -tcc -c -I . fnmatch.c -tcc -c ftruncate.c -tcc -c getdate_stub.c -tcc -c getopt.c -tcc -c getopt1.c -tcc -c getversion.c -tcc -c modechange.c -tcc -c msleep.c -tcc -c -DHAVE_GETCWD xgetcwd.c -tcc -c xmalloc.c -tcc -c xstrdup.c - -tcc -ar cr libtar.a argmatch.o backupfile.o error.o fnmatch.o ftruncate.o getdate_stub.o getopt.o getopt1.o getversion.o modechange.o msleep.o xgetcwd.o xmalloc.o xstrdup.o -cd .. - -## tar -# -DSIZEOF_UNSIGNED_LONG=4 forces use of simulated arithmetic -# This is to avoid running configure test to determine sizeof(long long) -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/arith.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/buffer.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/compare.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_DIRENT_H src/create.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/delete.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/extract.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_GETCWD -DHAVE_DIRENT_H src/incremen.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/list.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/mangle.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_DIRENT_H src/misc.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DHAVE_GETCWD src/names.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/open3.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/rtapelib.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H -DPACKAGE=\"tar\" -DVERSION=\"1.12\" src/tar.c -tcc -c -I lib -DSIZEOF_UNSIGNED_LONG=4 -DHAVE_FCNTL_H src/update.c - -# Link -tcc -static -o ${bindir}/tar -L lib lib/libtar.a arith.o buffer.o compare.o create.o delete.o extract.o incremen.o list.o mangle.o misc.o names.o open3.o rtapelib.o tar.o update.o -ltar +# Install +cp tar ${prefix}/bin/tar +chmod 755 ${prefix}/bin/tar cd ../..