ports+tools: Add bc port
All checks were successful
continuous-integration/drone/push Build is passing

It segfaults when writing "about", but oh well...
This commit is contained in:
apio 2023-07-24 19:14:22 +02:00
parent b12f42cfe2
commit 2e2b87b714
Signed by: apio
GPG Key ID: B8A7D06E42258954
5 changed files with 60 additions and 2 deletions

View File

@ -11,6 +11,7 @@ Try to keep this list in alphabetical order.
Name | Version | Description | URL 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 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 nasm | 2.16.01 | An assembler for the x86 CPU architecture | https://nasm.us

23
ports/bc/PACKAGE Normal file
View File

@ -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

29
ports/bc/bc.patch Normal file
View File

@ -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 <pthread.h>
@@ -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;

View File

@ -38,11 +38,11 @@ mkdir -p $LUNA_BASE/usr/share/pkgdb/
cd $LUNA_BASE 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 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 awk 'FNR==NR {a[$0]++; next} !($0 in a)' /tmp/before.list /tmp/after.list > $LUNA_BASE/usr/share/pkgdb/$name.files

View File

@ -61,6 +61,11 @@ case $format in
;; ;;
esac 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 mkdir -p $builddir
cd $builddir cd $builddir