upgpkg(main/gitoxide): 0.31.1

This commit is contained in:
termux-pacman-bot
2023-12-07 07:01:22 +00:00
parent 2f3244afa7
commit 06eec1976a
2 changed files with 47 additions and 17 deletions

View File

@@ -0,0 +1,41 @@
+++ ./build.rs
@@ -1,4 +1,6 @@
use std::process::Command;
+use std::env;
+use glob::glob;
fn main() {
let version = Command::new(if cfg!(windows) { "git.exe" } else { "git" })
@@ -8,6 +10,21 @@
.and_then(|out| parse_describe(&out.stdout))
.unwrap_or_else(|| env!("CARGO_PKG_VERSION").into());
+ // builtins for android-x86_64
+ let target = env::var("TARGET").unwrap();
+ if target == "x86_64-linux-android" {
+ let ndk_home = env::var("ANDROID_NDK_HOME").expect("ANDROID_NDK_HOME not set");
+ let link_search_glob = format!("{}/toolchains/llvm/prebuilt/linux-x86_64/**/clang/**/lib/linux", ndk_home);
+ // there will be different version so just pick first, there likely shouldn't be multiple anyways
+ let link_search_path = glob(&link_search_glob)
+ .expect("failed to read link_search_glob")
+ .next()
+ .expect("failed to find link_search_path")
+ .expect("link_search_path glob result failed");
+ println!("cargo:rustc-link-lib=static=clang_rt.builtins-x86_64-android");
+ println!("cargo:rustc-link-search={}", link_search_path.display());
+ }
+
println!("cargo:rustc-env=GITOXIDE_VERSION={version}");
}
+++ ./Cargo.toml
@@ -160,6 +160,9 @@
+[build-dependencies]
+glob = "0.3.1"
+
[dependencies]
anyhow = "1.0.42"
gitoxide-core = { version = "^0.33.1", path = "gitoxide-core" }

View File

@@ -3,27 +3,14 @@ TERMUX_PKG_DESCRIPTION="Rust implementation of Git"
TERMUX_PKG_LICENSE="Apache-2.0, MIT"
TERMUX_PKG_LICENSE_FILE="LICENSE-APACHE, LICENSE-MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.1.0
TERMUX_PKG_REVISION=1
_RELEASE_PREFIX="git-hashtable"
TERMUX_PKG_SRCURL=https://github.com/Byron/gitoxide/archive/refs/tags/${_RELEASE_PREFIX}-v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=33f761b9e6bb268a2ad725bf88e85808e4a9c7e06cface2fd637ac14dc2382fc
TERMUX_PKG_VERSION="0.31.1"
TERMUX_PKG_SRCURL=https://github.com/Byron/gitoxide/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=639c366d3767f5391e055a985de0ac9142fd56f76a1920bacd920b25dabc3b64
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_UPDATE_VERSION_REGEXP="\d+\.\d+\.\d+"
TERMUX_PKG_DEPENDS="resolv-conf"
TERMUX_PKG_BUILD_IN_SRC=true
termux_pkg_auto_update() {
# Get latest release tag:
local tag
tag="$(termux_github_api_get_tag "${TERMUX_PKG_SRCURL}")"
# check if this is not a ${_RELEASE_PREFIX} release:
if grep -qP "^${_RELEASE_PREFIX}-v${TERMUX_PKG_UPDATE_VERSION_REGEXP}\$" <<<"$tag"; then
termux_pkg_upgrade_version "$tag"
else
echo "WARNING: Skipping auto-update: Not a ${_RELEASE_PREFIX} release($tag)"
fi
}
TERMUX_RUST_VERSION=1.73.0
termux_step_pre_configure() {
termux_setup_cmake
@@ -31,6 +18,8 @@ termux_step_pre_configure() {
: "${CARGO_HOME:=$HOME/.cargo}"
export CARGO_HOME
export ANDROID_NDK_HOME=$NDK
echo ANDROID_NDK_HOME=$ANDROID_NDK_HOME
cargo fetch --target "${CARGO_TARGET_NAME}"