deno: add possibility of debug build

This commit is contained in:
Henrik Grimler 2022-01-19 20:10:40 +01:00
parent fb41212836
commit 7e040f0512
No known key found for this signature in database
GPG Key ID: B0076E490B71616B

View File

@ -5,6 +5,7 @@ TERMUX_PKG_MAINTAINER="@termux"
_COMMIT=1259a3f48c00e95a8bb0964e4dabfa769a20bcde
_COMMIT_DATE=2022.01.19
TERMUX_PKG_VERSION=1.17.3p${_COMMIT_DATE//./}
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/denoland/deno.git
TERMUX_PKG_GIT_BRANCH=main
TERMUX_PKG_DEPENDS="libffi"
@ -28,15 +29,27 @@ termux_step_post_get_source() {
git submodule update --init --recursive
}
termux_step_make() {
termux_step_pre_configure() {
termux_setup_rust
local libdir=target/$CARGO_TARGET_NAME/release/deps
if [ "$TERMUX_DEBUG_BUILD" = "true" ]; then
BUILD_TYPE=debug
else
BUILD_TYPE=release
fi
}
termux_step_make() {
local libdir=target/$CARGO_TARGET_NAME/$BUILD_TYPE/deps
mkdir -p $libdir
ln -sf $TERMUX_PREFIX/lib/libffi.so $libdir/
local libgcc="$($CC -print-libgcc-file-name)"
echo "INPUT($libgcc -l:libunwind.a)" > $libdir/libgcc.so
local cmd="cargo build --jobs $TERMUX_MAKE_PROCESSES \
--target $CARGO_TARGET_NAME --release"
--target $CARGO_TARGET_NAME"
if [ "$TERMUX_DEBUG_BUILD" = "false" ]; then
cmd+=" --release"
fi
#$cmd || :
#ln -sf $TERMUX_PREFIX/lib/librusty_v8.a \
# target/$CARGO_TARGET_NAME/release/gn_out/obj/librusty_v8.a
@ -44,5 +57,5 @@ termux_step_make() {
}
termux_step_make_install() {
install -Dm700 -t $TERMUX_PREFIX/bin target/${CARGO_TARGET_NAME}/release/deno
install -Dm700 -t $TERMUX_PREFIX/bin target/${CARGO_TARGET_NAME}/$BUILD_TYPE/deno
}