Split wren libraries off as libwren and build the real CLI interpreter

This commit is contained in:
Butta 2020-08-23 21:33:01 +05:30 committed by buttaface
parent e0c28ed06d
commit 2877a1b7c4
5 changed files with 166 additions and 16 deletions

36
packages/libwren/build.sh Normal file
View File

@ -0,0 +1,36 @@
TERMUX_PKG_HOMEPAGE=https://wren.io/
TERMUX_PKG_DESCRIPTION="Small, fast, class-based concurrent scripting language libraries"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_VERSION=0.3.0
TERMUX_PKG_SRCURL=https://github.com/wren-lang/wren/archive/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=c566422b52a18693f57b15ae4c9459604e426ea64eddb5fbf2844d8781aa4eb7
TERMUX_PKG_BREAKS="wren-dev, wren"
TERMUX_PKG_REPLACES="wren-dev, wren"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true
termux_step_make() {
local QUIET_BUILD=
if [ "$TERMUX_QUIET_BUILD" = true ]; then
QUIET_BUILD="-s"
fi
cd projects/make
if [ "$TERMUX_ARCH" = i686 ] || [ "$TERMUX_ARCH" = arm ]; then
RELEASE=release_32bit
else
RELEASE=release_64bit
fi
make -j $TERMUX_MAKE_PROCESSES $QUIET_BUILD config=${RELEASE}
}
termux_step_make_install() {
install -Dm600 "$TERMUX_PKG_SRCDIR"/src/include/wren.h \
"$TERMUX_PREFIX"/include/wren.h
install -Dm600 "$TERMUX_PKG_SRCDIR"/lib/libwren.so \
"$TERMUX_PREFIX"/lib/libwren.so
install -Dm600 "$TERMUX_PKG_SRCDIR"/lib/libwren.a \
"$TERMUX_PREFIX"/lib/libwren.a
}

View File

@ -1,13 +1,11 @@
TERMUX_PKG_HOMEPAGE=https://wren.io/
TERMUX_PKG_DESCRIPTION="Small, fast, class-based concurrent scripting language"
TERMUX_PKG_DESCRIPTION="Small, fast, class-based concurrent scripting language interpreter"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_VERSION=0.3.0
TERMUX_PKG_SRCURL=https://github.com/wren-lang/wren/archive/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=c566422b52a18693f57b15ae4c9459604e426ea64eddb5fbf2844d8781aa4eb7
TERMUX_PKG_BREAKS="wren-dev"
TERMUX_PKG_REPLACES="wren-dev"
TERMUX_PKG_SRCURL=https://github.com/wren-lang/wren-cli/archive/$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=a498d2ccb9a723e7163b4530efbaec389cc13e6baaf935e16cbd052a739b7265
TERMUX_PKG_DEPENDS="libuv"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_NO_STATICSPLIT=true
termux_step_make() {
local QUIET_BUILD=
@ -25,15 +23,6 @@ termux_step_make() {
}
termux_step_make_install() {
install -Dm700 "$TERMUX_PKG_SRCDIR"/bin/wren_test \
install -Dm700 "$TERMUX_PKG_SRCDIR"/bin/wren_cli \
"$TERMUX_PREFIX"/bin/wren
install -Dm600 "$TERMUX_PKG_SRCDIR"/src/include/wren.h \
"$TERMUX_PREFIX"/include/wren.h
install -Dm600 "$TERMUX_PKG_SRCDIR"/lib/libwren.so \
"$TERMUX_PREFIX"/lib/libwren.so
install -Dm600 "$TERMUX_PKG_SRCDIR"/lib/libwren.a \
"$TERMUX_PREFIX"/lib/libwren.a
}

View File

@ -0,0 +1,48 @@
diff -uNr wren-0.1.0/src/cli/vm.h wren-0.1.0.mod/src/cli/vm.h
--- wren-0.1.0/src/cli/vm.h 2016-05-21 20:53:05.000000000 +0300
+++ wren-0.1.0.mod/src/cli/vm.h 2019-07-01 21:53:28.116581394 +0300
@@ -1,7 +1,7 @@
#ifndef vm_h
#define vm_h
-#include "uv.h"
+#include <uv.h>
#include "wren.h"
// Executes the Wren script at [path] in a new VM.
diff -uNr wren-0.1.0/src/module/io.c wren-0.1.0.mod/src/module/io.c
--- wren-0.1.0/src/module/io.c 2016-05-21 20:53:05.000000000 +0300
+++ wren-0.1.0.mod/src/module/io.c 2019-07-01 21:53:23.563209454 +0300
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
-#include "uv.h"
+#include <uv.h>
#include "scheduler.h"
#include "vm.h"
diff -uNr wren-0.1.0/src/module/scheduler.c wren-0.1.0.mod/src/module/scheduler.c
--- wren-0.1.0/src/module/scheduler.c 2016-05-21 20:53:05.000000000 +0300
+++ wren-0.1.0.mod/src/module/scheduler.c 2019-07-01 21:53:03.086368797 +0300
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
-#include "uv.h"
+#include <uv.h>
#include "scheduler.h"
#include "wren.h"
diff -uNr wren-0.1.0/src/module/timer.c wren-0.1.0.mod/src/module/timer.c
--- wren-0.1.0/src/module/timer.c 2016-05-21 20:53:05.000000000 +0300
+++ wren-0.1.0.mod/src/module/timer.c 2019-07-01 21:53:32.426617909 +0300
@@ -1,7 +1,7 @@
#include <stdlib.h>
#include <string.h>
-#include "uv.h"
+#include <uv.h>
#include "scheduler.h"
#include "vm.h"

View File

@ -0,0 +1,77 @@
--- src/projects/make/wren_cli.make 2020-06-05 21:41:22.000000000 +0000
+++ src/projects/make/wren_cli.make 2020-08-23 15:34:51.010694058 +0000
@@ -19,11 +19,11 @@
# ############################
#################
RESCOMP = windres
-INCLUDES += -I../../src/cli -I../../src/module -I../../deps/wren/include -I../../deps/wren/src/vm -I../../deps/wren/src/optional -I../../deps/libuv/include -I../../deps/libuv/src
+INCLUDES += -I../../src/cli -I../../src/module -I../../deps/wren/include -I../../deps/wren/src/vm -I../../deps/wren/src/optional
FORCE_INCLUDE +=
ALL_CPPFLAGS += $(CPPFLAGS) -MMD -MP $(DEFINES) $(INCLUDES)
ALL_RESFLAGS += $(RESFLAGS) $(DEFINES) $(INCLUDES)
-LIBS += -lpthread -ldl -lm
+LIBS += -luv -ldl -lm
LDDEPS +=
LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
define PREBUILDCMDS
@@ -49,7 +49,7 @@
DEFINES += -DNDEBUG -D_GNU_SOURCE
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m32 -O3 -std=c99
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m32 -O3
-ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib32 -m32 -s
+ALL_LDFLAGS += $(LDFLAGS) -m32 -s
else ifeq ($(config),release_64bit-no-nan-tagging)
TARGETDIR = ../../bin
@@ -100,50 +100,14 @@
OBJECTS :=
-OBJECTS += $(OBJDIR)/async.o
-OBJECTS += $(OBJDIR)/core.o
-OBJECTS += $(OBJDIR)/dl.o
-OBJECTS += $(OBJDIR)/fs-poll.o
-OBJECTS += $(OBJDIR)/fs.o
-OBJECTS += $(OBJDIR)/getaddrinfo.o
-OBJECTS += $(OBJDIR)/getnameinfo.o
-OBJECTS += $(OBJDIR)/idna.o
-OBJECTS += $(OBJDIR)/inet.o
OBJECTS += $(OBJDIR)/io.o
-OBJECTS += $(OBJDIR)/linux-core.o
-OBJECTS += $(OBJDIR)/linux-inotify.o
-OBJECTS += $(OBJDIR)/linux-syscalls.o
-OBJECTS += $(OBJDIR)/loop-watcher.o
-OBJECTS += $(OBJDIR)/loop.o
OBJECTS += $(OBJDIR)/main.o
OBJECTS += $(OBJDIR)/modules.o
OBJECTS += $(OBJDIR)/os.o
OBJECTS += $(OBJDIR)/path.o
-OBJECTS += $(OBJDIR)/pipe.o
-OBJECTS += $(OBJDIR)/poll.o
-OBJECTS += $(OBJDIR)/process.o
-OBJECTS += $(OBJDIR)/procfs-exepath.o
-OBJECTS += $(OBJDIR)/proctitle.o
-OBJECTS += $(OBJDIR)/random-devurandom.o
-OBJECTS += $(OBJDIR)/random-getrandom.o
-OBJECTS += $(OBJDIR)/random-sysctl-linux.o
-OBJECTS += $(OBJDIR)/random.o
OBJECTS += $(OBJDIR)/repl.o
OBJECTS += $(OBJDIR)/scheduler.o
-OBJECTS += $(OBJDIR)/signal.o
-OBJECTS += $(OBJDIR)/stream.o
-OBJECTS += $(OBJDIR)/strscpy.o
-OBJECTS += $(OBJDIR)/sysinfo-loadavg.o
-OBJECTS += $(OBJDIR)/tcp.o
-OBJECTS += $(OBJDIR)/thread.o
-OBJECTS += $(OBJDIR)/threadpool.o
-OBJECTS += $(OBJDIR)/timer.o
OBJECTS += $(OBJDIR)/timer1.o
-OBJECTS += $(OBJDIR)/tty.o
-OBJECTS += $(OBJDIR)/udp.o
-OBJECTS += $(OBJDIR)/uv-common.o
-OBJECTS += $(OBJDIR)/uv-data-getter-setters.o
-OBJECTS += $(OBJDIR)/version.o
OBJECTS += $(OBJDIR)/vm.o
OBJECTS += $(OBJDIR)/wren_compiler.o
OBJECTS += $(OBJDIR)/wren_core.o