From d4542c336a6cbfb43497055f19a85e7713f2eed7 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 25 Jun 2023 16:38:32 +0200 Subject: 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 --- ports/pre | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 ports/pre (limited to 'ports/pre') 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 +} -- cgit v1.2.3