Skip to content

Commit

Permalink
addpkg(main/cyclone): 0.36.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tqfx committed Jun 18, 2024
1 parent 0e1180d commit 0cb1211
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
16 changes: 16 additions & 0 deletions packages/cyclone/Makefile.config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
https://github.com/termux/termux-packages/pull/20560#issuecomment-2171793305

--- a/Makefile.config
+++ b/Makefile.config
@@ -90,9 +90,8 @@ DATADIR ?= $(PREFIX)/share/cyclone
DESTDIR ?=

# Automatically detect platform-specific flags, instead of using autoconf
-#CYC_PLATFORM_HAS_MEMSTREAM ?= 1
-CYC_PLATFORM_HAS_MEMSTREAM := $(shell echo "main(){char *buf; int len; open_memstream(&buf, &len);}" | $(CC) -xc - >/dev/null 2>/dev/null && echo 1 || echo 0)
-CYC_PLATFORM_HAS_FMEMOPEN := $(shell echo "main(){char *buf; fmemopen(&buf, 0, \"r\");}" | $(CC) -xc - >/dev/null 2>/dev/null && echo 1 || echo 0)
+CYC_PLATFORM_HAS_MEMSTREAM ?= 1
+CYC_PLATFORM_HAS_FMEMOPEN ?= 1

# code from chibi's makefile to detect platform
ifndef PLATFORM
22 changes: 22 additions & 0 deletions packages/cyclone/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
TERMUX_PKG_HOMEPAGE=http://justinethier.github.io/cyclone/
TERMUX_PKG_DESCRIPTION="A brand-new compiler that allows practical application development using R7RS Scheme"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="0.36.0"
TERMUX_PKG_SRCURL=https://github.com/justinethier/cyclone-bootstrap/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=6b984f4cc336993306cfc3e6bd9e82f4fc1a008f3592d4e942b5de182f5fac20
TERMUX_PKG_DEPENDS="libandroid-complex-math, libck"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true
TERMUX_PKG_BLACKLISTED_ARCHES="arm" ## follows `libck` blacklist
TERMUX_PKG_EXTRA_MAKE_ARGS="
PREFIX=$TERMUX_PREFIX
PLATFORM=android
"

termux_step_pre_configure() {
CFLAGS+=" -I$TERMUX_PREFIX/include" # for gc.c
CFLAGS+=" -Wno-error=int-conversion" # for i686
LDFLAGS+=" -lm -landroid-complex-math"
}
16 changes: 16 additions & 0 deletions packages/cyclone/include-cyclone-types.h.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/include/cyclone/types.h
+++ b/include/cyclone/types.h
@@ -22,6 +22,13 @@
#include <dlfcn.h>
#include "cyclone/bignum.h"

+#if defined(__ANDROID__) && __ANDROID_API__ < 26
+double complex clog(double complex);
+float complex clogf(float complex);
+double complex cpow(double complex, double complex);
+float complex cpowf(float complex, float complex);
+#endif
+
#ifdef CYC_HIGH_RES_TIMERS
/**
* \defgroup hrt High resolution timers

0 comments on commit 0cb1211

Please sign in to comment.