Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new package: oorexx #8875

Merged
merged 1 commit into from
Feb 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 29 additions & 0 deletions packages/oorexx/Makefile.in.patch
Original file line number Diff line number Diff line change
@@ -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 ################
#
51 changes: 51 additions & 0 deletions packages/oorexx/build.sh
Original file line number Diff line number Diff line change
@@ -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 '!<arch>' > $_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
}
20 changes: 20 additions & 0 deletions packages/oorexx/common-platform-unix-SysLibrary.cpp.patch
Original file line number Diff line number Diff line change
@@ -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)
10 changes: 10 additions & 0 deletions packages/oorexx/configure.patch.beforehostbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/configure
+++ b/configure
@@ -15426,7 +15426,6 @@
-Wcast-align \
-Wshadow \
-Wwrite-strings \
- -D__cplusplus \
-Wredundant-decls"

XLC_WARNINGS="\
Original file line number Diff line number Diff line change
@@ -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 <crypt.h>


/*----------------------------------------------------------------------------*/
@@ -996,7 +997,7 @@
int, option)
{

- return euidaccess(file, option);
+ return access(file, option);
}
#endif

Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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";
Original file line number Diff line number Diff line change
@@ -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;
}


Original file line number Diff line number Diff line change
@@ -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
}

Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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);
}
}
}