From 185757e2a7dcce05f14d65efab4da41e7e8b3199 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 23 Oct 2022 17:15:38 +0200 Subject: [PATCH] 600th commit! 1. Update the bc patch to remove an unnecessary line. 2. Update README.md to mention the port system. 3. Improve the port system!! --- README.md | 19 +++++++++++++++++++ ports/add-port.sh | 24 +++++++++++++++++++++--- ports/bc/bc.patch | 9 --------- ports/make-package.sh | 13 +++++++------ 4 files changed, 47 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 7c0c8b04..196d27ca 100644 --- a/README.md +++ b/README.md @@ -70,5 +70,24 @@ Prebuilt ISO images for every version can be found at [pub.cloudapio.eu](https:/ These images are built manually whenever I decide to make a new version, and thus don't reflect the latest changes on the `main` branch. +## Is there third-party software I can use on Luna? + +Yes, actually! Check out the [ports](ports/) directory. +Right now, only [bc](https://github.com/gavinhoward/bc) is ported, because right now our C Library is quite primitive and doesn't support projects more complex than that. + +And bc itself doesn't run very well... most notably, user input doesn't echo. But that's on our side. At least it runs! + +You should also keep in mind that it is not possible to compile software written in any language other than C for Luna right now. + +But feel free to try to port some program yourself and add it to the ports directory! + +Port usage: + +`ports/add-port.sh ` will build and add a port to the list of installed ports, and the built port will automatically get installed into the system root every time you run Luna. + +`ports/remove-port.sh ` will remove the port from the list of installed ports, remove built files from the system root, as well as the build directory. + +`ports/make-package.sh ` will compile the port and make a package archive from it, which may be used in the future with a package manager :) + ## License Luna is open-source and free software under the [BSD-2 License](LICENSE). \ No newline at end of file diff --git a/ports/add-port.sh b/ports/add-port.sh index 2ac3ed62..2f36899b 100755 --- a/ports/add-port.sh +++ b/ports/add-port.sh @@ -8,6 +8,21 @@ source tools/env.sh cd ports +unset pkgname +unset pkgver +unset pkgurl +unset pkgmode +unset setupdir +unset builddir +unset installdir +unset srcdir +unset port_unpack +unset port_patch +unset port_configure +unset port_build +unset port_install +unset port_uninstall + export DESTDIR=${DESTDIR:-"$LUNA_ROOT/initrd"} export listdir=$PWD @@ -90,7 +105,10 @@ cd $installdir echo "Installing $pkgname version $pkgver..." port_install -echo "$pkgname" >> $listdir/ports.list -cat $listdir/ports.list | sort | uniq | tee $listdir/ports.list >/dev/null # avoid duplicates +if ! [ "$SKIP_ADD_TO_PORTS_LIST" = "1" ] +then + echo "$pkgname" >> $listdir/ports.list + cat $listdir/ports.list | sort | uniq | tee $listdir/ports.list >/dev/null # avoid duplicates -echo "Success! Registered port: $pkgname version $pkgver." + echo "Success! Registered port: $pkgname version $pkgver." +fi \ No newline at end of file diff --git a/ports/bc/bc.patch b/ports/bc/bc.patch index b5a3bcd5..a4a4ffdc 100644 --- a/ports/bc/bc.patch +++ b/ports/bc/bc.patch @@ -32,15 +32,6 @@ diff --color -rN -u bc-vanilla/include/library.h bc-6.0.4/include/library.h diff --color -rN -u bc-vanilla/src/vm.c bc-6.0.4/src/vm.c --- a/bc-6.0.4/src/vm.c 2022-09-26 19:34:35.000000000 +0200 +++ b/bc-6.0.4/src/vm.c 2022-10-21 17:29:13.511229371 +0200 -@@ -49,7 +49,7 @@ - #include - #include - --#else // _WIN32 -+#else - - #define WIN32_LEAN_AND_MEAN - #include @@ -193,7 +193,7 @@ static void bc_vm_sigaction(void) diff --git a/ports/make-package.sh b/ports/make-package.sh index 2f9d9772..41424b89 100755 --- a/ports/make-package.sh +++ b/ports/make-package.sh @@ -4,20 +4,21 @@ set -e source $(dirname $0)/../tools/env.sh +export DESTDIR=$PWD/pkgroot +export SKIP_ADD_TO_PORTS_LIST=1 + source $LUNA_ROOT/ports/$1/package.sh -mkdir $PWD/pkgroot +mkdir pkgroot -DESTDIR=$PWD/pkgroot $LUNA_ROOT/ports/add-port.sh $pkgname +$LUNA_ROOT/ports/add-port.sh $pkgname cd pkgroot tar cJf ../$pkgname-$pkgver.pkg.tar.xz * -cd .. +cd - -DESTDIR=$PWD/pkgroot $LUNA_ROOT/ports/remove-port.sh $pkgname - -rm -rf $PWD/pkgroot +rm -rf pkgroot echo "Built package $pkgname-$pkgver.pkg.tar.xz" \ No newline at end of file