Skip to content

Commit

Permalink
newpkg(tur/opendylan): 2024.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mbekkomo committed Jun 25, 2024
1 parent d129764 commit ecbfad5
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tur/opendylan/0001-fix-linking.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/sources/jamfiles/aarch64-linux-build.jam b/sources/jamfiles/aarch64-linux-build.jam
index 50c5eea38..fe1dad42f 100644
--- a/sources/jamfiles/aarch64-linux-build.jam
+++ b/sources/jamfiles/aarch64-linux-build.jam
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
#
# Overrides/redefinitions
#
-rtclibs += -lpthread -ldl -lrt ;
+rtclibs += -ldl ;
diff --git a/sources/jamfiles/arm-linux-build.jam b/sources/jamfiles/arm-linux-build.jam
index 7d07ffec8..0d5319a85 100644
--- a/sources/jamfiles/arm-linux-build.jam
+++ b/sources/jamfiles/arm-linux-build.jam
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
#
# Overrides/redefinitions
#
-rtclibs += -lpthread -ldl -lrt ;
+rtclibs += -ldl ;
diff --git a/sources/jamfiles/riscv64-linux-build.jam b/sources/jamfiles/riscv64-linux-build.jam
index 4c70f2835..8c95d3589 100644
--- a/sources/jamfiles/riscv64-linux-build.jam
+++ b/sources/jamfiles/riscv64-linux-build.jam
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
#
# Overrides/redefinitions
#
-rtclibs += -lpthread -ldl -lrt ;
+rtclibs += -ldl -lrt ;
diff --git a/sources/jamfiles/x86-linux-build.jam b/sources/jamfiles/x86-linux-build.jam
index b811fc404..6acc56114 100644
--- a/sources/jamfiles/x86-linux-build.jam
+++ b/sources/jamfiles/x86-linux-build.jam
@@ -24,4 +24,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
#
# Overrides/redefinitions
#
-rtclibs += -lpthread -ldl -lrt ;
+rtclibs += -ldl ;
diff --git a/sources/jamfiles/x86_64-linux-build.jam b/sources/jamfiles/x86_64-linux-build.jam
index ea88e95ab..8e125bde3 100644
--- a/sources/jamfiles/x86_64-linux-build.jam
+++ b/sources/jamfiles/x86_64-linux-build.jam
@@ -24,4 +24,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
#
# Overrides/redefinitions
#
-rtclibs += -lpthread -ldl -lrt ;
+rtclibs += -ldl ;
12 changes: 12 additions & 0 deletions tur/opendylan/0002-fix-warning-as-error.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/sources/jamfiles/posix-build.jam b/sources/jamfiles/posix-build.jam
index 47b798368..0d878f54f 100644
--- a/sources/jamfiles/posix-build.jam
+++ b/sources/jamfiles/posix-build.jam
@@ -53,6 +53,7 @@ OBJCOPY ?= objcopy ;
STRIP ?= strip ;

CCFLAGS += -fPIC ;
+echo $(CCFLAGS) ;

LINK ?= $(CC) ;
UNIFYLINK ?= $(CC) -Bstatic ;
50 changes: 50 additions & 0 deletions tur/opendylan/0003-disable-fpu_control-related-functions.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
diff --git a/sources/lib/run-time/x86-linux-exceptions.c b/sources/lib/run-time/x86-linux-exceptions.c
index 0c4150a1e..7bda60f2b 100644
--- a/sources/lib/run-time/x86-linux-exceptions.c
+++ b/sources/lib/run-time/x86-linux-exceptions.c
@@ -10,7 +10,9 @@
#include <signal.h>
#include <sys/ucontext.h>
#include <ucontext.h>
+#ifndef __ANDROID__
#include <fpu_control.h>
+#endif

#include "stack-walker.h"

@@ -46,11 +48,15 @@ extern void dylan_float_underflow_handler();
/* FPU Control Word mask enabling exceptions for divide-by-zero,
* invalid, overflow, and underflow
*/
+#ifndef __ANDROID__
#define DYLAN_FPU_CW (_FPU_DEFAULT \
& ~(_FPU_MASK_ZM \
| _FPU_MASK_IM \
| _FPU_MASK_OM \
| _FPU_MASK_UM))
+#else
+#define DYLAN_FPU_CW 0
+#endif

static inline void chain_sigaction(const struct sigaction *act,
int sig, siginfo_t *info, void *uap)
@@ -159,7 +165,9 @@ static void EstablishDylanExceptionHandlers(void)

/* Set the FPU control word */
cw = DYLAN_FPU_CW;
+ #ifndef __ANDROID__
_FPU_SETCW(cw);
+ #endif
}

static void RemoveDylanExceptionHandlers (void)
@@ -176,7 +184,9 @@ void RestoreFPState (ucontext_t *uc)
if (uc->uc_mcontext.fpregs) {
uc->uc_mcontext.fpregs->cw = cw;
}
+ #ifndef __ANDROID__
_FPU_SETCW(cw);
+ #endif
}

static void DylanFPEHandler (int sig, siginfo_t *info, void *uap)
50 changes: 50 additions & 0 deletions tur/opendylan/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
TERMUX_PKG_HOMEPAGE=https://opendylan.org
TERMUX_PKG_DESCRIPTION="Open Dylan is a compiler and a set of libraries for the Dylan programming language."
TERMUX_PKG_LICENSE="custom"
TERMUX_PKG_LICENSE_FILE="License.txt"
TERMUX_PKG_MAINTAINER="@termux-user-repository"
TERMUX_PKG_VERSION=2024.1.0
TERMUX_PKG_SRCURL=git+https://github.com/dylan-lang/opendylan
TERMUX_PKG_DEPENDS="clang, lld, libgc"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--with-gc=${TERMUX_PREFIX}
--with-harp-collector=boehm
"

termux_step_pre_configure() {
curl -Lo "${TERMUX_PKG_CACHEDIR}/opendylan.tar.bz2" https://github.com/dylan-lang/opendylan/releases/download/v2024.1.0/opendylan-2024.1-x86_64-linux.tar.bz2
tar -xf "${TERMUX_PKG_CACHEDIR}/opendylan.tar.bz2" -C "${TERMUX_PKG_CACHEDIR}"
export PATH="$PATH:${TERMUX_PKG_CACHEDIR}/opendylan-2024.1/bin"

case "${TARGET_ARCH:=${TERMUX_ARCH}}" in
i686) TARGET_ARCH=x86 ;;
esac
export OPEN_DYLAN_TARGET_PLATFORM="${TARGET_ARCH}-linux"

CFLAGS+=" -Wno-error=int-conversion"
./autogen.sh
}

termux_step_make() {
pushd "sources/lib/run-time"

make -j "${TERMUX_PKG_MAKE_PROCESSES}" \
OPEN_DYLAN_TARGET_PLATFORM="${OPEN_DYLAN_TARGET_PLATFORM}"

popd

dylan-compiler \
-jobs "${TERMUX_PKG_MAKE_PROCESSES}" \
-back-end c \
-build-script "sources/jamfiles/${OPEN_DYLAN_TARGET_PLATFORM}-build.jam" \
-build dylan-compiler -verbose

dylan-compiler \
-jobs "${TERMUX_PKG_MAKE_PROCESSES}" \
-back-end c \
-build-script "sources/jamfiles/${OPEN_DYLAN_TARGET_PLATFORM}-build.jam" \
-build dylan-tool -verbose

find ./_build
}
13 changes: 13 additions & 0 deletions tur/opendylan/sources-jamfiles-config.jam.in.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/sources/jamfiles/config.jam.in b/sources/jamfiles/config.jam.in
index 978b5c87f..947075766 100644
--- a/sources/jamfiles/config.jam.in
+++ b/sources/jamfiles/config.jam.in
@@ -5,7 +5,7 @@
SUPPORTED_COMPILER_BACK_ENDS ?= @SUPPORTED_COMPILER_BACK_ENDS@ ;

CC ?= @CC@ ;
-CCFLAGS ?= @DISABLE_WARNINGS_CFLAGS@ @CFLAGS@ ;
+CCFLAGS ?= -w @CFLAGS@ ;
C++ ?= @CXX@ ;
C++FLAGS ?= $(CCFLAGS) ;

13 changes: 13 additions & 0 deletions tur/opendylan/sources-lib-run-time-Makefile.in.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/sources/lib/run-time/Makefile.in b/sources/lib/run-time/Makefile.in
index 9651c660c..4b1f884d3 100644
--- a/sources/lib/run-time/Makefile.in
+++ b/sources/lib/run-time/Makefile.in
@@ -104,7 +104,7 @@ endif
CC = @CC@
AR = ar -rcs

-CFLAGS = $(PLATFORM_CFLAGS) -Wall -O -g -I$(srcdir) @DEFS@ @CPPFLAGS@
+CFLAGS += $(PLATFORM_CFLAGS) -Wall -O -g -I$(srcdir) @DEFS@ @CPPFLAGS@
LFLAGS = $(PLATFORM_LFLAGS)

HARP_CFLAGS = -DOPEN_DYLAN_BACKEND_HARP

0 comments on commit ecbfad5

Please sign in to comment.