-
-
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.
- Loading branch information
Showing
11 changed files
with
170 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml | ||
index 2f0813a58..fda6e2469 100644 | ||
--- a/ext/ffi/Cargo.toml | ||
+++ b/ext/ffi/Cargo.toml | ||
@@ -18,7 +18,7 @@ deno_core.workspace = true | ||
deno_permissions.workspace = true | ||
dlopen2.workspace = true | ||
dynasmrt = "1.2.3" | ||
-libffi = "=3.2.0" | ||
+libffi = { version = "=3.2.0", features = ["system"] } | ||
libffi-sys = "=2.3.0" | ||
log.workspace = true | ||
num-bigint.workspace = true |
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,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), |
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/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); | ||
} |
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/Cargo.toml b/Cargo.toml | ||
index 987c291fc..d60b7c431 100644 | ||
--- a/Cargo.toml | ||
+++ b/Cargo.toml | ||
@@ -143,7 +143,7 @@ ipnet = "2.3" | ||
jsonc-parser = { version = "=0.26.2", features = ["serde"] } | ||
lazy-regex = "3" | ||
libc = "0.2.126" | ||
-libz-sys = { version = "1.1.20", default-features = false } | ||
+libz-sys = "1.1.20" | ||
log = { version = "0.4.20", features = ["kv"] } | ||
lsp-types = "=0.97.0" # used by tower-lsp and "proposed" feature is unstable in patch releases | ||
memmem = "0.1.1" |
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,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", |
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,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" |
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,29 @@ | ||
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.1 | ||
TERMUX_PKG_SRCURL=git+https://github.com/denoland/deno | ||
TERMUX_PKG_DEPENDS="libffi, libsqlite, glib, zlib" | ||
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 | ||
} | ||
|
||
termux_step_make() { | ||
export RUSTY_V8_ARCHIVE="${TERMUX_PREFIX}/lib/librusty_v8.a" | ||
export RUSTY_V8_SRC_BINDING_PATH="${TERMUX_PREFIX}/include/librusty_v8/src_binding.rs" | ||
|
||
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" | ||
} |