mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2026-01-03 01:20:21 +00:00
fix(main/onefetch): add termux_setup_cmake
It seems to be needed for build zlib wrapper of rust.
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
From d96e9957e5725bb67e8ba617cb8bfe087a271ae0 Mon Sep 17 00:00:00 2001
|
||||
From: ETKNeil <89385146+ETKNeil@users.noreply.github.com>
|
||||
Date: Tue, 20 Sep 2022 13:39:18 +0200
|
||||
Subject: [PATCH] Fix libc removing unsafe on makedev
|
||||
|
||||
---
|
||||
Cargo.toml | 6 +++---
|
||||
src/backend/libc/fs/makedev.rs | 6 +++---
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
# diff --git a/Cargo.toml b/Cargo.toml
|
||||
# index d9735cb8..dcde3702 100644
|
||||
# --- a/Cargo.toml
|
||||
# +++ b/Cargo.toml
|
||||
# @@ -40,7 +40,7 @@ once_cell = { version = "1.5.2", optional = true }
|
||||
# [target.'cfg(all(not(rustix_use_libc), not(miri), target_os = "linux", any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), all(target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))'.dependencies]
|
||||
# linux-raw-sys = { version = "0.0.46", default-features = false, features = ["general", "errno", "ioctl", "no_std"] }
|
||||
# libc_errno = { package = "errno", version = "0.2.8", default-features = false, optional = true }
|
||||
# -libc = { version = "0.2.126", features = ["extra_traits"], optional = true }
|
||||
# +libc = { version = "0.2.133", features = ["extra_traits"], optional = true }
|
||||
|
||||
# # Dependencies for platforms where only libc is supported:
|
||||
# #
|
||||
# @@ -48,7 +48,7 @@ libc = { version = "0.2.126", features = ["extra_traits"], optional = true }
|
||||
# # backend, so enable its dependencies unconditionally.
|
||||
# [target.'cfg(any(rustix_use_libc, miri, not(all(target_os = "linux", any(target_arch = "x86", all(target_arch = "x86_64", target_pointer_width = "64"), all(target_endian = "little", any(target_arch = "arm", all(target_arch = "aarch64", target_pointer_width = "64"), target_arch = "powerpc64", target_arch = "riscv64", target_arch = "mips", target_arch = "mips64")))))))'.dependencies]
|
||||
# libc_errno = { package = "errno", version = "0.2.8", default-features = false }
|
||||
# -libc = { version = "0.2.126", features = ["extra_traits"] }
|
||||
# +libc = { version = "0.2.133", features = ["extra_traits"] }
|
||||
|
||||
# # Additional dependencies for Linux with the libc backend:
|
||||
# #
|
||||
# @@ -69,7 +69,7 @@ features = [
|
||||
|
||||
# [dev-dependencies]
|
||||
# tempfile = "3.2.0"
|
||||
# -libc = "0.2.126"
|
||||
# +libc = "0.2.133"
|
||||
# libc_errno = { package = "errno", version = "0.2.8", default-features = false }
|
||||
# io-lifetimes = { version = "1.0.0-rc1", default-features = false }
|
||||
# # Don't upgrade to serial_test 0.7 for now because it depends on a
|
||||
diff --git a/src/backend/libc/fs/makedev.rs b/src/backend/libc/fs/makedev.rs
|
||||
index d9089e7f..08ecd872 100644
|
||||
--- a/src/backend/libc/fs/makedev.rs
|
||||
+++ b/src/backend/libc/fs/makedev.rs
|
||||
@@ -5,14 +5,14 @@ use crate::fs::Dev;
|
||||
#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
|
||||
#[inline]
|
||||
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
|
||||
- unsafe { c::makedev(maj, min) }
|
||||
+ c::makedev(maj, min)
|
||||
}
|
||||
|
||||
#[cfg(all(target_os = "android", not(target_pointer_width = "32")))]
|
||||
#[inline]
|
||||
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
|
||||
// Android's `makedev` oddly has signed argument types.
|
||||
- unsafe { c::makedev(maj as i32, min as i32) }
|
||||
+ c::makedev(maj, min)
|
||||
}
|
||||
|
||||
#[cfg(all(target_os = "android", target_pointer_width = "32"))]
|
||||
@@ -30,7 +30,7 @@ pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
|
||||
#[inline]
|
||||
pub(crate) fn makedev(maj: u32, min: u32) -> Dev {
|
||||
// Emscripten's `makedev` has a 32-bit return value.
|
||||
- Dev::from(unsafe { c::makedev(maj, min) })
|
||||
+ Dev::from(c::makedev(maj, min))
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_os = "android", target_os = "emscripten")))]
|
||||
11
packages/onefetch/0002-rust-git-config-path.diff
Normal file
11
packages/onefetch/0002-rust-git-config-path.diff
Normal file
@@ -0,0 +1,11 @@
|
||||
--- a/src/values/path.rs
|
||||
+++ b/src/values/path.rs
|
||||
@@ -170,7 +170,7 @@
|
||||
Err(interpolate::Error::UserInterpolationUnsupported)
|
||||
}
|
||||
|
||||
- #[cfg(not(windows))]
|
||||
+ #[cfg(not(any(target_os = "windows", target_os = "android")))]
|
||||
fn interpolate_user(
|
||||
self,
|
||||
home_for_user: fn(&str) -> Option<PathBuf>,
|
||||
@@ -2,12 +2,35 @@ TERMUX_PKG_HOMEPAGE=https://github.com/o2sh/onefetch
|
||||
TERMUX_PKG_DESCRIPTION="A command-line Git information tool written in Rust"
|
||||
TERMUX_PKG_LICENSE="MIT"
|
||||
TERMUX_PKG_MAINTAINER="@ELWAER-M"
|
||||
TERMUX_PKG_VERSION=2.12.0
|
||||
TERMUX_PKG_VERSION=2.13.1
|
||||
TERMUX_PKG_SRCURL=https://github.com/o2sh/onefetch/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=f57b16dfa2bb95dd1fb805257a1761baa20d69eb9ce7c311d369609894c53897
|
||||
TERMUX_PKG_SHA256=551b59102965e968e24c41de6bb6cb5c1f062d94ada6baac77a54c2ec412cb2f
|
||||
TERMUX_PKG_AUTO_UPDATE=true
|
||||
TERMUX_PKG_DEPENDS="libgit2"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
|
||||
termux_step_pre_configure() {
|
||||
termux_setup_rust
|
||||
termux_setup_cmake
|
||||
|
||||
export CFLAGS="${TARGET_CFLAGS}"
|
||||
|
||||
: "${CARGO_HOME:=$HOME/.cargo}"
|
||||
export CARGO_HOME
|
||||
|
||||
rm -rf "${CARGO_HOME}"/registry/src/github.com-*/git-config*
|
||||
rm -rf $CARGO_HOME/registry/src/github.com-*/rustix-*
|
||||
cargo fetch --target "${CARGO_TARGET_NAME}"
|
||||
|
||||
for d in $CARGO_HOME/registry/src/github.com-*/rustix-*; do
|
||||
patch --silent -p1 -d ${d} < $TERMUX_PKG_BUILDER_DIR/0001-upstream-fix-libc-removing-unsafe-on-makedev.diff || :
|
||||
done
|
||||
|
||||
for d in $CARGO_HOME/registry/src/github.com-*/git-config*; do
|
||||
patch --silent -p1 -d ${d} < $TERMUX_PKG_BUILDER_DIR/0002-rust-git-config-path.diff || :
|
||||
done
|
||||
}
|
||||
|
||||
termux_step_make() {
|
||||
termux_setup_rust
|
||||
cargo build \
|
||||
@@ -19,4 +42,3 @@ termux_step_make() {
|
||||
termux_step_make_install() {
|
||||
install -Dm700 target/"${CARGO_TARGET_NAME}"/release/onefetch "$TERMUX_PREFIX"/bin
|
||||
}
|
||||
TERMUX_PKG_AUTO_UPDATE=true
|
||||
|
||||
Reference in New Issue
Block a user