From 14da8ac6246054b575e80cabc20e53756327fc54 Mon Sep 17 00:00:00 2001 From: komothecat <71205197+komothecat@users.noreply.github.com> Date: Thu, 27 Jun 2024 03:55:26 +0800 Subject: [PATCH] newpkg(tur/opendylan): 2024.1 --- tur/opendylan/0001-fix-linking.patch | 50 +++++++++++++++++++ ...isable-fpu_control-related-functions.patch | 50 +++++++++++++++++++ tur/opendylan/build.sh | 50 +++++++++++++++++++ .../sources-jamfiles-config.jam.in.patch | 25 ++++++++++ .../sources-jamfiles-posix-build.jam.patch | 13 +++++ .../sources-lib-run-time-Makefile.in.patch | 13 +++++ 6 files changed, 201 insertions(+) create mode 100644 tur/opendylan/0001-fix-linking.patch create mode 100644 tur/opendylan/0002-disable-fpu_control-related-functions.patch create mode 100644 tur/opendylan/build.sh create mode 100644 tur/opendylan/sources-jamfiles-config.jam.in.patch create mode 100644 tur/opendylan/sources-jamfiles-posix-build.jam.patch create mode 100644 tur/opendylan/sources-lib-run-time-Makefile.in.patch diff --git a/tur/opendylan/0001-fix-linking.patch b/tur/opendylan/0001-fix-linking.patch new file mode 100644 index 0000000000..f43124bc22 --- /dev/null +++ b/tur/opendylan/0001-fix-linking.patch @@ -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 ; diff --git a/tur/opendylan/0002-disable-fpu_control-related-functions.patch b/tur/opendylan/0002-disable-fpu_control-related-functions.patch new file mode 100644 index 0000000000..6db38a8f3c --- /dev/null +++ b/tur/opendylan/0002-disable-fpu_control-related-functions.patch @@ -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 + #include + #include ++#ifndef __ANDROID__ + #include ++#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) diff --git a/tur/opendylan/build.sh b/tur/opendylan/build.sh new file mode 100644 index 0000000000..f58f5c4de7 --- /dev/null +++ b/tur/opendylan/build.sh @@ -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="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 +} diff --git a/tur/opendylan/sources-jamfiles-config.jam.in.patch b/tur/opendylan/sources-jamfiles-config.jam.in.patch new file mode 100644 index 0000000000..3608704679 --- /dev/null +++ b/tur/opendylan/sources-jamfiles-config.jam.in.patch @@ -0,0 +1,25 @@ +diff --git a/sources/jamfiles/config.jam.in b/sources/jamfiles/config.jam.in +index 978b5c87f..613bdef40 100644 +--- a/sources/jamfiles/config.jam.in ++++ b/sources/jamfiles/config.jam.in +@@ -2,14 +2,14 @@ + # This Jam file is generated by the configure script + # + +-SUPPORTED_COMPILER_BACK_ENDS ?= @SUPPORTED_COMPILER_BACK_ENDS@ ; ++SUPPORTED_COMPILER_BACK_ENDS = @SUPPORTED_COMPILER_BACK_ENDS@ ; + +-CC ?= @CC@ ; +-CCFLAGS ?= @DISABLE_WARNINGS_CFLAGS@ @CFLAGS@ ; +-C++ ?= @CXX@ ; +-C++FLAGS ?= $(CCFLAGS) ; ++CC = @CC@ ; ++CCFLAGS = -w -Wno-error=int-conversion @CFLAGS@ ; ++C++ = @CXX@ ; ++C++FLAGS = $(CCFLAGS) ; + +-LIBS ?= @LIBS@ ; ++LIBS = @LIBS@ ; + + RTLIBS_INSTALL ?= ; + diff --git a/tur/opendylan/sources-jamfiles-posix-build.jam.patch b/tur/opendylan/sources-jamfiles-posix-build.jam.patch new file mode 100644 index 0000000000..4c208f7524 --- /dev/null +++ b/tur/opendylan/sources-jamfiles-posix-build.jam.patch @@ -0,0 +1,13 @@ +diff --git a/sources/jamfiles/posix-build.jam b/sources/jamfiles/posix-build.jam +index 47b798368..50f468ac6 100644 +--- a/sources/jamfiles/posix-build.jam ++++ b/sources/jamfiles/posix-build.jam +@@ -56,7 +56,7 @@ CCFLAGS += -fPIC ; + + LINK ?= $(CC) ; + UNIFYLINK ?= $(CC) -Bstatic ; +-LINKFLAGS ?= $(CCFLAGS) ; ++LINKFLAGS = $(CCFLAGS) -Wno-error=int-conversion ; + + # + # Runtime diff --git a/tur/opendylan/sources-lib-run-time-Makefile.in.patch b/tur/opendylan/sources-lib-run-time-Makefile.in.patch new file mode 100644 index 0000000000..aebad35c27 --- /dev/null +++ b/tur/opendylan/sources-lib-run-time-Makefile.in.patch @@ -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