From 159cd28ab75097d3aa434a107770a53e4432956e Mon Sep 17 00:00:00 2001 From: Komo Date: Sun, 24 Nov 2024 23:39:59 +0800 Subject: [PATCH] bump,enable(main/librusty-v8): 130.0.1 --- disabled-packages/deno/build.sh | 61 ------------------- .../deno/cli-tools-upgrade.rs.patch | 23 ------- .../deno/ext-ffi-Cargo.toml.patch | 11 ---- .../deno/runtime-ops-signal.rs.patch | 11 ---- disabled-packages/librusty-v8/build.sh | 45 -------------- packages/librusty-v8/BUILD.gn.patch | 19 ++++++ packages/librusty-v8/build.sh | 51 ++++++++++++++++ 7 files changed, 70 insertions(+), 151 deletions(-) delete mode 100644 disabled-packages/deno/build.sh delete mode 100644 disabled-packages/deno/cli-tools-upgrade.rs.patch delete mode 100644 disabled-packages/deno/ext-ffi-Cargo.toml.patch delete mode 100644 disabled-packages/deno/runtime-ops-signal.rs.patch delete mode 100644 disabled-packages/librusty-v8/build.sh create mode 100644 packages/librusty-v8/BUILD.gn.patch create mode 100644 packages/librusty-v8/build.sh diff --git a/disabled-packages/deno/build.sh b/disabled-packages/deno/build.sh deleted file mode 100644 index 406c113570db1fc..000000000000000 --- a/disabled-packages/deno/build.sh +++ /dev/null @@ -1,61 +0,0 @@ -TERMUX_PKG_HOMEPAGE=https://deno.land/ -TERMUX_PKG_DESCRIPTION="A modern runtime for JavaScript and TypeScript" -TERMUX_PKG_LICENSE="MIT" -TERMUX_PKG_MAINTAINER="@termux" -_COMMIT=1259a3f48c00e95a8bb0964e4dabfa769a20bcde -_COMMIT_DATE=2022.01.19 -TERMUX_PKG_VERSION=1.17.3p${_COMMIT_DATE//./} -TERMUX_PKG_REVISION=2 -TERMUX_PKG_SRCURL=git+https://github.com/denoland/deno -TERMUX_PKG_GIT_BRANCH=main -TERMUX_PKG_DEPENDS="libffi" -#TERMUX_PKG_BUILD_DEPENDS="librusty-v8" -TERMUX_PKG_BUILD_IN_SRC=true - -# Due to dependency on librusty-v8. -TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686, x86_64" - -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 -} - -termux_step_pre_configure() { - termux_setup_rust - - 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_PKG_MAKE_PROCESSES \ - --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 - $cmd -} - -termux_step_make_install() { - install -Dm700 -t $TERMUX_PREFIX/bin target/${CARGO_TARGET_NAME}/$BUILD_TYPE/deno -} diff --git a/disabled-packages/deno/cli-tools-upgrade.rs.patch b/disabled-packages/deno/cli-tools-upgrade.rs.patch deleted file mode 100644 index 9a0a28c22559f64..000000000000000 --- a/disabled-packages/deno/cli-tools-upgrade.rs.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- ./cli/tools/upgrade.rs.orig 2022-01-20 19:18:16.459123964 +0530 -+++ ./cli/tools/upgrade.rs 2022-01-20 19:27:18.071118123 +0530 -@@ -22,6 +22,7 @@ - - const RELEASE_URL: &str = "https://github.com/denoland/deno/releases"; - -+#[cfg(not(target_os = "android"))] - pub async fn upgrade(upgrade_flags: UpgradeFlags) -> Result<(), AnyError> { - let mut client_builder = Client::builder(); - -@@ -135,6 +136,12 @@ - Ok(()) - } - -+#[cfg(target_os = "android")] -+pub async fn upgrade(upgrade_flags: UpgradeFlags) -> Result<(), AnyError> { -+ println!("You are currently using Deno packaged by the Termux repo. To upgrade Deno, wait for the packagers to update it. This is done to prevent you from breaking your installation."); -+ std::process::exit(1); -+} -+ - async fn get_latest_release_version( - client: &Client, - ) -> Result { diff --git a/disabled-packages/deno/ext-ffi-Cargo.toml.patch b/disabled-packages/deno/ext-ffi-Cargo.toml.patch deleted file mode 100644 index 2416aecafa45ef0..000000000000000 --- a/disabled-packages/deno/ext-ffi-Cargo.toml.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/ext/ffi/Cargo.toml -+++ b/ext/ffi/Cargo.toml -@@ -16,7 +16,7 @@ - [dependencies] - deno_core = { version = "0.114.0", path = "../../core" } - dlopen = "0.1.8" --libffi = "2.0.0" -+libffi = { version = "2.0.0", features = ["system"] } - serde = { version = "1.0.129", features = ["derive"] } - tokio = { version = "1.10.1", features = ["full"] } - diff --git a/disabled-packages/deno/runtime-ops-signal.rs.patch b/disabled-packages/deno/runtime-ops-signal.rs.patch deleted file mode 100644 index fc1067939366e8d..000000000000000 --- a/disabled-packages/deno/runtime-ops-signal.rs.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/runtime/ops/signal.rs -+++ b/runtime/ops/signal.rs -@@ -97,7 +97,7 @@ - } - } - --#[cfg(target_os = "linux")] -+#[cfg(any(target_os = "linux", target_os = "android"))] - pub fn signal_str_to_int(s: &str) -> Result { - match s { - "SIGHUP" => Ok(1), diff --git a/disabled-packages/librusty-v8/build.sh b/disabled-packages/librusty-v8/build.sh deleted file mode 100644 index 092eda86200f0b5..000000000000000 --- a/disabled-packages/librusty-v8/build.sh +++ /dev/null @@ -1,45 +0,0 @@ -TERMUX_PKG_HOMEPAGE=https://github.com/denoland/rusty_v8 -TERMUX_PKG_DESCRIPTION="High quality Rust bindings to V8's C++ API" -TERMUX_PKG_LICENSE="MIT" -TERMUX_PKG_MAINTAINER="@termux" -_COMMIT=8b90dfd2f4fcbbaefd2c4d2be220d94a00a3ebba -TERMUX_PKG_VERSION=2022.02.02 -TERMUX_PKG_SRCURL=git+https://github.com/denoland/rusty_v8 -TERMUX_PKG_GIT_BRANCH=main -TERMUX_PKG_BUILD_IN_SRC=true -TERMUX_PKG_NO_STATICSPLIT=true -TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686, x86_64" - -termux_step_post_get_source() { - git fetch --unshallow || true - git checkout $_COMMIT - - local version="$(git log -1 --format=%cs | sed 's/-/./g')" - if [ "$version" != "$TERMUX_PKG_VERSION" ]; then - echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\"" - echo " is different from what is expected to be: \"$version\"" - return 1 - fi - - git submodule update --init --recursive -} - -termux_step_pre_configure() { - export V8_FROM_SOURCE=1 - export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig -} - -termux_step_make() { - termux_setup_rust - cargo build --jobs $TERMUX_PKG_MAKE_PROCESSES --target $CARGO_TARGET_NAME --release -} - -termux_step_make_install() { - install -Dm600 -t $TERMUX_PREFIX/lib \ - target/$CARGO_TARGET_NAME/release/gn_out/obj/librusty_v8.a -} - -termux_step_post_make_install() { - unset V8_FROM_SOURCE - unset PKG_CONFIG_PATH -} diff --git a/packages/librusty-v8/BUILD.gn.patch b/packages/librusty-v8/BUILD.gn.patch new file mode 100644 index 000000000000000..d50a6c6c5758fc2 --- /dev/null +++ b/packages/librusty-v8/BUILD.gn.patch @@ -0,0 +1,19 @@ +diff --git a/BUILD.gn b/BUILD.gn +index 3de64b8..b3a0dd3 100644 +--- a/BUILD.gn ++++ b/BUILD.gn +@@ -47,4 +47,14 @@ config("rusty_v8_config") { + "-fansi-escape-codes", + ] + } ++ ++ cflags_c = [] ++ foreach(flag, string_split(getenv("CFLAGS"))) { ++ cflags_c += [ flag ] ++ } ++ ++ cflags_cc = [] ++ foreach(flag, string_split(getenv("CXXFLAGS"))) { ++ cflags_cc += [ flag ] ++ } + } diff --git a/packages/librusty-v8/build.sh b/packages/librusty-v8/build.sh new file mode 100644 index 000000000000000..832fdd5b817cb6b --- /dev/null +++ b/packages/librusty-v8/build.sh @@ -0,0 +1,51 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/denoland/rusty_v8 +TERMUX_PKG_DESCRIPTION="High quality Rust bindings to V8's C++ API" +TERMUX_PKG_LICENSE="MIT" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=130.0.1 +TERMUX_PKG_SRCURL=git+https://github.com/denoland/rusty_v8 +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_NO_STATICSPLIT=true + +# to reduce compilation time +_SCCACHE_VERSION=0.8.2 +_SCACCHE_SHA256=ecda4ddc89a49f1ec6f35bdce5ecbf6f205b399a680d11119d4ce9f6d962104e + +termux_step_configure() { + termux_setup_rust + termux_setup_ninja + termux_setup_gn + + GN="$(command -v gn)" + export GN + + mkdir -p "${TERMUX_PKG_CACHEDIR}/sccache" + termux_download \ + "https://github.com/mozilla/sccache/releases/download/v${_SCCACHE_VERSION}/sccache-v${_SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" \ + "${TERMUX_PKG_CACHEDIR}/sccache.tar.gz" \ + "${_SCACCHE_SHA256}" + tar -zxf "${TERMUX_PKG_CACHEDIR}/sccache.tar.gz" --strip-components=1 -C "${TERMUX_PKG_CACHEDIR}/sccache" + export SCCACHE="${TERMUX_PKG_CACHEDIR}/sccache/sccache" +} + +termux_step_make() { + export CLANG_BASE_PATH="${TERMUX_STANDALONE_TOOLCHAIN}/sysroot/usr" + # workaround for cargo to detect and use CI's clang/clang++ + ln -s "${TERMUX_STANDALONE_TOOLCHAIN}/bin" "${CLANG_BASE_PATH}/bin" + + export CARGO_CFG_TARGET_OS=android + case ${TERMUX_ARCH} in + i686) CARGO_CFG_TARGET_ARCH=x86 ;; + *) CARGO_CFG_TARGET_ARCH=${TERMUX_ARCH} ;; + esac + export CARGO_CFG_TARGET_ARCH + + export TARGET="${TERMUX_HOST_PLATFORM}" + + export V8_FROM_SOURCE=1 + cargo build -vv --jobs "${TERMUX_PKG_MAKE_PROCESSES}" --target "${CARGO_TARGET_NAME}" --release +} + +termux_step_make_install() { + install -Dm600 -t "${TERMUX_PREFIX}/lib" "target/${CARGO_TARGET_NAME}/release/gn_out/obj/librusty_v8.a" +}