From c8f61de191ffd722ffcafd537c3dc5e1f074c7ad Mon Sep 17 00:00:00 2001 From: Brian Callahan Date: Fri, 24 Jan 2020 19:43:14 -0500 Subject: [PATCH] Ports: Add bc port --- Ports/bc/package.sh | 11 +++++++++++ Ports/bc/patches/fix-args.patch | 11 +++++++++++ Ports/bc/patches/fix-num.patch | 13 +++++++++++++ 3 files changed, 35 insertions(+) create mode 100755 Ports/bc/package.sh create mode 100644 Ports/bc/patches/fix-args.patch create mode 100644 Ports/bc/patches/fix-num.patch diff --git a/Ports/bc/package.sh b/Ports/bc/package.sh new file mode 100755 index 0000000000..9e6f07962f --- /dev/null +++ b/Ports/bc/package.sh @@ -0,0 +1,11 @@ +#!/bin/bash ../.port_include.sh +port=bc +version=2.5.1 +curlopts="-L" +files="https://github.com/gavinhoward/bc/releases/download/2.5.1/bc-2.5.1.tar.xz bc-2.5.1.tar.xz" +useconfigure=true +configscript=configure.sh + +configure() { + run env HOSTCC=gcc ./"$configscript" +} diff --git a/Ports/bc/patches/fix-args.patch b/Ports/bc/patches/fix-args.patch new file mode 100644 index 0000000000..f951d462ff --- /dev/null +++ b/Ports/bc/patches/fix-args.patch @@ -0,0 +1,11 @@ +--- bc-2.5.1/include/args.h.orig Fri Jan 24 19:27:06 2020 ++++ bc-2.5.1/include/args.h Fri Jan 24 19:27:14 2020 +@@ -36,6 +36,8 @@ + #ifndef BC_ARGS_H + #define BC_ARGS_H + ++#include ++ + #include + #include + diff --git a/Ports/bc/patches/fix-num.patch b/Ports/bc/patches/fix-num.patch new file mode 100644 index 0000000000..2543de4862 --- /dev/null +++ b/Ports/bc/patches/fix-num.patch @@ -0,0 +1,13 @@ +--- bc-2.5.1/include/num.h.orig Fri Jan 24 19:24:12 2020 ++++ bc-2.5.1/include/num.h Fri Jan 24 19:24:54 2020 +@@ -134,6 +134,10 @@ + + #define BC_NUM_KARATSUBA_ALLOCS (6) + ++#ifndef SSIZE_MAX ++#define SSIZE_MAX LONG_MAX ++#endif ++ + #define BC_NUM_CMP_SIGNAL_VAL (~((ssize_t) ((size_t) SSIZE_MAX))) + #define BC_NUM_CMP_SIGNAL(cmp) (cmp == BC_NUM_CMP_SIGNAL_VAL) +