termux-packages/packages/deno/build.sh

62 lines
1.7 KiB
Bash
Raw Normal View History

2022-01-15 11:46:40 +01:00
TERMUX_PKG_HOMEPAGE=https://deno.land/
TERMUX_PKG_DESCRIPTION="A modern runtime for JavaScript and TypeScript"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
2022-01-19 13:47:35 +01:00
_COMMIT=1259a3f48c00e95a8bb0964e4dabfa769a20bcde
_COMMIT_DATE=2022.01.19
TERMUX_PKG_VERSION=1.17.3p${_COMMIT_DATE//./}
TERMUX_PKG_REVISION=2
2022-01-15 11:46:40 +01:00
TERMUX_PKG_SRCURL=https://github.com/denoland/deno.git
2022-01-19 13:47:35 +01:00
TERMUX_PKG_GIT_BRANCH=main
2022-01-15 11:46:40 +01:00
TERMUX_PKG_DEPENDS="libffi"
2022-01-19 13:47:35 +01:00
#TERMUX_PKG_BUILD_DEPENDS="librusty-v8"
2022-01-15 11:46:40 +01:00
TERMUX_PKG_BUILD_IN_SRC=true
# Due to dependency on librusty-v8.
TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686, x86_64"
2022-01-19 13:47:35 +01:00
termux_step_post_get_source() {
git fetch --unshallow
git checkout $_COMMIT
local version="$(git log -1 --format=%cs | sed 's/-/./g')"
if [ "$version" != "$_COMMIT_DATE" ]; then
echo -n "ERROR: The specified commit date \"$_COMMIT_DATE\""
echo " is different from what is expected to be: \"$version\""
return 1
fi
git submodule update --init --recursive
}
2022-01-19 20:10:40 +01:00
termux_step_pre_configure() {
2022-01-15 11:46:40 +01:00
termux_setup_rust
2022-01-19 20:10:40 +01:00
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
2022-01-15 11:46:40 +01:00
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 \
2022-01-19 20:10:40 +01:00
--target $CARGO_TARGET_NAME"
if [ "$TERMUX_DEBUG_BUILD" = "false" ]; then
cmd+=" --release"
fi
2022-01-19 13:47:35 +01:00
#$cmd || :
#ln -sf $TERMUX_PREFIX/lib/librusty_v8.a \
# target/$CARGO_TARGET_NAME/release/gn_out/obj/librusty_v8.a
2022-01-15 11:46:40 +01:00
$cmd
}
termux_step_make_install() {
2022-01-19 20:10:40 +01:00
install -Dm700 -t $TERMUX_PREFIX/bin target/${CARGO_TARGET_NAME}/$BUILD_TYPE/deno
2022-01-15 11:46:40 +01:00
}