Skip to content

Commit cb2671d

Browse files
committed
newpkg(tur/opendylan): 2024.1
1 parent ac55e86 commit cb2671d

8 files changed

+244
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/sources/jamfiles/aarch64-linux-build.jam b/sources/jamfiles/aarch64-linux-build.jam
2+
index 50c5eea38..fe1dad42f 100644
3+
--- a/sources/jamfiles/aarch64-linux-build.jam
4+
+++ b/sources/jamfiles/aarch64-linux-build.jam
5+
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
6+
#
7+
# Overrides/redefinitions
8+
#
9+
-rtclibs += -lpthread -ldl -lrt ;
10+
+rtclibs += -ldl ;
11+
diff --git a/sources/jamfiles/arm-linux-build.jam b/sources/jamfiles/arm-linux-build.jam
12+
index 7d07ffec8..0d5319a85 100644
13+
--- a/sources/jamfiles/arm-linux-build.jam
14+
+++ b/sources/jamfiles/arm-linux-build.jam
15+
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
16+
#
17+
# Overrides/redefinitions
18+
#
19+
-rtclibs += -lpthread -ldl -lrt ;
20+
+rtclibs += -ldl ;
21+
diff --git a/sources/jamfiles/riscv64-linux-build.jam b/sources/jamfiles/riscv64-linux-build.jam
22+
index 4c70f2835..8c95d3589 100644
23+
--- a/sources/jamfiles/riscv64-linux-build.jam
24+
+++ b/sources/jamfiles/riscv64-linux-build.jam
25+
@@ -23,4 +23,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
26+
#
27+
# Overrides/redefinitions
28+
#
29+
-rtclibs += -lpthread -ldl -lrt ;
30+
+rtclibs += -ldl -lrt ;
31+
diff --git a/sources/jamfiles/x86-linux-build.jam b/sources/jamfiles/x86-linux-build.jam
32+
index b811fc404..6acc56114 100644
33+
--- a/sources/jamfiles/x86-linux-build.jam
34+
+++ b/sources/jamfiles/x86-linux-build.jam
35+
@@ -24,4 +24,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
36+
#
37+
# Overrides/redefinitions
38+
#
39+
-rtclibs += -lpthread -ldl -lrt ;
40+
+rtclibs += -ldl ;
41+
diff --git a/sources/jamfiles/x86_64-linux-build.jam b/sources/jamfiles/x86_64-linux-build.jam
42+
index ea88e95ab..8e125bde3 100644
43+
--- a/sources/jamfiles/x86_64-linux-build.jam
44+
+++ b/sources/jamfiles/x86_64-linux-build.jam
45+
@@ -24,4 +24,4 @@ include $(SYSTEM_BUILD_SCRIPTS)/posix-build.jam ;
46+
#
47+
# Overrides/redefinitions
48+
#
49+
-rtclibs += -lpthread -ldl -lrt ;
50+
+rtclibs += -ldl ;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/sources/jamfiles/posix-build.jam b/sources/jamfiles/posix-build.jam
2+
index 47b798368..0d878f54f 100644
3+
--- a/sources/jamfiles/posix-build.jam
4+
+++ b/sources/jamfiles/posix-build.jam
5+
@@ -53,6 +53,7 @@ OBJCOPY ?= objcopy ;
6+
STRIP ?= strip ;
7+
8+
CCFLAGS += -fPIC ;
9+
+echo $(CCFLAGS) ;
10+
11+
LINK ?= $(CC) ;
12+
UNIFYLINK ?= $(CC) -Bstatic ;
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/sources/lib/run-time/x86-linux-exceptions.c b/sources/lib/run-time/x86-linux-exceptions.c
2+
index 0c4150a1e..7bda60f2b 100644
3+
--- a/sources/lib/run-time/x86-linux-exceptions.c
4+
+++ b/sources/lib/run-time/x86-linux-exceptions.c
5+
@@ -10,7 +10,9 @@
6+
#include <signal.h>
7+
#include <sys/ucontext.h>
8+
#include <ucontext.h>
9+
+#ifndef __ANDROID__
10+
#include <fpu_control.h>
11+
+#endif
12+
13+
#include "stack-walker.h"
14+
15+
@@ -46,11 +48,15 @@ extern void dylan_float_underflow_handler();
16+
/* FPU Control Word mask enabling exceptions for divide-by-zero,
17+
* invalid, overflow, and underflow
18+
*/
19+
+#ifndef __ANDROID__
20+
#define DYLAN_FPU_CW (_FPU_DEFAULT \
21+
& ~(_FPU_MASK_ZM \
22+
| _FPU_MASK_IM \
23+
| _FPU_MASK_OM \
24+
| _FPU_MASK_UM))
25+
+#else
26+
+#define DYLAN_FPU_CW 0
27+
+#endif
28+
29+
static inline void chain_sigaction(const struct sigaction *act,
30+
int sig, siginfo_t *info, void *uap)
31+
@@ -159,7 +165,9 @@ static void EstablishDylanExceptionHandlers(void)
32+
33+
/* Set the FPU control word */
34+
cw = DYLAN_FPU_CW;
35+
+ #ifndef __ANDROID__
36+
_FPU_SETCW(cw);
37+
+ #endif
38+
}
39+
40+
static void RemoveDylanExceptionHandlers (void)
41+
@@ -176,7 +184,9 @@ void RestoreFPState (ucontext_t *uc)
42+
if (uc->uc_mcontext.fpregs) {
43+
uc->uc_mcontext.fpregs->cw = cw;
44+
}
45+
+ #ifndef __ANDROID__
46+
_FPU_SETCW(cw);
47+
+ #endif
48+
}
49+
50+
static void DylanFPEHandler (int sig, siginfo_t *info, void *uap)
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/sources/lib/build-system/variables.dylan b/sources/lib/build-system/variables.dylan
2+
index 47a31dab4..c9fc62b92 100644
3+
--- a/sources/lib/build-system/variables.dylan
4+
+++ b/sources/lib/build-system/variables.dylan
5+
@@ -12,14 +12,12 @@ define variable $personal-bin :: false-or(<directory-locator>) = #f;
6+
7+
// We don't ensure system directories because nothing is installed there.
8+
// By definition they had to have been already created
9+
-define variable $system-install :: false-or(<directory-locator>) = #f;
10+
+define variable $system-install :: false-or(<directory-locator>) = as(<directory-locator>, "@TERMUX_PREFIX@");
11+
12+
define method configure-build-system () => ()
13+
$personal-install := user-install-path();
14+
$personal-bin :=
15+
$personal-install & subdirectory-locator($personal-install, "bin");
16+
-
17+
- $system-install := system-install-path() | system-release-path();
18+
end method;
19+
20+
configure-build-system();
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/android-build.jam b/android-build.jam
2+
new file mode 100644
3+
index 000000000..9fe529f17
4+
--- /dev/null
5+
+++ b/android-build.jam
6+
@@ -0,0 +1,8 @@
7+
+CC = @CC@ ;
8+
+CCFLAGS = @CFLAGS@ ;
9+
+LINK = @CC@ ;
10+
+LINKFLAGS = @LDFLAGS@ ;
11+
+GC_CFLAGS = -DGC_USE_BOEHM -DGC_THREADS ;
12+
+GC_LFLAGS = -lgc ;
13+
+
14+
+include $(SYSTEM_BUILD_SCRIPTS)/@[email protected] ;

tur/opendylan/build.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
TERMUX_PKG_HOMEPAGE=https://opendylan.org
2+
TERMUX_PKG_DESCRIPTION="Open Dylan is a compiler and a set of libraries for the Dylan programming language."
3+
TERMUX_PKG_LICENSE="custom"
4+
TERMUX_PKG_LICENSE_FILE="License.txt"
5+
TERMUX_PKG_MAINTAINER="@termux-user-repository"
6+
TERMUX_PKG_VERSION=2024.1.0
7+
TERMUX_PKG_SRCURL=git+https://github.com/dylan-lang/opendylan
8+
TERMUX_PKG_DEPENDS="libgc"
9+
TERMUX_PKG_BUILD_IN_SRC=true
10+
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
11+
--with-gc=${TERMUX_PREFIX}
12+
--with-harp-collector=boehm
13+
"
14+
15+
termux_step_pre_configure() {
16+
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
17+
tar -xf "${TERMUX_PKG_CACHEDIR}/opendylan.tar.bz2" -C "${TERMUX_PKG_CACHEDIR}"
18+
export PATH="$PATH:${TERMUX_PKG_CACHEDIR}/opendylan-2024.1/bin"
19+
20+
find "${TERMUX_PKG_CACHEDIR}/opendylan-2024.1" -name '*.jam' -type f -exec \
21+
sed -i \
22+
-e 's/-lrt//g' \
23+
-e 's/-lpthread//g' \
24+
{} \;
25+
26+
case "${TARGET_ARCH:=${TERMUX_ARCH}}" in
27+
i686) TARGET_ARCH=x86 ;;
28+
esac
29+
export OPEN_DYLAN_TARGET_PLATFORM="${TARGET_ARCH}-linux"
30+
31+
CFLAGS+=" -Wno-error=int-conversion -femulated-tls"
32+
LDFLAGS+=" -Wl,-plugin-opt=-emulated-tls=1"
33+
34+
sed -i \
35+
-e "s|@CC@|${CC}|g" \
36+
-e "s|@CFLAGS@|${CPPFLAGS} ${CFLAGS}|g" \
37+
-e "s|@LDFLAGS@|${LDFLAGS}|g" \
38+
-e "s|@ARCH@|${TARGET_ARCH}|g" \
39+
"${TERMUX_PKG_SRCDIR}/android-build.jam"
40+
41+
./autogen.sh
42+
}
43+
44+
termux_step_make() {
45+
make -j "${TERMUX_PKG_MAKE_PROCESSES}" -C "sources/lib/run-time" clean install \
46+
CC="${CC} ${CFLAGS}" \
47+
OPEN_DYLAN_TARGET_PLATFORM="${OPEN_DYLAN_TARGET_PLATFORM}" \
48+
OPEN_DYLAN_USER_INSTALL="${TERMUX_PREFIX}"
49+
50+
dylan-compiler \
51+
-jobs "${TERMUX_PKG_MAKE_PROCESSES}" \
52+
-back-end c \
53+
-build-script "${TERMUX_PKG_SRCDIR}/android-build.jam" \
54+
-release \
55+
-verbose \
56+
-echo-input \
57+
-build sources/environment/console/dylan-compiler.lid
58+
59+
find ./_build
60+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/sources/jamfiles/config.jam.in b/sources/jamfiles/config.jam.in
2+
index 978b5c87f..613bdef40 100644
3+
--- a/sources/jamfiles/config.jam.in
4+
+++ b/sources/jamfiles/config.jam.in
5+
@@ -2,14 +2,14 @@
6+
# This Jam file is generated by the configure script
7+
#
8+
9+
-SUPPORTED_COMPILER_BACK_ENDS ?= @SUPPORTED_COMPILER_BACK_ENDS@ ;
10+
+SUPPORTED_COMPILER_BACK_ENDS = @SUPPORTED_COMPILER_BACK_ENDS@ ;
11+
12+
-CC ?= @CC@ ;
13+
-CCFLAGS ?= @DISABLE_WARNINGS_CFLAGS@ @CFLAGS@ ;
14+
-C++ ?= @CXX@ ;
15+
-C++FLAGS ?= $(CCFLAGS) ;
16+
+CC = @CC@ ;
17+
+CCFLAGS = -w -Wno-error=int-conversion @CFLAGS@ ;
18+
+C++ = @CXX@ ;
19+
+C++FLAGS = $(CCFLAGS) ;
20+
21+
-LIBS ?= @LIBS@ ;
22+
+LIBS = @LIBS@ ;
23+
24+
RTLIBS_INSTALL ?= ;
25+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/sources/jamfiles/posix-build.jam b/sources/jamfiles/posix-build.jam
2+
index 47b798368..50f468ac6 100644
3+
--- a/sources/jamfiles/posix-build.jam
4+
+++ b/sources/jamfiles/posix-build.jam
5+
@@ -56,7 +56,7 @@ CCFLAGS += -fPIC ;
6+
7+
LINK ?= $(CC) ;
8+
UNIFYLINK ?= $(CC) -Bstatic ;
9+
-LINKFLAGS ?= $(CCFLAGS) ;
10+
+LINKFLAGS = $(CCFLAGS) -Wno-error=int-conversion ;
11+
12+
#
13+
# Runtime

0 commit comments

Comments
 (0)