Skip to content

Commit

Permalink
newpkg(main/janet): janet 1.35.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mbekkomo committed Jun 18, 2024
1 parent 932cb3e commit ca66e25
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
49 changes: 49 additions & 0 deletions packages/janet/Makefile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
diff --git a/Makefile b/Makefile
index e3af90c9..496a90be 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ INCLUDEDIR?=$(PREFIX)/include
BINDIR?=$(PREFIX)/bin
LIBDIR?=$(PREFIX)/lib
JANET_BUILD?="\"$(shell git log --pretty=format:'%h' -n 1 2> /dev/null || echo local)\""
-CLIBS=-lm -lpthread
+CLIBS=-lm
JANET_TARGET=build/janet
JANET_BOOT=build/janet_boot
JANET_IMPORT_LIB=build/janet.lib
@@ -77,7 +77,7 @@ ifeq ($(UNAME), Darwin)
JANET_LIBRARY=build/libjanet.dylib
LDCONFIG:=true
else ifeq ($(UNAME), Linux)
- CLIBS:=$(CLIBS) -lrt -ldl
+ CLIBS:=$(CLIBS) -ldl
endif

# For other unix likes, add flags here!
@@ -86,11 +86,11 @@ ifeq ($(UNAME), Haiku)
LDFLAGS=-Wl,--export-dynamic
endif
# For Android (termux)
-ifeq ($(UNAME), Linux) # uname on Darwin doesn't recognise -o
+#ifeq ($(UNAME), Linux) # uname on Darwin doesn't recognise -o
ifeq ($(shell uname -o), Android)
CLIBS:=$(CLIBS) -landroid-spawn
endif
-endif
+#endif

# Mingw
ifeq ($(findstring MINGW,$(UNAME)), MINGW)
@@ -182,10 +182,10 @@ JANET_BOOT_OBJECTS=$(patsubst src/%.c,build/%.boot.o,$(JANET_CORE_SOURCES) $(JAN
$(JANET_BOOT_OBJECTS): $(JANET_BOOT_HEADERS)

build/%.boot.o: src/%.c $(JANET_HEADERS) $(JANET_LOCAL_HEADERS) Makefile
- $(CC) $(BOOT_CFLAGS) -o $@ -c $<
+ clang $(BOOT_CFLAGS) -o $@ -c $<

$(JANET_BOOT): $(JANET_BOOT_OBJECTS)
- $(CC) $(BOOT_CFLAGS) -o $@ $(JANET_BOOT_OBJECTS) $(CLIBS)
+ clang $(BOOT_CFLAGS) -o $@ $(JANET_BOOT_OBJECTS) -lm -ldl -lrt -lpthread

# Now the reason we bootstrap in the first place
build/c/janet.c: $(JANET_BOOT) src/boot/boot.janet
19 changes: 19 additions & 0 deletions packages/janet/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
TERMUX_PKG_HOMEPAGE=https://janet-lang.org
TERMUX_PKG_DESCRIPTION="Janet is a functional and imperative programming language."
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=1.35.0
TERMUX_PKG_SRCURL=https://github.com/janet-lang/janet/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=81d619245040de151572f1c4cd01d4380aae656befed280d35e1fe3a4dd7b0af
TERMUX_PKG_DEPENDS="libandroid-spawn"
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BUILD_IN_SRC=true

termux_step_configure() {
TERMUX_PKG_EXTRA_MAKE_ARGS="PREFIX=${TERMUX_PREFIX}"
}

termux_step_make() {
export CFLAGS="${CPPFLAGS} ${CFLAGS}"
make -j "${TERMUX_PKG_MAKE_PROCESSES}" PREFIX="${TERMUX_PREFIX}"
}

0 comments on commit ca66e25

Please sign in to comment.