new package: blade
This commit is contained in:
parent
1f20515b05
commit
bad4c0d458
11
packages/blade/CMakeLists.txt.patch
Normal file
11
packages/blade/CMakeLists.txt.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -218,7 +218,7 @@
|
||||
set(EXE_FILE "${OUTPUT_DIR}/blade${CMAKE_EXECUTABLE_SUFFIX}")
|
||||
|
||||
add_custom_command(TARGET blade POST_BUILD
|
||||
- COMMAND "${EXE_FILE}" "${PROJECT_SOURCE_DIR}/scripts/make_blade.b" "${PROJECT_SOURCE_DIR}"
|
||||
+ COMMAND blade "${PROJECT_SOURCE_DIR}/scripts/make_blade.b" "${PROJECT_SOURCE_DIR}"
|
||||
COMMENT "Generating Blade header and folders..."
|
||||
)
|
||||
|
42
packages/blade/build.sh
Normal file
42
packages/blade/build.sh
Normal file
@ -0,0 +1,42 @@
|
||||
TERMUX_PKG_HOMEPAGE=https://bladelang.com/
|
||||
TERMUX_PKG_DESCRIPTION="A simple, fast, clean and dynamic language"
|
||||
TERMUX_PKG_LICENSE="MIT"
|
||||
TERMUX_PKG_MAINTAINER="@termux"
|
||||
TERMUX_PKG_VERSION=0.0.6
|
||||
TERMUX_PKG_SRCURL=https://github.com/blade-lang/blade/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=3c13f2a81dc027871993e8a369691a470ed7f62b9fb4a72237ff75db36abe35d
|
||||
TERMUX_PKG_DEPENDS="libsqlite, readline"
|
||||
TERMUX_PKG_HOSTBUILD=true
|
||||
|
||||
termux_step_host_build() {
|
||||
termux_setup_cmake
|
||||
cmake $TERMUX_PKG_SRCDIR
|
||||
make -j $TERMUX_MAKE_PROCESSES
|
||||
}
|
||||
|
||||
termux_step_pre_configure() {
|
||||
PATH=$TERMUX_PKG_HOSTBUILD_DIR/bin:$PATH
|
||||
|
||||
_NEED_DUMMY_LIBPTHREAD_A=
|
||||
_LIBPTHREAD_A=$TERMUX_PREFIX/lib/libpthread.a
|
||||
if [ ! -e $_LIBPTHREAD_A ]; then
|
||||
_NEED_DUMMY_LIBPTHREAD_A=true
|
||||
echo '!<arch>' > $_LIBPTHREAD_A
|
||||
fi
|
||||
}
|
||||
|
||||
termux_step_make_install() {
|
||||
pushd bin
|
||||
install -Dm700 -t $TERMUX_PREFIX/bin blade
|
||||
install -Dm600 -t $TERMUX_PREFIX/lib libblade.so
|
||||
local sharedir=$TERMUX_PREFIX/share/blade
|
||||
mkdir -p $sharedir
|
||||
cp -r benchmarks includes libs tests $sharedir/
|
||||
popd
|
||||
}
|
||||
|
||||
termux_step_post_make_install() {
|
||||
if [ $_NEED_DUMMY_LIBPTHREAD_A ]; then
|
||||
rm -f $_LIBPTHREAD_A
|
||||
fi
|
||||
}
|
18
packages/blade/src-blade_file.c.patch
Normal file
18
packages/blade/src-blade_file.c.patch
Normal file
@ -0,0 +1,18 @@
|
||||
--- a/src/blade_file.c
|
||||
+++ b/src/blade_file.c
|
||||
@@ -23,6 +23,15 @@
|
||||
#endif /* ifdef HAVE_SYS_TIME_H */
|
||||
#include <time.h>
|
||||
|
||||
+#ifdef __ANDROID__
|
||||
+#undef st_atimespec
|
||||
+#define st_atimespec st_atim
|
||||
+#undef st_mtimespec
|
||||
+#define st_mtimespec st_mtim
|
||||
+#undef st_ctimespec
|
||||
+#define st_ctimespec st_ctim
|
||||
+#endif
|
||||
+
|
||||
#ifdef _WIN32
|
||||
|
||||
/* Symbolic links aren't really a 'thing' on Windows, so just use plain-old
|
28
packages/blade/src-standard-io.c.patch
Normal file
28
packages/blade/src-standard-io.c.patch
Normal file
@ -0,0 +1,28 @@
|
||||
--- a/src/standard/io.c
|
||||
+++ b/src/standard/io.c
|
||||
@@ -54,8 +54,10 @@
|
||||
dict_add_entry(vm, dict, NUMBER_VAL(1), NUMBER_VAL(raw_attr.c_oflag));
|
||||
dict_add_entry(vm, dict, NUMBER_VAL(2), NUMBER_VAL(raw_attr.c_cflag));
|
||||
dict_add_entry(vm, dict, NUMBER_VAL(3), NUMBER_VAL(raw_attr.c_lflag));
|
||||
+#ifndef __ANDROID__
|
||||
dict_add_entry(vm, dict, NUMBER_VAL(4), NUMBER_VAL(raw_attr.c_ispeed));
|
||||
dict_add_entry(vm, dict, NUMBER_VAL(5), NUMBER_VAL(raw_attr.c_ospeed));
|
||||
+#endif
|
||||
|
||||
RETURN_OBJ(dict);
|
||||
#else
|
||||
@@ -125,12 +127,14 @@
|
||||
if (dict_get_entry(dict, NUMBER_VAL(3), &iflag)) {
|
||||
raw.c_lflag = (long) AS_NUMBER(lflag);
|
||||
}
|
||||
+#ifndef __ANDROID__
|
||||
if (dict_get_entry(dict, NUMBER_VAL(4), &iflag)) {
|
||||
raw.c_ispeed = (long) AS_NUMBER(ispeed);
|
||||
}
|
||||
if (dict_get_entry(dict, NUMBER_VAL(5), &iflag)) {
|
||||
raw.c_ospeed = (long) AS_NUMBER(ospeed);
|
||||
}
|
||||
+#endif
|
||||
|
||||
set_attr_was_called = true;
|
||||
|
Loading…
Reference in New Issue
Block a user