diff --git a/ports/README.md b/ports/README.md index 65cad69f..9710e12f 100644 --- a/ports/README.md +++ b/ports/README.md @@ -11,6 +11,7 @@ Try to keep this list in alphabetical order. Name | Version | Description | URL ---|---|--- | --- +bc | 6.6.0 | An implementation of the POSIX bc calculator | https://github.com/gavinhoward/bc minitar | 1.7.5 | Tiny and easy-to-use C library to read/write tar archives | https://git.cloudapio.eu/apio/minitar nasm | 2.16.01 | An assembler for the x86 CPU architecture | https://nasm.us diff --git a/ports/bc/PACKAGE b/ports/bc/PACKAGE new file mode 100644 index 00000000..7996ce20 --- /dev/null +++ b/ports/bc/PACKAGE @@ -0,0 +1,23 @@ +# Basic information +name="bc" +version="6.6.0" + +# Download options +format="git" +url="https://github.com/gavinhoward/bc" +tag="$version" + +# Build instructions + +do_patch() +{ + patch -u -i $portdir/bc.patch -p 1 -d $srcdir +} + +do_configure() +{ + HOSTCC=gcc PREFIX="/usr" $srcdir/configure --disable-nls --bc-only --disable-history --disable-man-pages +} + +default_build_make=true +default_install_make=true diff --git a/ports/bc/bc.patch b/ports/bc/bc.patch new file mode 100644 index 00000000..f991b48c --- /dev/null +++ b/ports/bc/bc.patch @@ -0,0 +1,29 @@ +diff --git a/include/library.h b/include/library.h +index 1edd3757..377dd8ae 100644 +--- a/include/library.h ++++ b/include/library.h +@@ -36,7 +36,7 @@ + #ifndef LIBBC_PRIVATE_H + #define LIBBC_PRIVATE_H + +-#ifndef _WIN32 ++#if !defined(_WIN32) && !defined(__luna__) + + #include + +@@ -386,10 +386,14 @@ typedef struct BclCtxt + BcVm* + bcl_getspecific(void); + +-#ifndef _WIN32 ++#if !defined(_WIN32) && !defined(__luna__) + + typedef pthread_key_t BclTls; + ++#elif __luna__ ++ ++typedef int BclTls; ++ + #else // _WIN32 + + typedef DWORD BclTls; diff --git a/tools/install-package.sh b/tools/install-package.sh index c1af841c..556213e2 100755 --- a/tools/install-package.sh +++ b/tools/install-package.sh @@ -38,11 +38,11 @@ mkdir -p $LUNA_BASE/usr/share/pkgdb/ cd $LUNA_BASE -find -type f > /tmp/before.list +find -type f | sed 's|^./||' > /tmp/before.list tar -C $LUNA_BASE -xf $LUNA_ROOT/ports/local/$name-$version.tar.gz -find -type f > /tmp/after.list +find -type f | sed 's|^./||' > /tmp/after.list awk 'FNR==NR {a[$0]++; next} !($0 in a)' /tmp/before.list /tmp/after.list > $LUNA_BASE/usr/share/pkgdb/$name.files diff --git a/tools/make-package.sh b/tools/make-package.sh index 4d78afba..9b69bb75 100755 --- a/tools/make-package.sh +++ b/tools/make-package.sh @@ -61,6 +61,11 @@ case $format in ;; esac +export CC=x86_64-luna-gcc +export CXX=x86_64-luna-g++ +export CC_FOR_BUILD=gcc +export CXX_FOR_BUILD=g++ + mkdir -p $builddir cd $builddir