This commit is contained in:
ThatGeekyWeeb 2021-08-27 07:06:43 -04:00
commit 243e700bd6
7 changed files with 161 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
./chroot/*

32
README Normal file
View File

@ -0,0 +1,32 @@
###
- nG: A base for xbps 100% GNU free
- nG is not an actual distro but rather a write up
- on the requirements for setting an xbps system
- 100% without GNU
- nG only provides the basics for avoiding GNU
- while creating a base xbps chroot
---
- See `./deplist` for a list of dependencies + there replacements
---
- Setup:
- 1: start by creating a new folder "somewhere" (the folder is called <ROOT>)
- 2: steal a copy of the go compiler from alpine (see `./deplist`) and add it to your PATH
- 3: make sure a posix shell is present on the host system
- 4: compile/obtain a copy of bmake
- 5: obtain a copy of the kati source code
- 6: enter the folder of said source code and apply `./make.patch` using patch
- 7: compile kati via `bmake kati` (requires go and ninja (see `./deplist`))
- This will produce a `ckati` binary, it can be used as a replacement for (GNU)make
- With the following flags
- `ckati --ninja --ninja_dir=build --regen --use_find_emulator --color_warnings`
- This requires a `./build` folder; and produces a `<>/build/ninja.sh` script
- Run said `<>/build/ninja.sh` script to compile (GNU)make projects
- 8: compile/obtain a copy of busybox (requires (GNU)make; use ckati; see above)
- Set it's prefix to <ROOT> when compiling; otherwise install to <ROOT>/(usr/)
- 9: compile/obtain a copy of musl (requires (GNU)make; use ckati; see 7)
- Set it's prefix to <ROOT> when compiling; otherwise install to <ROOT>/
-- The above creates a stage 0 system
-- Below is for compiling xbps; static xbps can be used
- 10: compile/obtain a C99 compiler (tcc, pcc, clang)
-
###

25
base.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/sh
# create a base system at ./chroot
# EVERYTHING (minus go) is fresh compiled
has() {
case "$(command -v $1 2>/dev/null)" in
alias*|"") return 1
esac
}
has go || { echo "The golang compiler is required on the host system..."; exit 1;}
# needed for kati
has curl || { echo "curl is required on the host systtem"; exit 1;}
# for downloading sources
has bsdtar || { echo "bsdtar is required on the host system"; exit 1;}
# for extracting sources
rm chroot/builddir -rf 2>/dev/null
mkdir -p chroot/builddir; bdir="$(realpath chroot/builddir)"
IFS=""; while read -r p; do # no need for EOF check
case "$p" in
"#"*) ;; # ignore lines with comments
*) org=${PWD}; url="${p##*- }"
echo "Downloading/Extracting ${p%% -*} ..."
cd ${bdir}; curl -L "$url" --progress-bar | bsdtar -xf -;;
esac
done < ./sources # read from sources and download
cd ${org}

39
deplist Normal file
View File

@ -0,0 +1,39 @@
# KISS (or void/alpine) - is used for dep references
# - X means none
# C compiler, linux-headers and a host libc are implied
--- Stage 0 system
- musl (libc)
- make -> GNU
- Replace with - kati
- busybox - make (X)
- make -> GNU
- Replace with - kati
--- Kati
- kati - golang, ninja
- golang - STEAL FROM ALPINE
- https://dl-cdn.alpinelinux.org/alpine/edge/community/<ARCH>/go-<ver>.apk
- 1.16.7-r0 ATM
- ninja - python, asciidoc
- Replace with - samurai
- samurai - X
- bmake - X
--- XBPS
- C99 compiler
- tcc - make
- make -> GNU
- Replace with - kati
- pkgconf - X
- zlib - X
- openssl - make, perl
- make -> GNU
- Replace with - kati
- perl - zlib, bzip
- zlib - X
- bzip2 - X
- libarchive - liblz4, libzstd, zlib, bzip2, liblzma
- liblz4 - ?
- zlib - X
- bzip2 - X
- liblzma - ?
- libzstd - zlib, liblzma, liblz4
---

15
loc Normal file
View File

@ -0,0 +1,15 @@
# folder names of extracted sources
# this is for ease of use
musl - musl-1.1.24/
busybox - busybox-1.32.1/
kati - kati-master/
samurai - samurai-1.2/
tcc - tinycc-a4997bf/
pkgconf - pkgconf-1.7.4/
openssl - openssl-1.1.1k/
perl - perl-5.34.0/
bzip2 - bzip2-1.0.8/
libarchive - libarchive-3.5.1/
liblz4 - lz4-1.9.3/
liblzma - xz-5.2.5/
libzstd - zstd-1.5.0/

26
make.patch Normal file
View File

@ -0,0 +1,26 @@
diff --git a/Makefile b/Makefile
index e1b9d46..15d8c1e 100644
--- a/Makefile
+++ b/Makefile
@@ -17,21 +17,6 @@ all: ckati ckati_tests
include Makefile.kati
include Makefile.ckati
-info: ckati
- @echo GNU MAKE VERSION
- make --version
- make -f Makefile version --no-print-directory
- @echo
- @echo CKATI VERSION
- ./ckati -f Makefile version
- @echo
- @echo SHELL VERSION
- @echo $(SHELL)
- $(SHELL) --version | head -n 1
-
-version:
- @echo $(MAKE_VERSION)
-
test: all ckati_tests
go test --ckati --ninja

23
sources Normal file
View File

@ -0,0 +1,23 @@
musl - http://www.musl-libc.org/releases/musl-1.1.24.tar.gz
# note: stable is newer; but contains a security bug... void uses above
busybox - https://www.busybox.net/downloads/busybox-1.32.1.tar.bz2
# note: busybox.net is extremely slow
kati - https://github.com/google/kati/archive/refs/heads/master.tar.gz
# note: no releases or tags currently exist
# bmake - http://www.crufty.net/ftp/pub/sjg/bmake-20210621.tar.gz
# note: bmake is not "ACTUALLY" required; kati can be compiled via go easily
# command: go build -o kati github.com/google/kati/golang/cmd/kati
samurai - https://github.com/michaelforney/samurai/archive/1.2.tar.gz
# note: needs to be linked to ninja
# -- FOLLOWING IS FOR XBPS
tcc - http://repo.or.cz/tinycc.git/snapshot/a4997bf3d952f904bce824ee3e8f3e12e8524071.tar.gz
pkgconf - https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.4.tar.xz
zlib - http://www.zlib.net/zlib-1.2.11.tar.gz
openssl - https://www.openssl.org/source/openssl-1.1.1k.tar.gz
perl - https://www.cpan.org/src/5.0/perl-5.34.0.tar.gz
bzip2 - https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
libarchive - https://github.com/libarchive/libarchive/releases/download/3.5.1/libarchive-3.5.1.tar.gz
liblz4 - https://github.com/lz4/lz4/archive/v1.9.3.tar.gz
liblzma - https://tukaani.org/xz/xz-5.2.5.tar.bz2
libzstd - https://github.com/facebook/zstd/releases/download/v1.5.0/zstd-1.5.0.tar.gz
# CHECKSUMS ARE NOT CHECKED; NOT MY ISSUE