summaryrefslogtreecommitdiff
path: root/ports/pre
diff options
context:
space:
mode:
authordzwdz2023-06-25 16:38:32 +0200
committerdzwdz2023-06-25 16:38:32 +0200
commitd4542c336a6cbfb43497055f19a85e7713f2eed7 (patch)
tree9f4a68974c3392b0ea546ecc94324911e86f0528 /ports/pre
parentfffd37f1680664bf055d8f5603ed1967718a6492 (diff)
ports: reimplement the ports system from scratch
side stuff: * removed sltar since it wasn't working anyways * made signal() no longer panic, as that broke certain ports (oops) * doom now ships with the FreeDOOM WADs * /usr/ was aliased to /init/usr/, more directories were added to /bin/ to improve compat with ports
Diffstat (limited to 'ports/pre')
-rw-r--r--ports/pre69
1 files changed, 69 insertions, 0 deletions
diff --git a/ports/pre b/ports/pre
new file mode 100644
index 0000000..0c00ef3
--- /dev/null
+++ b/ports/pre
@@ -0,0 +1,69 @@
+#!/bin/sh
+set -eu
+repodir=$(pwd)
+PATH="$repodir/toolchain/prefix/bin/:$PATH"
+CC=x86_64-camellia-gcc
+DESTDIR="$repodir/out/initrd/"
+MAKEFLAGS="CC=$CC DESTDIR=$DESTDIR"
+extra_files=
+
+ensure_pre_was_loaded() { true; }
+
+fetch() {
+ test -e $downdir/$tarball || curl -L $url > $downdir/$tarball
+ for file in $extra_files; do
+ echo ${file##*/}
+ test -e $downdir/${file##*/} || curl -L $file > $downdir/${file##*/}
+ done
+ checksum
+}
+
+checksum() {
+ (cd $downdir; sha256sum --check $portdir/sha256sums)
+}
+
+post_unpack() { true; }
+unpack() {
+ test -d $tarball_dir && return
+ fetch
+ tar xf $downdir/$tarball
+ patch
+ post_unpack
+}
+
+post_patch() { true; }
+patch() {
+ if test -d $portdir/files/; then
+ cp $portdir/files/* $tarball_dir/
+ fi
+ if test -d $portdir/patches/; then
+ for patch in $portdir/patches/*; do
+ echo $patch
+ command patch -d $tarball_dir/ <$patch
+ done
+ fi
+ post_patch
+}
+
+configure() {
+ true
+}
+
+_make() {
+ configure
+ (cd $tarball_dir && make $MAKEFLAGS $*)
+}
+
+build() {
+ unpack
+ _make
+}
+
+clean() {
+ _make clean
+}
+
+install() {
+ build
+ _make install
+}