diff --git a/x11-packages/alacritty/0001-disable-clipboard.patch b/x11-packages/alacritty/0001-disable-clipboard.patch deleted file mode 100644 index 1364bfb5d7ef95..00000000000000 --- a/x11-packages/alacritty/0001-disable-clipboard.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/alacritty/src/clipboard.rs b/alacritty/src/clipboard.rs -index 7853de47..5bdfc81b 100644 ---- a/alacritty/src/clipboard.rs -+++ b/alacritty/src/clipboard.rs -@@ -4,11 +4,11 @@ use winit::raw_window_handle::RawDisplayHandle; - use alacritty_terminal::term::ClipboardType; - - use copypasta::nop_clipboard::NopClipboardContext; --#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] -+#[cfg(all(feature = "wayland", not(any(target_os = "android", target_os = "macos", windows))))] - use copypasta::wayland_clipboard; --#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] -+#[cfg(all(feature = "x11", not(any(target_os = "android", target_os = "macos", windows))))] - use copypasta::x11_clipboard::{Primary as X11SelectionClipboard, X11ClipboardContext}; --#[cfg(any(feature = "x11", target_os = "macos", windows))] -+#[cfg(any(feature = "x11", target_os = "android", target_os = "macos", windows))] - use copypasta::ClipboardContext; - use copypasta::ClipboardProvider; - -@@ -20,7 +20,7 @@ pub struct Clipboard { - impl Clipboard { - pub unsafe fn new(display: RawDisplayHandle) -> Self { - match display { -- #[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))] -+ #[cfg(all(feature = "wayland", not(any(target_os = "android", target_os = "macos", windows))))] - RawDisplayHandle::Wayland(display) => { - let (selection, clipboard) = - wayland_clipboard::create_clipboards_from_external(display.display.as_ptr()); -@@ -39,16 +39,16 @@ impl Clipboard { - - impl Default for Clipboard { - fn default() -> Self { -- #[cfg(any(target_os = "macos", windows))] -+ #[cfg(any(target_os = "android", target_os = "macos", windows))] - return Self { clipboard: Box::new(ClipboardContext::new().unwrap()), selection: None }; - -- #[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))] -+ #[cfg(all(feature = "x11", not(any(target_os = "android", target_os = "macos", windows))))] - return Self { - clipboard: Box::new(ClipboardContext::new().unwrap()), - selection: Some(Box::new(X11ClipboardContext::::new().unwrap())), - }; - -- #[cfg(not(any(feature = "x11", target_os = "macos", windows)))] -+ #[cfg(not(any(feature = "x11", target_os = "android", target_os = "macos", windows)))] - return Self::new_nop(); - } - } diff --git a/x11-packages/alacritty/build.sh b/x11-packages/alacritty/build.sh index 1b78aab1c73345..8c6a6e5af24432 100644 --- a/x11-packages/alacritty/build.sh +++ b/x11-packages/alacritty/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="A fast, cross-platform, OpenGL terminal emulator" TERMUX_PKG_LICENSE="Apache-2.0, MIT" TERMUX_PKG_MAINTAINER="Joshua Kahn @TomJo2000" TERMUX_PKG_VERSION="0.15.1" -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/alacritty/alacritty/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=b814e30c6271ae23158c66e0e2377c3600bb24041fa382a36e81be564eeb2e36 TERMUX_PKG_DEPENDS="fontconfig, freetype, libxi, libxcursor, libxrandr" @@ -11,90 +11,70 @@ TERMUX_PKG_BUILD_DEPENDS="libxcb, libxkbcommon, ncurses" TERMUX_PKG_BUILD_IN_SRC=true TERMUX_PKG_AUTO_UPDATE=true -__cargo_fetch_dep_source_for_rust_windowing() { - local _name="$1" - local _version - _version=$(cargo metadata --format-version=1 --no-deps | jq -r ".packages[0].dependencies[] | select(.name==\"$_name\") | .req") - _version="${_version/^/}" - local _url="https://github.com/rust-windowing/$_name/archive/refs/tags/v$_version.tar.gz" - local _path="$TERMUX_PKG_CACHEDIR/$_name-v$_version.tar.gz" - termux_download "$_url" "$_path" SKIP_CHECKSUM - tar xf "$_path" -C "$TERMUX_PKG_SRCDIR" - mv "$_name-$_version" "$_name-source" -} - -termux_step_pre_configure() { +termux_step_configure() { termux_setup_cmake termux_setup_rust + cargo clean + cargo vendor - : "${CARGO_HOME:=$HOME/.cargo}" - export CARGO_HOME - - __cargo_fetch_dep_source_for_rust_windowing "winit" - __cargo_fetch_dep_source_for_rust_windowing "glutin" - - patch="$TERMUX_PKG_BUILDER_DIR/patch-root-Cargo.diff" - patch -p1 -d "$TERMUX_PKG_SRCDIR" < "$patch" - - cat "$TERMUX_PKG_BUILDER_DIR"/winit-*.diff | patch -p1 -d "$TERMUX_PKG_SRCDIR/winit-source" - cat "$TERMUX_PKG_BUILDER_DIR"/glutin-*.diff | patch -p1 -d "$TERMUX_PKG_SRCDIR/glutin-source" - - cargo update + for dir in ./vendor/rustix*; do + if [[ -d "$dir/src/backend/libc/shm" && -d "$dir/src/backend/linux_raw/shm" ]]; then + rm -rf "$dir/src/backend/libc/shm/"* + cp "$dir/src/backend/linux_raw/shm/"* "$dir/src/backend/libc/shm/" + fi + done - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/expat-sys-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/freetype-sys-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/rustix-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/servo-fontconfig-sys-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/x11rb-protocol-* - cargo fetch --target "${CARGO_TARGET_NAME}" + if grep -q '^\[patch\.crates-io\]' Cargo.toml; then + sed -i '/^\[patch.crates-io\]/,$d' Cargo.toml + fi - local crate - for crate in {{expat,freetype,servo-fontconfig}-sys,rustix,x11rb-protocol}; do - local patch="$TERMUX_PKG_BUILDER_DIR/${crate}.diff" - local dir - for dir in "$CARGO_HOME"/registry/src/index.crates.io-*/"${crate}"-*; do - local _crate_name - _crate_name=$(basename "$dir") - # shellcheck disable=SC2295 - if [[ ! "${_crate_name#$crate-}" =~ ^[0-9] ]]; then - continue - fi - if [[ "$crate" == 'rustix' ]]; then - rm -rf "$dir"/src/backend/libc/shm/* - cp "$dir"/src/backend/linux_raw/shm/* "$dir"/src/backend/libc/shm/ - fi - echo "Applying patch for '$crate'" - patch -p1 -d "$dir" < "${patch}" - done + local patch_lines="" patch_file crate dir + for patch_file in "$TERMUX_PKG_BUILDER_DIR"/*.vendor.diff; do + [[ -e "$patch_file" ]] || break + crate="$(basename "$patch_file" .vendor.diff)" + dir="./vendor/$crate" + if [[ ! -d "$dir" ]]; then + echo "No vendor dir for $crate" + exit 1 + fi + sed "s|@TERMUX_PREFIX@|${TERMUX_PREFIX}|g" "$patch_file" | \ + patch --fuzz=0 -p1 -d "$dir" + patch_lines="${patch_lines}${crate} = { path = \"$dir\" }\n" done + + if [[ -n "$patch_lines" ]]; then + printf "\n[patch.crates-io]\n$patch_lines" >> Cargo.toml + fi } termux_step_make() { - cargo build --jobs "$TERMUX_PKG_MAKE_PROCESSES" --target "$CARGO_TARGET_NAME" --release + cargo build \ + --jobs "$TERMUX_PKG_MAKE_PROCESSES" \ + --target "$CARGO_TARGET_NAME" \ + --release } termux_step_make_install() { - install -Dm755 -t "$TERMUX_PREFIX/bin" "target/$CARGO_TARGET_NAME/release/alacritty" - - # man pages - scdoc < extra/man/alacritty.1.scd | gzip -c > "$TERMUX_PREFIX/share/man/man1/alacritty.1.gz" - scdoc < extra/man/alacritty-msg.1.scd | gzip -c > "$TERMUX_PREFIX/share/man/man1/alacritty-msg.1.gz" - scdoc < extra/man/alacritty.5.scd | gzip -c > "$TERMUX_PREFIX/share/man/man5/alacritty.5.gz" - scdoc < extra/man/alacritty-bindings.5.scd | gzip -c > "$TERMUX_PREFIX/share/man/man5/alacritty-bindings.5.gz" + install -Dm755 -t "$TERMUX_PREFIX/bin" \ + "target/$CARGO_TARGET_NAME/release/alacritty" - # shell completions - install -Dm644 extra/completions/_alacritty "$TERMUX_PREFIX/share/zsh/site-functions/_alacritty" - install -Dm644 extra/completions/alacritty.bash "$TERMUX_PREFIX/share/bash-completion/completions/alacritty.bash" - install -Dm644 extra/completions/alacritty.fish "$TERMUX_PREFIX/share/fish/vendor_completions.d/alacritty.fish" - - # .desktop - install -Dm644 extra/linux/Alacritty.desktop "$TERMUX_PREFIX/share/applications/Alacritty.desktop" -} + scdoc < extra/man/alacritty.1.scd | gzip -c \ + > "$TERMUX_PREFIX/share/man/man1/alacritty.1.gz" + scdoc < extra/man/alacritty-msg.1.scd | gzip -c \ + > "$TERMUX_PREFIX/share/man/man1/alacritty-msg.1.gz" + scdoc < extra/man/alacritty.5.scd | gzip -c \ + > "$TERMUX_PREFIX/share/man/man5/alacritty.5.gz" + scdoc < extra/man/alacritty-bindings.5.scd | gzip -c \ + > "$TERMUX_PREFIX/share/man/man5/alacritty-bindings.5.gz" -termux_step_post_massage() { - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/expat-sys-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/freetype-sys-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/rustix-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/servo-fontconfig-sys-* - rm -rf "$CARGO_HOME"/registry/src/index.crates.io-*/x11rb-protocol-* + install -Dm644 extra/completions/_alacritty \ + "$TERMUX_PREFIX/share/zsh/site-functions/_alacritty" + install -Dm644 extra/completions/alacritty.bash \ + "$TERMUX_PREFIX/share/bash-completion/completions/alacritty.bash" + install -Dm644 extra/completions/alacritty.fish \ + "$TERMUX_PREFIX/share/fish/vendor_completions.d/alacritty.fish" + install -Dm644 extra/linux/Alacritty.desktop \ + "$TERMUX_PREFIX/share/applications/Alacritty.desktop" + install -Dm644 extra/logo/alacritty-term.svg \ + "$TERMUX_PREFIX/share/icons/hicolor/scalable/apps/Alacritty.svg" } diff --git a/x11-packages/alacritty/copypasta.vendor.diff b/x11-packages/alacritty/copypasta.vendor.diff new file mode 100644 index 00000000000000..fd48d8cba1bf66 --- /dev/null +++ b/x11-packages/alacritty/copypasta.vendor.diff @@ -0,0 +1,62 @@ +diff --git b/src/lib.rs.orig a/src/lib.rs +index 092a23c5..e4495354 100644 +--- b/src/lib.rs.orig ++++ a/src/lib.rs +@@ -20,7 +20,6 @@ pub use crate::common::ClipboardProvider; + unix, + not(any( + target_os = "macos", +- target_os = "android", + target_os = "ios", + target_os = "emscripten" + )) +@@ -31,7 +30,6 @@ pub mod wayland_clipboard; + unix, + not(any( + target_os = "macos", +- target_os = "android", + target_os = "ios", + target_os = "emscripten" + )) +@@ -51,7 +49,6 @@ pub mod nop_clipboard; + unix, + not(any( + target_os = "macos", +- target_os = "android", + target_os = "ios", + target_os = "emscripten" + )) +@@ -62,15 +59,12 @@ pub type ClipboardContext = x11_clipboard::X11ClipboardContext; + pub type ClipboardContext = windows_clipboard::WindowsClipboardContext; + #[cfg(target_os = "macos")] + pub type ClipboardContext = osx_clipboard::OSXClipboardContext; +-#[cfg(target_os = "android")] +-pub type ClipboardContext = nop_clipboard::NopClipboardContext; // TODO: implement AndroidClipboardContext + #[cfg(target_os = "ios")] + pub type ClipboardContext = nop_clipboard::NopClipboardContext; // TODO: implement IOSClipboardContext + #[cfg(not(any( + unix, + windows, + target_os = "macos", +- target_os = "android", + target_os = "ios", + target_os = "emscripten" + )))] +diff --git b/Cargo.toml.orig a/Cargo.toml +index 77d8d97bf1..e28dac9817 100644 +--- b/Cargo.toml.orig ++++ a/Cargo.toml +@@ -31,11 +31,11 @@ default = [ + wayland = ["smithay-clipboard"] + x11 = ["x11-clipboard"] + +-[target."cfg(all(unix, not(any(target_os=\"macos\", target_os=\"android\", target_os=\"ios\", target_os=\"emscripten\"))))".dependencies.smithay-clipboard] ++[target."cfg(all(unix, not(any(target_os=\"macos\", target_os=\"dummy\", target_os=\"ios\", target_os=\"emscripten\"))))".dependencies.smithay-clipboard] + version = "0.7.0" + optional = true + +-[target."cfg(all(unix, not(any(target_os=\"macos\", target_os=\"android\", target_os=\"ios\", target_os=\"emscripten\"))))".dependencies.x11-clipboard] ++[target."cfg(all(unix, not(any(target_os=\"macos\", target_os=\"dummy\", target_os=\"ios\", target_os=\"emscripten\"))))".dependencies.x11-clipboard] + version = "0.9.1" + optional = true + diff --git a/x11-packages/alacritty/expat-sys.diff b/x11-packages/alacritty/expat-sys.diff deleted file mode 100644 index 7387f3425a9916..00000000000000 --- a/x11-packages/alacritty/expat-sys.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- a/build.rs -+++ b/build.rs -@@ -9,7 +9,7 @@ use std::env; - - fn main() { - let target = env::var("TARGET").unwrap(); -- if !target.contains("android") -+ if true - && pkg_config::Config::new() - .atleast_version("2.1.0") - .find("expat") diff --git a/x11-packages/alacritty/freetype-sys.diff b/x11-packages/alacritty/freetype-sys.vendor.diff similarity index 100% rename from x11-packages/alacritty/freetype-sys.diff rename to x11-packages/alacritty/freetype-sys.vendor.diff diff --git a/x11-packages/alacritty/glutin-treat-android-as-linux.diff b/x11-packages/alacritty/glutin-treat-android-as-linux.diff deleted file mode 100644 index c282033ff9180d..00000000000000 --- a/x11-packages/alacritty/glutin-treat-android-as-linux.diff +++ /dev/null @@ -1,76 +0,0 @@ -diff --git a/glutin-winit/build.rs b/glutin-winit/build.rs -index 32078de..bc32b33 100644 ---- a/glutin-winit/build.rs -+++ b/glutin-winit/build.rs -@@ -6,7 +6,7 @@ fn main() { - // Setup alias to reduce `cfg` boilerplate. - cfg_aliases! { - // Systems. -- android_platform: { target_os = "android" }, -+ android_platform: { target_os = "dummy" }, - wasm_platform: { target_family = "wasm" }, - macos_platform: { target_os = "macos" }, - ios_platform: { target_os = "ios" }, -diff --git a/glutin/Cargo.toml b/glutin/Cargo.toml -index 9f1306d..be1989c 100644 ---- a/glutin/Cargo.toml -+++ b/glutin/Cargo.toml -@@ -40,10 +40,10 @@ features = [ - ] - optional = true - --[target.'cfg(target_os = "android")'.dependencies] -+[target.'cfg(target_os = "dummy")'.dependencies] - glutin_egl_sys = { version = "0.7.1", path = "../glutin_egl_sys" } - --[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies] -+[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies] - glutin_egl_sys = { version = "0.7.1", path = "../glutin_egl_sys", optional = true } - glutin_glx_sys = { version = "0.6.1", path = "../glutin_glx_sys", optional = true } - wayland-sys = { version = "0.31.1", default-features = false, features = ["egl", "client", "dlopen"], optional = true } -diff --git a/glutin/build.rs b/glutin/build.rs -index b5f3435..10809d4 100644 ---- a/glutin/build.rs -+++ b/glutin/build.rs -@@ -4,7 +4,7 @@ fn main() { - // Setup alias to reduce `cfg` boilerplate. - cfg_aliases! { - // Systems. -- android_platform: { target_os = "android" }, -+ android_platform: { target_os = "dummy" }, - ohos_platform: { target_env = "ohos" }, - wasm_platform: { target_family = "wasm" }, - macos_platform: { target_os = "macos" }, -diff --git a/glutin_glx_sys/Cargo.toml b/glutin_glx_sys/Cargo.toml -index 2514dcb..d8c7c8d 100644 ---- a/glutin_glx_sys/Cargo.toml -+++ b/glutin_glx_sys/Cargo.toml -@@ -12,5 +12,5 @@ edition = "2021" - [build-dependencies] - gl_generator = "0.14" - --[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os="dragonfly", target_os="netbsd", target_os="openbsd"))'.dependencies] -+[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os="dragonfly", target_os="netbsd", target_os="openbsd"))'.dependencies] - x11-dl = "2.18.3" -diff --git a/glutin_glx_sys/build.rs b/glutin_glx_sys/build.rs -index c9ce54b..47b7ad2 100644 ---- a/glutin_glx_sys/build.rs -+++ b/glutin_glx_sys/build.rs -@@ -10,6 +10,7 @@ fn main() { - println!("cargo:rerun-if-changed=build.rs"); - - if target.contains("linux") -+ || target.contains("android") - || target.contains("dragonfly") - || target.contains("freebsd") - || target.contains("netbsd") -diff --git a/glutin_glx_sys/src/lib.rs b/glutin_glx_sys/src/lib.rs -index 48c4b25..5a80c3f 100644 ---- a/glutin_glx_sys/src/lib.rs -+++ b/glutin_glx_sys/src/lib.rs -@@ -1,4 +1,5 @@ - #![cfg(any( -+ target_os = "android", - target_os = "linux", - target_os = "dragonfly", - target_os = "freebsd", diff --git a/x11-packages/alacritty/glutin.vendor.diff b/x11-packages/alacritty/glutin.vendor.diff new file mode 100644 index 00000000000000..81572aa4904c63 --- /dev/null +++ b/x11-packages/alacritty/glutin.vendor.diff @@ -0,0 +1,54 @@ +diff --git a/glutin/build.rs b/glutin/build.rs +index b5f3435..10809d4 100644 +--- a/build.rs ++++ b/build.rs +@@ -4,7 +4,7 @@ fn main() { + // Setup alias to reduce `cfg` boilerplate. + cfg_aliases! { + // Systems. +- android_platform: { target_os = "android" }, ++ android_platform: { target_os = "dummy" }, + ohos_platform: { target_env = "ohos" }, + wasm_platform: { target_family = "wasm" }, + macos_platform: { target_os = "macos" }, +diff --git a/Cargo.toml.orig b/Cargo.toml +index 196cfd68fe..1ae35e27ad 100644 +--- a/Cargo.toml.orig ++++ b/Cargo.toml +@@ -94,15 +94,15 @@ wgl = [ + ] + x11 = ["x11-dl"] + +-[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.glutin_egl_sys] ++[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.glutin_egl_sys] + version = "0.7.1" + optional = true + +-[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.glutin_glx_sys] ++[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.glutin_glx_sys] + version = "0.6.1" + optional = true + +-[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.wayland-sys] ++[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.wayland-sys] + version = "0.31.1" + features = [ + "egl", +@@ -112,7 +112,7 @@ features = [ + optional = true + default-features = false + +-[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.x11-dl] ++[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))'.dependencies.x11-dl] + version = "2.20.0" + optional = true + +@@ -147,7 +147,7 @@ features = [ + "NSThread", + ] + +-[target.'cfg(target_os = "android")'.dependencies.glutin_egl_sys] ++[target.'cfg(target_os = "dummy")'.dependencies.glutin_egl_sys] + version = "0.7.1" + + [target."cfg(windows)".dependencies.glutin_egl_sys] diff --git a/x11-packages/alacritty/glutin_glx_sys.vendor.diff b/x11-packages/alacritty/glutin_glx_sys.vendor.diff new file mode 100644 index 00000000000000..1a18830cbff71f --- /dev/null +++ b/x11-packages/alacritty/glutin_glx_sys.vendor.diff @@ -0,0 +1,32 @@ +diff --git a/glutin_glx_sys/build.rs b/glutin_glx_sys/build.rs +index c9ce54b..47b7ad2 100644 +--- a/build.rs ++++ b/build.rs +@@ -10,6 +10,7 @@ fn main() { + println!("cargo:rerun-if-changed=build.rs"); + + if target.contains("linux") ++ || target.contains("android") + || target.contains("dragonfly") + || target.contains("freebsd") + || target.contains("netbsd") +diff --git a/glutin_glx_sys/src/lib.rs b/glutin_glx_sys/src/lib.rs +index 48c4b25..5a80c3f 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -1,4 +1,5 @@ + #![cfg(any( ++ target_os = "android", + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", +diff --git a/glutin_glx_sys/Cargo.toml b/glutin_glx_sys/Cargo.toml +--- a/Cargo.toml 2025-07-03 00:40:38.209739251 +0200 ++++ b/Cargo.toml 2025-07-03 00:41:20.535386026 +0200 +@@ -33,5 +33,5 @@ + [build-dependencies.gl_generator] + version = "0.14" + +-[target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os="dragonfly", target_os="netbsd", target_os="openbsd"))'.dependencies.x11-dl] ++[target.'cfg(any(target_os = "android", target_os = "linux", target_os = "freebsd", target_os="dragonfly", target_os="netbsd", target_os="openbsd"))'.dependencies.x11-dl] + version = "2.18.3" diff --git a/x11-packages/alacritty/patch-root-Cargo.diff b/x11-packages/alacritty/patch-root-Cargo.diff deleted file mode 100644 index 931fd5cf7ff5b3..00000000000000 --- a/x11-packages/alacritty/patch-root-Cargo.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -11,3 +11,7 @@ - lto = "thin" - debug = 1 - incremental = false -+ -+[patch.crates-io] -+winit = { path = "./winit-source" } -+glutin = { path = "./glutin-source/glutin" } diff --git a/x11-packages/alacritty/rustix.diff b/x11-packages/alacritty/rustix.vendor.diff similarity index 100% rename from x11-packages/alacritty/rustix.diff rename to x11-packages/alacritty/rustix.vendor.diff diff --git a/x11-packages/alacritty/servo-fontconfig-sys.diff b/x11-packages/alacritty/servo-fontconfig-sys.diff deleted file mode 100644 index a9f80b52a64d6d..00000000000000 --- a/x11-packages/alacritty/servo-fontconfig-sys.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- a/build.rs -+++ b/build.rs -@@ -10,7 +10,7 @@ use std::process::Command; - fn main() { - let target = env::var("TARGET").unwrap(); - -- if !target.contains("android") { -+ if true { - // If the system version of fontconfig is at least 2.11.1, use it. - #[allow(clippy::single_match)] - match pkg_config::Config::new() diff --git a/x11-packages/alacritty/winit-treat-android-as-linux.diff b/x11-packages/alacritty/winit-treat-android-as-linux.diff deleted file mode 100644 index 7e4b21cf58ab45..00000000000000 --- a/x11-packages/alacritty/winit-treat-android-as-linux.diff +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/Cargo.toml b/Cargo.toml -index 4bdbc736..7ba90b92 100644 ---- a/Cargo.toml -+++ b/Cargo.toml -@@ -94,7 +94,7 @@ tracing = { version = "0.1.40", default-features = false, features = ["log"] } - tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } - winit = { path = ".", features = ["rwh_05"] } - --[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dev-dependencies] -+[target.'cfg(not(any(target_os = "ios")))'.dev-dependencies] - softbuffer = { version = "0.4.0", default-features = false, features = [ - "x11", - "x11-dlopen", -@@ -102,7 +102,7 @@ softbuffer = { version = "0.4.0", default-features = false, features = [ - "wayland-dlopen", - ] } - --[target.'cfg(target_os = "android")'.dependencies] -+[target.'cfg(target_os = "dummy")'.dependencies] - android-activity = "0.6.0" - ndk = { version = "0.9.0", default-features = false } - -@@ -236,7 +236,7 @@ features = [ - "Win32_UI_WindowsAndMessaging", - ] - --[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies] -+[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies] - ahash = { version = "0.8.7", features = ["no-rng"], optional = true } - bytemuck = { version = "1.13.1", default-features = false, optional = true } - calloop = "0.13.0" -diff --git a/build.rs b/build.rs -index 6a4528b3..8cb34cc1 100644 ---- a/build.rs -+++ b/build.rs -@@ -7,7 +7,7 @@ fn main() { - // Setup cfg aliases. - cfg_aliases! { - // Systems. -- android_platform: { target_os = "android" }, -+ android_platform: { target_os = "dummy" }, - web_platform: { all(target_family = "wasm", target_os = "unknown") }, - macos_platform: { target_os = "macos" }, - ios_platform: { target_os = "ios" }, -diff --git a/src/platform_impl/linux/mod.rs b/src/platform_impl/linux/mod.rs -index 6cb99fee..bc1c507b 100644 ---- a/src/platform_impl/linux/mod.rs -+++ b/src/platform_impl/linux/mod.rs -@@ -1013,7 +1013,7 @@ fn min_timeout(a: Option, b: Option) -> Option { - a.map_or(b, |a_timeout| b.map_or(Some(a_timeout), |b_timeout| Some(a_timeout.min(b_timeout)))) - } - --#[cfg(target_os = "linux")] -+#[cfg(any(target_os = "android", target_os = "linux"))] - fn is_main_thread() -> bool { - rustix::thread::gettid() == rustix::process::getpid() - } diff --git a/x11-packages/alacritty/winit.vendor.diff b/x11-packages/alacritty/winit.vendor.diff new file mode 100644 index 00000000000000..02917b3aaf2d54 --- /dev/null +++ b/x11-packages/alacritty/winit.vendor.diff @@ -0,0 +1,195 @@ +diff --git a/build.rs b/build.rs +index 6a4528b3..8cb34cc1 100644 +--- a/build.rs ++++ b/build.rs +@@ -7,7 +7,7 @@ fn main() { + // Setup cfg aliases. + cfg_aliases! { + // Systems. +- android_platform: { target_os = "android" }, ++ android_platform: { target_os = "dummy" }, + web_platform: { all(target_family = "wasm", target_os = "unknown") }, + macos_platform: { target_os = "macos" }, + ios_platform: { target_os = "ios" }, +diff --git a/src/platform_impl/linux/mod.rs b/src/platform_impl/linux/mod.rs +index 6cb99fee..bc1c507b 100644 +--- a/src/platform_impl/linux/mod.rs ++++ b/src/platform_impl/linux/mod.rs +@@ -1013,7 +1013,7 @@ fn min_timeout(a: Option, b: Option) -> Option { + a.map_or(b, |a_timeout| b.map_or(Some(a_timeout), |b_timeout| Some(a_timeout.min(b_timeout)))) + } + +-#[cfg(target_os = "linux")] ++#[cfg(any(target_os = "android", target_os = "linux"))] + fn is_main_thread() -> bool { + rustix::thread::gettid() == rustix::process::getpid() + } +diff --git a/Cargo.toml.orig b/Cargo.toml +index 843e290afb..8f54e28297 100644 +--- a/Cargo.toml.orig ++++ b/Cargo.toml +@@ -50,7 +50,6 @@ features = [ + "rwh_06", + "serde", + "mint", +- "android-native-activity", + ] + rustdoc-args = [ + "--cfg", +@@ -164,27 +163,18 @@ features = ["env-filter"] + version = "0.2.1" + + [features] +-android-game-activity = ["android-activity/game-activity"] +-android-native-activity = ["android-activity/native-activity"] + default = [ +- "rwh_06", + "x11", +- "wayland", +- "wayland-dlopen", +- "wayland-csd-adwaita", + ] + mint = ["dpi/mint"] + rwh_04 = [ + "dep:rwh_04", +- "ndk/rwh_04", + ] + rwh_05 = [ + "dep:rwh_05", +- "ndk/rwh_05", + ] + rwh_06 = [ + "dep:rwh_06", +- "ndk/rwh_06", + ] + serde = [ + "dep:serde", +@@ -226,31 +216,31 @@ version = "1" + version = "2" + default-features = false + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.ahash] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.ahash] + version = "0.8.7" + features = ["no-rng"] + optional = true + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.bytemuck] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.bytemuck] + version = "1.13.1" + optional = true + default-features = false + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.calloop] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.calloop] + version = "0.13.0" + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.libc] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.libc] + version = "0.2.64" + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.memmap2] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.memmap2] + version = "0.9.0" + optional = true + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.percent-encoding] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.percent-encoding] + version = "2.0" + optional = true + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.rustix] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.rustix] + version = "0.38.4" + features = [ + "std", +@@ -260,43 +250,43 @@ features = [ + ] + default-features = false + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.sctk] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.sctk] + version = "0.19.2" + features = ["calloop"] + optional = true + default-features = false + package = "smithay-client-toolkit" + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.sctk-adwaita] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.sctk-adwaita] + version = "0.10.1" + optional = true + default-features = false + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-backend] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-backend] + version = "0.3.5" + features = ["client_system"] + optional = true + default-features = false + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-client] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-client] + version = "0.31.4" + optional = true + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-protocols] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-protocols] + version = "0.32.2" + features = ["staging"] + optional = true + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-protocols-plasma] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.wayland-protocols-plasma] + version = "0.3.2" + features = ["client"] + optional = true + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.x11-dl] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.x11-dl] + version = "2.19.1" + optional = true + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.x11rb] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.x11rb] + version = "0.13.0" + features = [ + "allow-unsafe-code", +@@ -309,7 +299,7 @@ features = [ + optional = true + default-features = false + +-[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "android", target_os = "ios", target_os = "macos"))))'.dependencies.xkbcommon-dl] ++[target.'cfg(all(unix, not(any(target_os = "redox", target_family = "wasm", target_os = "ios", target_os = "macos"))))'.dependencies.xkbcommon-dl] + version = "0.4.2" + + [target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies.core-foundation] +@@ -318,13 +308,11 @@ version = "0.9.3" + [target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies.objc2] + version = "0.5.2" + +-[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dev-dependencies.softbuffer] ++[target.'cfg(not(any(target_os = "ios")))'.dev-dependencies.softbuffer] + version = "0.4.0" + features = [ + "x11", + "x11-dlopen", +- "wayland", +- "wayland-dlopen", + ] + default-features = false + +@@ -404,13 +392,6 @@ version = "0.1" + [target.'cfg(target_family = "wasm")'.dev-dependencies.tracing-web] + version = "0.1" + +-[target.'cfg(target_os = "android")'.dependencies.android-activity] +-version = "0.6.0" +- +-[target.'cfg(target_os = "android")'.dependencies.ndk] +-version = "0.9.0" +-default-features = false +- + [target.'cfg(target_os = "ios")'.dependencies.objc2-foundation] + version = "0.2.2" + features = [ diff --git a/x11-packages/alacritty/x11rb-protocol.diff b/x11-packages/alacritty/x11rb-protocol.vendor.diff similarity index 51% rename from x11-packages/alacritty/x11rb-protocol.diff rename to x11-packages/alacritty/x11rb-protocol.vendor.diff index 6053f3953f2aa2..e1ff9beb0cb8db 100644 --- a/x11-packages/alacritty/x11rb-protocol.diff +++ b/x11-packages/alacritty/x11rb-protocol.vendor.diff @@ -8,3 +8,17 @@ + let file_name = format!("@TERMUX_PREFIX@/tmp/.X11-unix/X{}", display); targets.push(ConnectAddress::Socket(file_name)); } + +diff --git b/lib.rs.orig a/lib.rs +index c653bc5bd2..c885551099 100644 +--- b/src/lib.rs.orig ++++ a/src/lib.rs +@@ -45,8 +45,6 @@ + #![deny( + // Contains unreachable_code and "?" generates an #[allow] for this + unused, +- // #[derive] generates an #[allow] for this; not part of "unused" +- unused_qualifications, + // serde's Deserialize/Serialize impls add allows for this + rust_2018_idioms, + // Not everything in x11rb_protocol::protocol has doc comments