gnucap: add package

This commit is contained in:
Henrik Grimler 2019-01-24 23:27:58 +01:00
parent 270336c86f
commit 764b9a9c0f
5 changed files with 281 additions and 0 deletions

183
packages/gnucap/CXX.patch Normal file
View File

@ -0,0 +1,183 @@
diff -u -r ../gnucap-20171003/apps/configure ./apps/configure
--- ../gnucap-20171003/apps/configure 2017-10-04 00:50:49.000000000 +0200
+++ ./apps/configure 2019-01-24 22:31:28.643242532 +0100
@@ -25,7 +25,7 @@
#----------------------------------------------------------------
echo "CCFLAGS = -fPIC \\" >Make.ccflags
-echo "-DUNIX -O2 -DNDEBUG -I. -I../include -I../../include -W" >>Make.ccflags
+echo "-DUNIX -O2 -DNDEBUG \$(CPPFLAGS) -I. -I../include -I../../include -W" >>Make.ccflags
echo "LIBS = \\" >Make.libs
echo "" >>Make.libs
@@ -35,10 +35,10 @@
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
+CCC = \$(CXX)
TARGET_EXT = .so
-LDFLAGS = -shared
+LDFLAGS += -shared
.SUFFIXES:
.SUFFIXES: .o .cc
diff -u -r ../gnucap-20171003/apps/Make2.Debug ./apps/Make2.Debug
--- ../gnucap-20171003/apps/Make2.Debug 2017-10-04 00:50:49.000000000 +0200
+++ ./apps/Make2.Debug 2019-01-24 22:30:16.059909732 +0100
@@ -24,7 +24,7 @@
# Standard base for g++, debugging, a little optimization
# Running the program will give a spew of line markers for debugging.
-CCC = g++
+CCC = $(CXX)
TARGET_EXT = .so
CCFLAGS = \
diff -u -r ../gnucap-20171003/apps/Make2.g++ ./apps/Make2.g++
--- ../gnucap-20171003/apps/Make2.g++ 2017-10-04 00:50:49.000000000 +0200
+++ ./apps/Make2.g++ 2019-01-24 22:30:16.059909732 +0100
@@ -23,7 +23,7 @@
# Standard base for g++.
-CCC = g++
+CCC = $(CXX)
TARGET_EXT = .so
CCFLAGS = \
diff -u -r ../gnucap-20171003/include/configure ./include/configure
--- ../gnucap-20171003/include/configure 2017-10-04 00:50:49.000000000 +0200
+++ ./include/configure 2019-01-24 22:30:16.059909732 +0100
@@ -22,7 +22,7 @@
#----------------------------------------------------------------
echo \# created by $PWD/$0. do not edit >Make2
echo \#------------------------------------------------------------------------ >>Make2
-echo "CCC = c++" >>Make2
+echo "CCC = \$(CXX)" >>Make2
echo "PREFIX = " $prefix >>Make2
echo "" >>Make2
diff -u -r ../gnucap-20171003/lib/Make2.Debug ./lib/Make2.Debug
--- ../gnucap-20171003/lib/Make2.Debug 2017-10-04 00:50:49.000000000 +0200
+++ ./lib/Make2.Debug 2019-01-24 22:30:16.059909732 +0100
@@ -24,7 +24,7 @@
# Standard base for g++, debugging, a little optimization
# Running the program will give a spew of line markers for debugging.
-CCC = g++
+CCC = $(CXX)
TARGET_EXT = .so
CCFLAGS = \
diff -u -r ../gnucap-20171003/lib/Make2.g++ ./lib/Make2.g++
--- ../gnucap-20171003/lib/Make2.g++ 2017-10-04 00:50:49.000000000 +0200
+++ ./lib/Make2.g++ 2019-01-24 22:30:16.059909732 +0100
@@ -23,7 +23,7 @@
# Standard base for g++.
-CCC = g++
+CCC = $(CXX)
TARGET_EXT = .so
CCFLAGS = \
diff -u -r ../gnucap-20171003/main/configure ./main/configure
--- ../gnucap-20171003/main/configure 2017-10-04 00:50:49.000000000 +0200
+++ ./main/configure 2019-01-24 22:31:37.649909149 +0100
@@ -26,7 +26,7 @@
pkglibdir=$prefix/lib/gnucap
# bug. this is not implemented consistently.
-CXX=${CXX-c++}
+CXX=${CXX}
fill_template() {
sed -e "s#@prefix@#$prefix#" \
@@ -48,7 +48,7 @@
chmod +x gnucap-conf
#----------------------------------------------------------------
echo "CCFLAGS = \\" >Make.ccflags
-echo "-DUNIX -O2 -DNDEBUG -I. -I../include -I../../include -W" >>Make.ccflags
+echo "-DUNIX -O2 -DNDEBUG \$(CPPFLAGS) -I. -I../include -I../../include -W" >>Make.ccflags
echo "LIBS = \\" >Make.libs
echo "-lgnucap \\" >>Make.libs
@@ -59,10 +59,10 @@
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
+CCC = \$(CXX)
TARGET_EXT =
-LDFLAGS = -rdynamic \
+LDFLAGS += -rdynamic \
-L../../lib/O
.SUFFIXES : .o .cc
diff -u -r ../gnucap-20171003/main/Make2.Debug ./main/Make2.Debug
--- ../gnucap-20171003/main/Make2.Debug 2017-10-04 00:50:49.000000000 +0200
+++ ./main/Make2.Debug 2019-01-24 22:30:16.059909732 +0100
@@ -24,7 +24,7 @@
# Standard base for g++, debugging, no optimization
# Running the program will give a spew of line markers for debugging.
-CCC = g++
+CCC = $(CXX)
CCFLAGS = \
-DUNIX -g -O0 -I. -I../../include -DTRACE_UNTESTED \
diff -u -r ../gnucap-20171003/main/Make2.g++ ./main/Make2.g++
--- ../gnucap-20171003/main/Make2.g++ 2017-10-04 00:50:49.000000000 +0200
+++ ./main/Make2.g++ 2019-01-24 22:30:16.059909732 +0100
@@ -23,7 +23,7 @@
# Standard base for g++.
-CCC = g++
+CCC = $(CXX)
CCFLAGS = \
-DUNIX -O3 -DNDEBUG -I. -I../include -I../../include -W
diff -u -r ../gnucap-20171003/modelgen/configure ./modelgen/configure
--- ../gnucap-20171003/modelgen/configure 2017-10-04 00:50:49.000000000 +0200
+++ ./modelgen/configure 2019-01-24 22:31:17.489909279 +0100
@@ -36,10 +36,10 @@
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
+CCC = \$(CXX)
TARGET_EXT =
-LDFLAGS = -rdynamic \
+LDFLAGS += -rdynamic \
-L../../lib/O
.SUFFIXES : .o .cc
diff -u -r ../gnucap-20171003/modelgen/Make2.Debug ./modelgen/Make2.Debug
--- ../gnucap-20171003/modelgen/Make2.Debug 2017-10-04 00:50:49.000000000 +0200
+++ ./modelgen/Make2.Debug 2019-01-24 22:30:16.059909732 +0100
@@ -24,7 +24,7 @@
# Standard base for g++, debugging, no optimization
# Running the program will give a spew of line markers for debugging.
-CCC = g++
+CCC = $(CXX)
CCFLAGS = \
-DUNIX -g -O0 -I. -I../../include -DTRACE_UNTESTED \
diff -u -r ../gnucap-20171003/modelgen/Make2.g++ ./modelgen/Make2.g++
--- ../gnucap-20171003/modelgen/Make2.g++ 2017-10-04 00:50:49.000000000 +0200
+++ ./modelgen/Make2.g++ 2019-01-24 22:30:16.059909732 +0100
@@ -23,7 +23,7 @@
# Standard base for g++.
-CCC = g++
+CCC = $(CXX)
CCFLAGS = \
-DUNIX -O3 -DNDEBUG -I. -I../include -I../../include -W

29
packages/gnucap/build.sh Normal file
View File

@ -0,0 +1,29 @@
TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gnucap/gnucap.html
TERMUX_PKG_DESCRIPTION="The Gnu Circuit Analysis Package"
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
TERMUX_PKG_VERSION=20171003
TERMUX_PKG_SRCURL=https://gitlab.com/gnucap/gnucap/-/archive/${TERMUX_PKG_VERSION}/gnucap-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=2facf5e945cf253727bef9b8e2602767599ea77a6c0d8c5d91101764544fa09a
TERMUX_PKG_DEPENDS="readline"
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_HOSTBUILD=yes
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--prefix=$TERMUX_PREFIX"
termux_step_host_build () {
cp -r $TERMUX_PKG_SRCDIR/* .
./configure
(cd lib && make)
(cd modelgen && make)
(cd apps && make)
}
termux_step_pre_configure () {
mkdir -p $TERMUX_PKG_SRCDIR/apps/O/
cp -r $TERMUX_PKG_HOSTBUILD_DIR/apps/O/*.cc \
$TERMUX_PKG_HOSTBUILD_DIR/apps/O/*.h \
$TERMUX_PKG_SRCDIR/apps/O/
}
termux_step_configure () {
$TERMUX_PKG_SRCDIR/configure --prefix=$TERMUX_PREFIX
}

View File

@ -0,0 +1,21 @@
diff -u -r ../gnucap-20171003/lib/c_attach.cc ./lib/c_attach.cc
--- ../gnucap-20171003/lib/c_attach.cc 2017-10-04 00:50:49.000000000 +0200
+++ ./lib/c_attach.cc 2019-01-24 22:30:16.059909732 +0100
@@ -36,7 +36,7 @@
/*--------------------------------------------------------------------------*/
void list()
{
- for (std::map<std::string, void*>::iterator
+ for (std::map<const std::string, void*>::iterator
ii = attach_list.begin(); ii != attach_list.end(); ++ii) {
if (ii->second) {
IO::mstdout << ii->first << '\n';
@@ -179,7 +179,7 @@
void do_it(CS& cmd, CARD_LIST*)
{
if (CARD_LIST::card_list.is_empty()) {
- for (std::map<std::string, void*>::iterator
+ for (std::map<const std::string, void*>::iterator
ii = attach_list.begin(); ii != attach_list.end(); ++ii) {
void* handle = ii->second;
if (handle) {

View File

@ -0,0 +1,24 @@
--- ./lib/configure.orig 2019-01-24 22:44:34.406570275 +0100
+++ ./lib/configure 2019-01-24 22:46:51.853235913 +0100
@@ -28,7 +28,7 @@
echo "LIBS = -ldl \\" >Make.libs
rm -f a.out
-c++ test_readline.cc $CXXFLAGS $CPPFLAGS $LDFLAGS -lreadline
+$CXX test_readline.cc $CXXFLAGS $CPPFLAGS $LDFLAGS -lreadline
if [ -f a.out ] ; then
echo "using readline"
echo "-DHAVE_LIBREADLINE \\" >>Make.ccflags
@@ -46,10 +46,10 @@
cat <<CAT_EOF >Make.sys
#------------------------------------------------------------------------
VPATH = .:..
-CCC = c++
+CCC = \$(CXX)
TARGET_EXT = .so
-LDFLAGS = -shared
+LDFLAGS += -shared
.SUFFIXES:
.SUFFIXES: .o .cc

View File

@ -0,0 +1,24 @@
--- ./lib/configure.orig 2019-01-24 22:42:28.083237847 +0100
+++ ./lib/configure 2019-01-24 22:42:52.323237693 +0100
@@ -28,17 +28,17 @@
echo "LIBS = -ldl \\" >Make.libs
rm -f a.out
-c++ test_readline.cc -lreadline -ltermcap
+c++ test_readline.cc $CXXFLAGS $CPPFLAGS $LDFLAGS -lreadline
if [ -f a.out ] ; then
echo "using readline"
echo "-DHAVE_LIBREADLINE \\" >>Make.ccflags
- echo "-lreadline -ltermcap \\" >>Make.libs
+ echo "-lreadline \\" >>Make.libs
else
- echo "warning: either libtermcap or libreadline is missing - building without readline"
+ echo "warning: libreadline is missing - building without readline"
fi
rm -f a.out
-echo "-DUNIX -O2 -DNDEBUG -I. -I../include -I../../include -W" >>Make.ccflags
+echo "-DUNIX -O2 -DNDEBUG \$(CPPFLAGS) -I. -I../include -I../../include -W" >>Make.ccflags
echo "" >>Make.libs
echo "PREFIX = " $prefix >>Make.libs
echo "" >>Make.libs