-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
addpkg(main/{luvi,luvit,lit}): (#20467)
Co-authored-by: TomIO <[email protected]> closes: #3239
- Loading branch information
Showing
5 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
TERMUX_PKG_HOMEPAGE=https://luvit.io | ||
TERMUX_PKG_DESCRIPTION="Toolkit for developing, sharing, and running luvit/lua programs and libraries." | ||
TERMUX_PKG_LICENSE="Apache-2.0" | ||
TERMUX_PKG_MAINTAINER="@termux" | ||
TERMUX_PKG_VERSION=3.8.5 | ||
TERMUX_PKG_SRCURL=git+https://github.com/luvit/lit.git | ||
TERMUX_PKG_GIT_BRANCH=${TERMUX_PKG_VERSION} | ||
TERMUX_PKG_BUILD_DEPENDS="luvi" | ||
TERMUX_PKG_SUGGESTS="luvi, luvit" | ||
TERMUX_PKG_BUILD_IN_SRC=true | ||
TERMUX_PKG_NO_STRIP=true | ||
|
||
termux_step_configure() { | ||
sh "${TERMUX_PKG_SRCDIR}/get-lit.sh" | ||
mv lit "${TERMUX_PKG_SRCDIR}/_lit" | ||
} | ||
|
||
termux_step_make() { | ||
./_lit make . ./lit "${TERMUX_PREFIX}/bin/luvi" | ||
} | ||
|
||
termux_step_make_install() { | ||
install -Dm700 lit "${TERMUX_PREFIX}/bin/lit" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
TERMUX_PKG_HOMEPAGE=https://luvit.io | ||
TERMUX_PKG_DESCRIPTION="A project in-between luv and luvit." | ||
TERMUX_PKG_LICENSE="Apache-2.0" | ||
TERMUX_PKG_MAINTAINER="Komo @cattokomo" | ||
TERMUX_PKG_VERSION=20240216 | ||
_commit=b85da58f2549a519486a7296f5b836a8f6a64880 | ||
_version=2.14.0 | ||
TERMUX_PKG_GIT_BRANCH=master | ||
TERMUX_PKG_SRCURL=git+https://github.com/luvit/luvi.git | ||
TERMUX_PKG_DEPENDS="pcre, openssl, luv, lua51-lpeg, libluajit" | ||
TERMUX_PKG_SUGGESTS="lit, luvit" | ||
TERMUX_PKG_BUILD_IN_SRC=true | ||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" | ||
-DWithSharedLibluv=On | ||
-DWithOpenSSL=On | ||
-DWithSharedOpenSSL=On | ||
-DWithPCRE=On | ||
-DWithSharedPCRE=On | ||
-DWithLPEG=On | ||
" | ||
|
||
termux_step_post_get_source() { | ||
git checkout "${_commit}" | ||
} | ||
|
||
termux_step_pre_configure() { | ||
declare include=${TERMUX_PREFIX}/include lib=${TERMUX_PREFIX}/lib | ||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" | ||
-DLIBLUV_INCLUDE_DIR=${TERMUX_PKG_SRCDIR}/deps/luv/src | ||
-DLIBLUV_LIBRARIES=$lib/libluv.so | ||
-DLUAJIT_INCLUDE_DIR=$include/luajit-2.1 | ||
-DLUAJIT_LIBRARIES=$lib/libluajit.so | ||
-DLIBUV_INCLUDE_DIR=$include | ||
-DLIBUV_LIBRARIES=$lib/libuv.so | ||
-DOPENSSL_INCLUDE_DIR=$include | ||
-DOPENSSL_LIBRARIES=$lib | ||
-DPCRE_INCLUDE_DIR=$include | ||
-DPCRE_LIBRARIES=$lib | ||
" | ||
|
||
case "${TERMUX_ARCH}" in | ||
x86_64) TARGET_ARCH=x64 ;; | ||
i686) TARGET_ARCH=x86 ;; | ||
aarch64) TARGET_ARCH=arm64 ;; | ||
arm) TARGET_ARCH=arm ;; | ||
esac | ||
export TARGET_ARCH | ||
|
||
export LPEGLIB_DIR=deps/lpeg | ||
|
||
echo "$_version" >"${TERMUX_PKG_SRCDIR}/VERSION" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
diff --git a/deps/lua-openssl.cmake b/deps/lua-openssl.cmake | ||
index a3aa4a0..5bbd61d 100644 | ||
--- a/deps/lua-openssl.cmake | ||
+++ b/deps/lua-openssl.cmake | ||
@@ -24,47 +24,13 @@ else() | ||
add_definitions(-DPTHREADS) | ||
endif() | ||
|
||
+file(GLOB cfiles ${LUA_OPENSSL_DIR}/src/*.c) | ||
+file(GLOB hfiles ${LUA_OPENSSL_DIR}/src/*.h) | ||
+file(GLOB auxfiles ${LUA_OPENSSL_DIR}/deps/auxiliar/*.c) | ||
add_library(lua_openssl | ||
- ${LUA_OPENSSL_DIR}/deps/auxiliar/auxiliar.c | ||
- ${LUA_OPENSSL_DIR}/deps/auxiliar/subsidiar.c | ||
- ${LUA_OPENSSL_DIR}/src/asn1.c | ||
- ${LUA_OPENSSL_DIR}/src/bio.c | ||
- ${LUA_OPENSSL_DIR}/src/callback.c | ||
- ${LUA_OPENSSL_DIR}/src/cipher.c | ||
- ${LUA_OPENSSL_DIR}/src/cms.c | ||
- ${LUA_OPENSSL_DIR}/src/compat.c | ||
- ${LUA_OPENSSL_DIR}/src/crl.c | ||
- ${LUA_OPENSSL_DIR}/src/csr.c | ||
- ${LUA_OPENSSL_DIR}/src/dh.c | ||
- ${LUA_OPENSSL_DIR}/src/digest.c | ||
- ${LUA_OPENSSL_DIR}/src/dsa.c | ||
- ${LUA_OPENSSL_DIR}/src/ec.c | ||
- ${LUA_OPENSSL_DIR}/src/engine.c | ||
- ${LUA_OPENSSL_DIR}/src/hmac.c | ||
- ${LUA_OPENSSL_DIR}/src/kdf.c | ||
- ${LUA_OPENSSL_DIR}/src/lbn.c | ||
- ${LUA_OPENSSL_DIR}/src/lhash.c | ||
- ${LUA_OPENSSL_DIR}/src/misc.c | ||
- ${LUA_OPENSSL_DIR}/src/ocsp.c | ||
- ${LUA_OPENSSL_DIR}/src/oids.txt | ||
- ${LUA_OPENSSL_DIR}/src/openssl.c | ||
- ${LUA_OPENSSL_DIR}/src/ots.c | ||
- ${LUA_OPENSSL_DIR}/src/pkcs12.c | ||
- ${LUA_OPENSSL_DIR}/src/pkcs7.c | ||
- ${LUA_OPENSSL_DIR}/src/pkey.c | ||
- ${LUA_OPENSSL_DIR}/src/private.h | ||
- ${LUA_OPENSSL_DIR}/src/rsa.c | ||
- ${LUA_OPENSSL_DIR}/src/sk.h | ||
- ${LUA_OPENSSL_DIR}/src/srp.c | ||
- ${LUA_OPENSSL_DIR}/src/ssl.c | ||
- ${LUA_OPENSSL_DIR}/src/th-lock.c | ||
- ${LUA_OPENSSL_DIR}/src/util.c | ||
- ${LUA_OPENSSL_DIR}/src/x509.c | ||
- ${LUA_OPENSSL_DIR}/src/xattrs.c | ||
- ${LUA_OPENSSL_DIR}/src/xexts.c | ||
- ${LUA_OPENSSL_DIR}/src/xname.c | ||
- ${LUA_OPENSSL_DIR}/src/xalgor.c | ||
- ${LUA_OPENSSL_DIR}/src/xstore.c | ||
+ ${auxfiles} | ||
+ ${cfiles} | ||
+ ${hfiles} | ||
) | ||
|
||
set_target_properties(lua_openssl PROPERTIES COMPILE_FLAGS "-DLUA_LIB") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/cmake/Modules/LuaJITAddExecutable.cmake b/cmake/Modules/LuaJITAddExecutable.cmake | ||
index e250d08..22d53ae 100644 | ||
--- a/cmake/Modules/LuaJITAddExecutable.cmake | ||
+++ b/cmake/Modules/LuaJITAddExecutable.cmake | ||
@@ -24,7 +24,7 @@ MACRO(LUAJIT_add_custom_commands luajit_target) | ||
math(EXPR _stripped_file_length "${_luajit_file_length} - ${_luajit_source_dir_length} - 1") | ||
string(SUBSTRING ${file} ${_begin} ${_stripped_file_length} stripped_file) | ||
|
||
- set(generated_file "${CMAKE_BINARY_DIR}/jitted_tmp/${stripped_file}_${luajit_target}_generated${CMAKE_C_OUTPUT_EXTENSION}") | ||
+ set(generated_file "${CMAKE_BINARY_DIR}/jitted_tmp/${stripped_file}_${luajit_target}_generated.c") | ||
|
||
# Only use LUA_PATH if it's set | ||
IF(LUA_PATH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
TERMUX_PKG_HOMEPAGE=https://luvit.io | ||
TERMUX_PKG_DESCRIPTION="Asynchronous I/O for Lua" | ||
TERMUX_PKG_LICENSE="Apache-2.0" | ||
TERMUX_PKG_MAINTAINER="@termux" | ||
TERMUX_PKG_VERSION=2.18.1 | ||
TERMUX_PKG_SRCURL=https://github.com/luvit/luvit/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz | ||
TERMUX_PKG_SHA256=b792781d77028edb7e5761e96618c96162bd68747b8fced9a6fc52f123837c2c | ||
TERMUX_PKG_BUILD_DEPENDS="luvi" | ||
TERMUX_PKG_SUGGESTS="luvi, lit" | ||
TERMUX_PKG_BUILD_IN_SRC=true | ||
TERMUX_PKG_NO_STRIP=true | ||
|
||
termux_step_configure() { | ||
curl -Lo- https://github.com/luvit/lit/raw/"$( | ||
source "${TERMUX_SCRIPTDIR}/packages/lit/build.sh" | ||
echo "${TERMUX_PKG_VERSION}" | ||
)"/get-lit.sh | sh | ||
mv lit "${TERMUX_PKG_SRCDIR}/_lit" | ||
} | ||
|
||
termux_step_make() { | ||
./_lit make . ./luvit "${TERMUX_PREFIX}/bin/luvi" | ||
} | ||
|
||
termux_step_make_install() { | ||
install -Dm700 luvit "${TERMUX_PREFIX}/bin/luvit" | ||
} |