Skip to content

Commit

Permalink
enable,bump(main/deno): 2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mbekkomo committed Dec 3, 2024
1 parent 36aeea0 commit 7a1cf18
Show file tree
Hide file tree
Showing 13 changed files with 236 additions and 107 deletions.
61 changes: 0 additions & 61 deletions disabled-packages/deno/build.sh

This file was deleted.

23 changes: 0 additions & 23 deletions disabled-packages/deno/cli-tools-upgrade.rs.patch

This file was deleted.

11 changes: 0 additions & 11 deletions disabled-packages/deno/ext-ffi-Cargo.toml.patch

This file was deleted.

11 changes: 0 additions & 11 deletions disabled-packages/deno/runtime-ops-signal.rs.patch

This file was deleted.

20 changes: 20 additions & 0 deletions packages/deno/0001-fix-runtime-errors.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/runtime/errors.rs b/runtime/errors.rs
index 4268fbd50..d09aec325 100644
--- a/runtime/errors.rs
+++ b/runtime/errors.rs
@@ -299,6 +299,7 @@ fn get_webgpu_byow_error_class(
deno_webgpu::byow::ByowError::CreateSurface(_) => "Error",
deno_webgpu::byow::ByowError::InvalidSystem => "TypeError",
#[cfg(any(
+ target_os = "android",
target_os = "windows",
target_os = "linux",
target_os = "freebsd",
@@ -306,6 +307,7 @@ fn get_webgpu_byow_error_class(
))]
deno_webgpu::byow::ByowError::NullWindow => "TypeError",
#[cfg(any(
+ target_os = "android",
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd"
29 changes: 29 additions & 0 deletions packages/deno/0002-disable-upgrading-via-cli.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/cli/tools/upgrade.rs b/cli/tools/upgrade.rs
index cb85859f7..891ebb0e2 100644
--- a/cli/tools/upgrade.rs
+++ b/cli/tools/upgrade.rs
@@ -480,6 +480,7 @@ async fn fetch_and_store_latest_version<
env.write_check_file(&version_file.serialize());
}

+#[cfg(not(target_os = "android"))]
pub async fn upgrade(
flags: Arc<Flags>,
upgrade_flags: UpgradeFlags,
@@ -612,6 +613,16 @@ pub async fn upgrade(
Ok(())
}

+#[cfg(target_os = "android")]
+pub async fn upgrade(
+ flags: Arc<Flags>,
+ upgrade_flags: UpgradeFlags,
+) -> Result<(), AnyError> {
+ log::error!("You are currently using Deno packaged by the Termux repo. Upgrading Deno via CLI will cause an issue to installed Deno. Wait for an update on Deno package in the Termux repo to upgrade.");
+ deno_runtime::exit(1);
+}
+
+
#[derive(Debug, PartialEq)]
enum RequestedVersion {
Latest(ReleaseChannel),
13 changes: 13 additions & 0 deletions packages/deno/0003-fix-tmp-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/ext/node/polyfills/os.ts b/ext/node/polyfills/os.ts
index edc89ed2c..ae24b53a1 100644
--- a/ext/node/polyfills/os.ts
+++ b/ext/node/polyfills/os.ts
@@ -287,7 +287,7 @@ export function tmpdir(): string | null {
return temp;
} else { // !isWindows
let temp = Deno.env.get("TMPDIR") || Deno.env.get("TMP") ||
- Deno.env.get("TEMP") || "/tmp";
+ Deno.env.get("TEMP") || "@TERMUX_PREFIX@/tmp";
if (temp.length > 1 && StringPrototypeEndsWith(temp, "/")) {
temp = StringPrototypeSlice(temp, 0, -1);
}
53 changes: 53 additions & 0 deletions packages/deno/0004-fix-webgpu-compilation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
diff --git a/ext/webgpu/byow.rs b/ext/webgpu/byow.rs
index c9e1177b1..dee840119 100644
--- a/ext/webgpu/byow.rs
+++ b/ext/webgpu/byow.rs
@@ -5,6 +5,7 @@ use deno_core::OpState;
use deno_core::ResourceId;
use std::ffi::c_void;
#[cfg(any(
+ target_os = "android",
target_os = "linux",
target_os = "macos",
target_os = "freebsd",
@@ -29,6 +30,7 @@ pub enum ByowError {
#[error("Invalid system on macOS")]
InvalidSystem,
#[cfg(any(
+ target_os = "android",
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd"
@@ -36,6 +38,7 @@ pub enum ByowError {
#[error("Invalid system on Linux/BSD")]
InvalidSystem,
#[cfg(any(
+ target_os = "android",
target_os = "windows",
target_os = "linux",
target_os = "freebsd",
@@ -44,6 +47,7 @@ pub enum ByowError {
#[error("window is null")]
NullWindow,
#[cfg(any(
+ target_os = "android",
target_os = "linux",
target_os = "freebsd",
target_os = "openbsd"
@@ -150,7 +154,7 @@ fn raw_window(
Ok((win_handle, display_handle))
}

-#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
+#[cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os = "openbsd"))]
fn raw_window(
system: &str,
window: *const c_void,
@@ -188,6 +192,7 @@ fn raw_window(
}

#[cfg(not(any(
+ target_os = "android",
target_os = "macos",
target_os = "windows",
target_os = "linux",
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/Cargo.toml b/Cargo.toml
index 987c291fc..7e8cbda03 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -166,7 +166,7 @@ rand = "=0.8.5"
regex = "^1.7.0"
reqwest = { version = "=0.12.5", default-features = false, features = ["rustls-tls", "stream", "gzip", "brotli", "socks", "json", "http2"] } # pinned because of https://github.com/seanmonstar/reqwest/pull/1955
ring = "^0.17.0"
-rusqlite = { version = "0.32.0", features = ["unlock_notify", "bundled"] }
+rusqlite = { version = "0.32.0", features = ["unlock_notify"] }
rustls = { version = "0.23.11", default-features = false, features = ["logging", "std", "tls12", "ring"] }
rustls-pemfile = "2"
rustls-tokio-stream = "=0.3.0"
55 changes: 55 additions & 0 deletions packages/deno/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
TERMUX_PKG_HOMEPAGE=https://deno.land/
TERMUX_PKG_DESCRIPTION="A modern runtime for JavaScript and TypeScript"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.1.2
TERMUX_PKG_SRCURL=git+https://github.com/denoland/deno
TERMUX_PKG_DEPENDS="libsqlite, glib"
TERMUX_PKG_BUILD_DEPENDS="librusty-v8"
TERMUX_PKG_BUILD_IN_SRC=true

# See https://github.com/denoland/deno/issues/2295#issuecomment-2329248010
TERMUX_PKG_BLACKLISTED_ARCHES="i686, arm"

termux_step_configure() {
termux_setup_rust
termux_setup_cmake
termux_setup_protobuf

: "${CARGO_HOME:=$HOME/.cargo}"
export CARGO_HOME

cargo vendor
patch --silent -p1 \
-d ./vendor/v8/ \
< "$TERMUX_PKG_BUILDER_DIR"/rusty-v8-search-files-with-target-suffix.diff

patch --silent -p1 \
-d "$TERMUX_PKG_SRCDIR" \
< "$TERMUX_PKG_BUILDER_DIR"/patch-root-Cargo.diff
}

termux_step_make() {
local env_name=RUSTY_V8_ARCHIVE_${CARGO_TARGET_NAME@U}
env_name=${env_name//-/_}
export "$env_name"="${TERMUX_PREFIX}/lib/librusty_v8.a"
env_name=RUSTY_V8_SRC_BINDING_PATH_${CARGO_TARGET_NAME@U}
env_name=${env_name//-/_}
export "$env_name"="${TERMUX_PREFIX}/include/librusty_v8/src_binding.rs"

export DENO_SKIP_CROSS_BUILD_CHECK=1

# Workaround libz-sys trying to build zlib-ng with CMake
export TARGET_CMAKE_TOOLCHAIN_FILE="/dev/null"

# Workaround for C compiler used in aarch64 build
if [[ "${TERMUX_ARCH}" == "aarch64" ]]; then
export CFLAGS="--target=${TERMUX_HOST_PLATFORM} ${CFLAGS-}"
fi

cargo build --jobs "${TERMUX_PKG_MAKE_PROCESSES}" --target "${CARGO_TARGET_NAME}" --release
}

termux_step_make_install() {
install -Dm700 -t "${TERMUX_PREFIX}/bin" "target/${CARGO_TARGET_NAME}/release/deno"
}
9 changes: 9 additions & 0 deletions packages/deno/patch-root-Cargo.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -334,3 +334,6 @@
opt-level = 3
[profile.release.package.zstd-sys]
opt-level = 3
+
+[patch.crates-io]
+v8 = { path = "./vendor/v8" }
42 changes: 42 additions & 0 deletions packages/deno/rusty-v8-search-files-with-target-suffix.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
--- a/build.rs
+++ b/build.rs
@@ -55,6 +55,16 @@
println!("cargo:rerun-if-env-changed={}", env);
}

+ // Also rebuild for some vars with target suffix
+ let envs2 = vec![
+ "RUSTY_V8_ARCHIVE",
+ "RUSTY_V8_SRC_BINDING_PATH",
+ ];
+ for env in envs2 {
+ let target = env::var("TARGET").unwrap().replace("-", "_").to_uppercase();
+ println!("cargo:rerun-if-env-changed={}_{}", env, target);
+ }
+
// Detect if trybuild tests are being compiled.
let is_trybuild = env::var_os("DENO_TRYBUILD").is_some();

@@ -407,6 +417,10 @@
}

fn static_lib_url() -> String {
+ let target_u = env::var("TARGET").unwrap().replace("-", "_").to_uppercase();
+ if let Ok(custom_archive_u) = env::var(format!("RUSTY_V8_ARCHIVE_{}", target_u)) {
+ return custom_archive_u;
+ }
if let Ok(custom_archive) = env::var("RUSTY_V8_ARCHIVE") {
return custom_archive;
}
@@ -681,6 +695,11 @@
}

fn print_prebuilt_src_binding_path() {
+ let target_u = env::var("TARGET").unwrap().replace("-", "_").to_uppercase();
+ if let Ok(binding_u) = env::var(format!("RUSTY_V8_SRC_BINDING_PATH_{}", target_u)) {
+ println!("cargo:rustc-env=RUSTY_V8_SRC_BINDING_PATH={}", binding_u);
+ return;
+ }
if let Ok(binding) = env::var("RUSTY_V8_SRC_BINDING_PATH") {
println!("cargo:rustc-env=RUSTY_V8_SRC_BINDING_PATH={}", binding);
return;
3 changes: 2 additions & 1 deletion packages/libsqlite/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Library implementing a self-contained and transactional
TERMUX_PKG_LICENSE="Public Domain"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="3.47.1"
TERMUX_PKG_REVISION=1
_SQLITE_YEAR=2024
TERMUX_PKG_SRCURL=https://www.sqlite.org/${_SQLITE_YEAR}/sqlite-autoconf-$(sed 's/\./''/; s/\./0/' <<< "$TERMUX_PKG_VERSION")00.tar.gz
TERMUX_PKG_SHA256=416a6f45bf2cacd494b208fdee1beda509abda951d5f47bc4f2792126f01b452
Expand All @@ -17,7 +18,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
"

termux_step_pre_configure() {
CPPFLAGS+=" -Werror -DSQLITE_ENABLE_DBSTAT_VTAB=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1"
CPPFLAGS+=" -Werror -DSQLITE_ENABLE_DBSTAT_VTAB=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1"
LDFLAGS+=" -lm"
}

Expand Down

0 comments on commit 7a1cf18

Please sign in to comment.