From bdde3df95ce70fed2e3c0f77dfd175050c7d8251 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Wed, 2 Feb 2022 03:30:20 +0900 Subject: [PATCH] new package: oorexx --- packages/oorexx/Makefile.in.patch | 29 +++++++++++ packages/oorexx/build.sh | 51 +++++++++++++++++++ .../common-platform-unix-SysLibrary.cpp.patch | 20 ++++++++ .../oorexx/configure.patch.beforehostbuild | 10 ++++ ...latform-unix-rxunixsys-rxunixsys.cpp.patch | 19 +++++++ ...rm-unix-rexxutil.cpp.patch.beforehostbuild | 11 ++++ ...i-InterpreterAPI.cpp.patch.beforehostbuild | 11 ++++ ...readContextStubs.cpp.patch.beforehostbuild | 20 ++++++++ ...ix-ErrorMessages.cpp.patch.beforehostbuild | 11 ++++ ...-platform-unix-ExternalFunctions.cpp.patch | 21 ++++++++ ...ter-platform-unix-SystemCommands.cpp.patch | 49 ++++++++++++++++++ 11 files changed, 252 insertions(+) create mode 100644 packages/oorexx/Makefile.in.patch create mode 100644 packages/oorexx/build.sh create mode 100644 packages/oorexx/common-platform-unix-SysLibrary.cpp.patch create mode 100644 packages/oorexx/configure.patch.beforehostbuild create mode 100644 packages/oorexx/extensions-platform-unix-rxunixsys-rxunixsys.cpp.patch create mode 100644 packages/oorexx/extensions-rexxutil-platform-unix-rexxutil.cpp.patch.beforehostbuild create mode 100644 packages/oorexx/interpreter-api-InterpreterAPI.cpp.patch.beforehostbuild create mode 100644 packages/oorexx/interpreter-api-ThreadContextStubs.cpp.patch.beforehostbuild create mode 100644 packages/oorexx/interpreter-platform-unix-ErrorMessages.cpp.patch.beforehostbuild create mode 100644 packages/oorexx/interpreter-platform-unix-ExternalFunctions.cpp.patch create mode 100644 packages/oorexx/interpreter-platform-unix-SystemCommands.cpp.patch diff --git a/packages/oorexx/Makefile.in.patch b/packages/oorexx/Makefile.in.patch new file mode 100644 index 000000000..4aea357e4 --- /dev/null +++ b/packages/oorexx/Makefile.in.patch @@ -0,0 +1,29 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -1460,7 +1460,7 @@ + -I$(build_interpreter_platform_dir) + + librexx_la_LIBADD = @ORX_LIBADD_LIBRARY@ +-librexx_la_LDFLAGS = $(VERSION_INFO) @ORX_LDFLAGS_PACKAGE@ ++librexx_la_LDFLAGS = $(VERSION_INFO) @ORX_LDFLAGS_PACKAGE@ $(DLDFLAGS) -l:librexxapi.so + + #################### rxapi ########################## + # Sources for rxapi +@@ -1617,7 +1617,7 @@ + # Extra libraries for librexxutil.so (maybe) + # + librexxutil_la_LIBADD = @ORX_LIBADD_LIBRARY@ +-librexxutil_la_LDFLAGS = $(VERSION_INFO) @ORX_LDFLAGS_LIBRARY@ ++librexxutil_la_LDFLAGS = $(VERSION_INFO) @ORX_LDFLAGS_LIBRARY@ $(DLDFLAGS) -l:librexx.so -l:librexxapi.so + + #################### librxmath.so ################ + # +@@ -1702,7 +1702,7 @@ + # Extra libraries for libhostemu.so (maybe) + # + libhostemu_la_LIBADD = @ORX_LIBADD_LIBRARY@ +-libhostemu_la_LDFLAGS = $(VERSION_INFO) @ORX_LDFLAGS_LIBRARY@ ++libhostemu_la_LDFLAGS = $(VERSION_INFO) @ORX_LDFLAGS_LIBRARY@ $(DLDFLAGS) -l:librexx.so -l:librexxapi.so + + #################### librxunixsys.so ################ + # diff --git a/packages/oorexx/build.sh b/packages/oorexx/build.sh new file mode 100644 index 000000000..2eb1f95ff --- /dev/null +++ b/packages/oorexx/build.sh @@ -0,0 +1,51 @@ +TERMUX_PKG_HOMEPAGE=https://www.oorexx.org/ +TERMUX_PKG_DESCRIPTION="Open Object Rexx" +TERMUX_PKG_LICENSE="CPL-1.0" +TERMUX_PKG_LICENSE_FILE="CPLv1.0.txt, NOTICE" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=4.2.0 +_SOVERSION=${TERMUX_PKG_VERSION%%.*} +TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/project/oorexx/oorexx/${TERMUX_PKG_VERSION}/ooRexx-${TERMUX_PKG_VERSION}-source.tar.gz +TERMUX_PKG_SHA256=ac5af11e7d4d239d2ebe06f40092f4aebf87fc40740b46458bff3b4069ce6e0b +TERMUX_PKG_DEPENDS="libandroid-wordexp, libc++, libcrypt" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_catopen=no" +TERMUX_PKG_HOSTBUILD=true +TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS="CFLAGS=-O0" + +termux_step_post_get_source() { + sed -i 's:__type:_&:g' api/oorexxapi.h +} + +termux_step_pre_configure() { + export PATH=$TERMUX_PKG_HOSTBUILD_DIR:$PATH + + CFLAGS+=" -fwrapv -fno-strict-aliasing" + LDFLAGS+=" -landroid-wordexp -lcrypt $($CC -print-libgcc-file-name)" + + local dummylibdir=$TERMUX_PKG_BUILDDIR/_dummylib + mkdir -p $dummylibdir + echo 'void RexxVariablePool(void){}' | $CC -x c - -shared -nostdlib \ + -Wl,-soname=librexx.so.${_SOVERSION} \ + -o $dummylibdir/librexx.so + echo 'void RexxFreeMemory(void){}' | $CC -x c - -shared -nostdlib \ + -Wl,-soname=librexxapi.so.${_SOVERSION} \ + -o $dummylibdir/librexxapi.so + export DLDFLAGS="-L./.libs -L${dummylibdir}" + + _NEED_DUMMY_LIBPTHREAD_A= + _LIBPTHREAD_A=$TERMUX_PREFIX/lib/libpthread.a + if [ ! -e $_LIBPTHREAD_A ]; then + _NEED_DUMMY_LIBPTHREAD_A=true + echo '!' > $_LIBPTHREAD_A + fi +} + +termux_step_post_configure() { + sed -i 's:\./\(rexximage\):\1:' Makefile +} + +termux_step_post_make_install() { + if [ $_NEED_DUMMY_LIBPTHREAD_A ]; then + rm -f $_LIBPTHREAD_A + fi +} diff --git a/packages/oorexx/common-platform-unix-SysLibrary.cpp.patch b/packages/oorexx/common-platform-unix-SysLibrary.cpp.patch new file mode 100644 index 000000000..df8622700 --- /dev/null +++ b/packages/oorexx/common-platform-unix-SysLibrary.cpp.patch @@ -0,0 +1,20 @@ +--- a/common/platform/unix/SysLibrary.cpp ++++ b/common/platform/unix/SysLibrary.cpp +@@ -54,7 +54,7 @@ + + + #define MAX_LIBRARY_NAME_LENGTH 250 +-#define LIBARY_NAME_BUFFER_LENGTH (MAX_LIBRARY_NAME_LENGTH + sizeof("/usr/lib/lib") + sizeof(ORX_SHARED_LIBRARY_EXT)) ++#define LIBARY_NAME_BUFFER_LENGTH (MAX_LIBRARY_NAME_LENGTH + sizeof("@TERMUX_PREFIX@/lib/lib") + sizeof(ORX_SHARED_LIBRARY_EXT)) + + SysLibrary::SysLibrary() + { +@@ -91,7 +91,7 @@ + // if not found, then try from /usr/lib + if (libraryHandle == NULL) + { +- sprintf(nameBuffer, "/usr/lib/lib%s%s", name, ORX_SHARED_LIBRARY_EXT); ++ sprintf(nameBuffer, "@TERMUX_PREFIX@/lib/lib%s%s", name, ORX_SHARED_LIBRARY_EXT); + libraryHandle = dlopen(nameBuffer, RTLD_LAZY); + // still can't find it? + if (libraryHandle == NULL) diff --git a/packages/oorexx/configure.patch.beforehostbuild b/packages/oorexx/configure.patch.beforehostbuild new file mode 100644 index 000000000..29e24ae2e --- /dev/null +++ b/packages/oorexx/configure.patch.beforehostbuild @@ -0,0 +1,10 @@ +--- a/configure ++++ b/configure +@@ -15426,7 +15426,6 @@ + -Wcast-align \ + -Wshadow \ + -Wwrite-strings \ +- -D__cplusplus \ + -Wredundant-decls" + + XLC_WARNINGS="\ diff --git a/packages/oorexx/extensions-platform-unix-rxunixsys-rxunixsys.cpp.patch b/packages/oorexx/extensions-platform-unix-rxunixsys-rxunixsys.cpp.patch new file mode 100644 index 000000000..ad7b5e2f1 --- /dev/null +++ b/packages/oorexx/extensions-platform-unix-rxunixsys-rxunixsys.cpp.patch @@ -0,0 +1,19 @@ +--- a/extensions/platform/unix/rxunixsys/rxunixsys.cpp ++++ b/extensions/platform/unix/rxunixsys/rxunixsys.cpp +@@ -40,6 +40,7 @@ + + + #include "rxunixsys.h" ++#include + + + /*----------------------------------------------------------------------------*/ +@@ -996,7 +997,7 @@ + int, option) + { + +- return euidaccess(file, option); ++ return access(file, option); + } + #endif + diff --git a/packages/oorexx/extensions-rexxutil-platform-unix-rexxutil.cpp.patch.beforehostbuild b/packages/oorexx/extensions-rexxutil-platform-unix-rexxutil.cpp.patch.beforehostbuild new file mode 100644 index 000000000..40d5d680c --- /dev/null +++ b/packages/oorexx/extensions-rexxutil-platform-unix-rexxutil.cpp.patch.beforehostbuild @@ -0,0 +1,11 @@ +--- a/extensions/rexxutil/platform/unix/rexxutil.cpp ++++ b/extensions/rexxutil/platform/unix/rexxutil.cpp +@@ -1701,7 +1701,7 @@ + num++; + + ptr = mystrstr(line, target, len, args[0].strlength, sensitive); +- if (ptr != '\0') { ++ if (*ptr != '\0') { + if (linenums) { + sprintf(ldp.ibuf, "%d ", (int)num); + len2 = strlen(ldp.ibuf); diff --git a/packages/oorexx/interpreter-api-InterpreterAPI.cpp.patch.beforehostbuild b/packages/oorexx/interpreter-api-InterpreterAPI.cpp.patch.beforehostbuild new file mode 100644 index 000000000..90f0f1643 --- /dev/null +++ b/packages/oorexx/interpreter-api-InterpreterAPI.cpp.patch.beforehostbuild @@ -0,0 +1,11 @@ +--- a/interpreter/api/InterpreterAPI.cpp ++++ b/interpreter/api/InterpreterAPI.cpp +@@ -245,7 +245,7 @@ + #else + char mode[] = "\nAddressing Mode: 32"; + #endif +- char copy1[] = "\n\nCopyright (c) IBM Corporation 1995, 2004.\nCopyright (c) RexxLA "OOREXX_COPY_YEAR".\nAll Rights Reserved."; ++ char copy1[] = "\n\nCopyright (c) IBM Corporation 1995, 2004.\nCopyright (c) RexxLA " OOREXX_COPY_YEAR ".\nAll Rights Reserved."; + char copy2[] = "\nThis program and the accompanying materials are made available under"; + char copy3[] = "\nthe terms of the Common Public License v1.0 which accompanies this"; + char copy4[] = "\ndistribution or at"; diff --git a/packages/oorexx/interpreter-api-ThreadContextStubs.cpp.patch.beforehostbuild b/packages/oorexx/interpreter-api-ThreadContextStubs.cpp.patch.beforehostbuild new file mode 100644 index 000000000..9ed7d856b --- /dev/null +++ b/packages/oorexx/interpreter-api-ThreadContextStubs.cpp.patch.beforehostbuild @@ -0,0 +1,20 @@ +--- a/interpreter/api/ThreadContextStubs.cpp ++++ b/interpreter/api/ThreadContextStubs.cpp +@@ -576,7 +576,7 @@ + catch (RexxNativeActivation *) + { + } +- return false; ++ return NULL; + } + + +@@ -591,7 +591,7 @@ + catch (RexxNativeActivation *) + { + } +- return false; ++ return NULL; + } + + diff --git a/packages/oorexx/interpreter-platform-unix-ErrorMessages.cpp.patch.beforehostbuild b/packages/oorexx/interpreter-platform-unix-ErrorMessages.cpp.patch.beforehostbuild new file mode 100644 index 000000000..f49b700ac --- /dev/null +++ b/packages/oorexx/interpreter-platform-unix-ErrorMessages.cpp.patch.beforehostbuild @@ -0,0 +1,11 @@ +--- a/interpreter/platform/unix/ErrorMessages.cpp ++++ b/interpreter/platform/unix/ErrorMessages.cpp +@@ -165,7 +165,7 @@ + return OREF_NULL; /* no message retrieved */ + #else + sprintf(DataArea,"Cannot get description for error %d",msgid); +- return new_string(&DataArea); ++ return new_string(DataArea); + #endif + } + diff --git a/packages/oorexx/interpreter-platform-unix-ExternalFunctions.cpp.patch b/packages/oorexx/interpreter-platform-unix-ExternalFunctions.cpp.patch new file mode 100644 index 000000000..41c0c8f37 --- /dev/null +++ b/packages/oorexx/interpreter-platform-unix-ExternalFunctions.cpp.patch @@ -0,0 +1,21 @@ +--- a/interpreter/platform/unix/ExternalFunctions.cpp ++++ b/interpreter/platform/unix/ExternalFunctions.cpp +@@ -84,15 +84,15 @@ + + #define CMDBUFSIZE 1024 /* Max size of executable cmd */ + #if defined(AIX) +-#define CMDDEFNAME "/bin/ksh" /* Default unix sys cmd handler */ ++#define CMDDEFNAME "@TERMUX_PREFIX@/bin/ksh" /* Default unix sys cmd handler */ + #define COMSPEC "ksh" /* unix cmd handler env name */ + #define SYSENV "ksh" /* Default AIX cmd environment */ + #elif defined(OPSYS_SUN) +-#define CMDDEFNAME "/bin/sh" /* Default unix sys cmd handler */ ++#define CMDDEFNAME "@TERMUX_PREFIX@/bin/sh" /* Default unix sys cmd handler */ + #define COMSPEC "sh" /* unix cmd handler env name */ + #define SYSENV "sh" /* Default LINUX cmd environment */ + #else +-#define CMDDEFNAME "/bin/bash" /* Default unix sys cmd handler */ ++#define CMDDEFNAME "@TERMUX_PREFIX@/bin/bash" /* Default unix sys cmd handler */ + #define COMSPEC "bash" /* unix cmd handler env name */ + #define SYSENV "bash" /* Default AIX cmd environment */ + #endif diff --git a/packages/oorexx/interpreter-platform-unix-SystemCommands.cpp.patch b/packages/oorexx/interpreter-platform-unix-SystemCommands.cpp.patch new file mode 100644 index 000000000..1d0d32cce --- /dev/null +++ b/packages/oorexx/interpreter-platform-unix-SystemCommands.cpp.patch @@ -0,0 +1,49 @@ +--- a/interpreter/platform/unix/SystemCommands.cpp ++++ b/interpreter/platform/unix/SystemCommands.cpp +@@ -78,7 +78,7 @@ + #elif defined(OPSYS_SUN) /* path for AIX */ + #define CMDDEFNAME "/bin/sh" /* Bourne Again Shell is default */ + #else /* shell for Linux */ +-#define CMDDEFNAME "/bin/bash" /* Bourne Again Shell is default */ ++#define CMDDEFNAME "@TERMUX_PREFIX@/bin/bash" /* Bourne Again Shell is default */ + #endif + + #define UNKNOWN_COMMAND 127 /* unknown command return code */ +@@ -736,23 +736,23 @@ + { /* run the command in the child */ + if (Utilities::strCaselessCompare("sh", envName) == 0) + { +- execl("/bin/sh", "sh", "-c", cmd, NULL); ++ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmd, NULL); + } + else if (Utilities::strCaselessCompare("ksh", envName) == 0) + { +- execl("/bin/ksh", "ksh", "-c", cmd, NULL); ++ execl("@TERMUX_PREFIX@/bin/ksh", "ksh", "-c", cmd, NULL); + } + else if (Utilities::strCaselessCompare("bsh", envName) == 0) + { +- execl("/bin/bsh", "bsh", "-c", cmd, NULL); ++ execl("@TERMUX_PREFIX@/bin/bsh", "bsh", "-c", cmd, NULL); + } + else if (Utilities::strCaselessCompare("csh", envName) == 0) + { +- execl("/bin/csh", "csh", "-c", cmd, NULL); ++ execl("@TERMUX_PREFIX@/bin/csh", "csh", "-c", cmd, NULL); + } + else if (Utilities::strCaselessCompare("bash", envName) == 0) + { +- execl("/bin/bash", "bash", "-c", cmd, NULL); ++ execl("@TERMUX_PREFIX@/bin/bash", "bash", "-c", cmd, NULL); + } + else if (Utilities::strCaselessCompare("cmd", envName) == 0) + { +@@ -767,7 +767,7 @@ + } + else + { +- execl("/bin/sh", "sh", "-c", cmd, NULL); ++ execl("@TERMUX_PREFIX@/bin/sh", "sh", "-c", cmd, NULL); + } + } + }