commit
f7fae1deba
@ -0,0 +1,41 @@
|
|||||||
|
From b2a2a074e167993e5ece5219db410be24eea5cef Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fabio Valentini <decathorpe@gmail.com>
|
||||||
|
Date: Mon, 29 May 2023 22:43:19 +0200
|
||||||
|
Subject: [PATCH] build with vendored libgit2 unconditionally
|
||||||
|
|
||||||
|
---
|
||||||
|
build.rs | 18 ------------------
|
||||||
|
1 file changed, 18 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/build.rs b/build.rs
|
||||||
|
index e888b94..a3ea132 100644
|
||||||
|
--- a/build.rs
|
||||||
|
+++ b/build.rs
|
||||||
|
@@ -10,24 +10,6 @@ fn main() {
|
||||||
|
let vendored = env::var("CARGO_FEATURE_VENDORED").is_ok();
|
||||||
|
let zlib_ng_compat = env::var("CARGO_FEATURE_ZLIB_NG_COMPAT").is_ok();
|
||||||
|
|
||||||
|
- // To use zlib-ng in zlib-compat mode, we have to build libgit2 ourselves.
|
||||||
|
- let try_to_use_system_libgit2 = !vendored && !zlib_ng_compat;
|
||||||
|
- if try_to_use_system_libgit2 {
|
||||||
|
- let mut cfg = pkg_config::Config::new();
|
||||||
|
- // These version ranges specifically request a version that includes
|
||||||
|
- // the SSH fixes for CVE-2023-22742 (1.5.1+ or 1.4.5+).
|
||||||
|
- if let Ok(lib) = cfg
|
||||||
|
- .range_version("1.5.1".."1.6.0")
|
||||||
|
- .probe("libgit2")
|
||||||
|
- .or_else(|_| cfg.range_version("1.4.5".."1.5.0").probe("libgit2"))
|
||||||
|
- {
|
||||||
|
- for include in &lib.include_paths {
|
||||||
|
- println!("cargo:root={}", include.display());
|
||||||
|
- }
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
println!("cargo:rustc-cfg=libgit2_vendored");
|
||||||
|
|
||||||
|
if !Path::new("libgit2/src").exists() {
|
||||||
|
--
|
||||||
|
2.40.1
|
||||||
|
|
Binary file not shown.
@ -0,0 +1,32 @@
|
|||||||
|
--- libgit2-sys-0.14.2+1.5.1/Cargo.toml 1970-01-01T00:00:01+00:00
|
||||||
|
+++ libgit2-sys-0.14.2+1.5.1/Cargo.toml 2023-05-29T20:38:44.883195+00:00
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
[package]
|
||||||
|
edition = "2018"
|
||||||
|
name = "libgit2-sys"
|
||||||
|
-version = "0.14.2+1.5.1"
|
||||||
|
+version = "0.14.2"
|
||||||
|
authors = [
|
||||||
|
"Josh Triplett <josh@joshtriplett.org>",
|
||||||
|
"Alex Crichton <alex@alexcrichton.com>",
|
||||||
|
@@ -27,7 +27,7 @@
|
||||||
|
"libgit2/tests/*",
|
||||||
|
]
|
||||||
|
description = "Native bindings to the libgit2 library"
|
||||||
|
-license = "MIT OR Apache-2.0"
|
||||||
|
+license = "(MIT OR Apache-2.0) AND BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0 AND MIT"
|
||||||
|
repository = "https://github.com/rust-lang/git2-rs"
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
@@ -58,11 +58,6 @@
|
||||||
|
ssh = ["libssh2-sys"]
|
||||||
|
ssh_key_from_memory = []
|
||||||
|
vendored = []
|
||||||
|
-vendored-openssl = ["openssl-sys/vendored"]
|
||||||
|
-zlib-ng-compat = [
|
||||||
|
- "libz-sys/zlib-ng",
|
||||||
|
- "libssh2-sys?/zlib-ng-compat",
|
||||||
|
-]
|
||||||
|
|
||||||
|
[target."cfg(unix)".dependencies.openssl-sys]
|
||||||
|
version = "0.9"
|
@ -0,0 +1,180 @@
|
|||||||
|
## START: Set by rpmautospec
|
||||||
|
## (rpmautospec version 0.3.5)
|
||||||
|
## RPMAUTOSPEC: autorelease, autochangelog
|
||||||
|
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
||||||
|
release_number = 1;
|
||||||
|
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
||||||
|
print(release_number + base_release_number - 1);
|
||||||
|
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
||||||
|
## END: Set by rpmautospec
|
||||||
|
|
||||||
|
# Generated by rust2rpm 24
|
||||||
|
%bcond_without check
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
|
%global crate libgit2-sys
|
||||||
|
%global upstream_version 0.14.2+1.5.1
|
||||||
|
|
||||||
|
Name: rust-libgit2-sys0.14
|
||||||
|
Version: 0.14.2
|
||||||
|
Release: %autorelease
|
||||||
|
Summary: Native bindings to the libgit2 library
|
||||||
|
|
||||||
|
# * libgit2-sys crate: MIT OR Apache-2.0
|
||||||
|
# * bundled libgit2: GPL-2.0-only WITH GCC-exception-2.0
|
||||||
|
# * bundled http-parser: MIT
|
||||||
|
# * bundled pcre: BSD-3-Clause
|
||||||
|
License: (MIT OR Apache-2.0) AND BSD-3-Clause AND GPL-2.0-only WITH GCC-exception-2.0 AND MIT
|
||||||
|
URL: https://crates.io/crates/libgit2-sys
|
||||||
|
Source: %{crates_source %{crate} %{upstream_version}}
|
||||||
|
# Manually created patch for downstream crate metadata changes
|
||||||
|
# * remove libgit2 version from version field
|
||||||
|
# * update package.license field to reflect bundled dependencies
|
||||||
|
Patch: libgit2-sys-fix-metadata.diff
|
||||||
|
# * build against the bundled copy of libgit2 unconditionally:
|
||||||
|
# the version in the Fedora repositories is always either too old or too new
|
||||||
|
Patch: 0001-build-with-vendored-libgit2-unconditionally.patch
|
||||||
|
|
||||||
|
BuildRequires: rust-packaging >= 21
|
||||||
|
|
||||||
|
%global _description %{expand:
|
||||||
|
Native bindings to the libgit2 library.}
|
||||||
|
|
||||||
|
%description %{_description}
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
Provides: bundled(libgit2) = 1.5.1
|
||||||
|
Provides: bundled(http-parser) = 2.0
|
||||||
|
Provides: bundled(pcre) = 8.44
|
||||||
|
|
||||||
|
%description devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%license %{crate_instdir}/LICENSE-APACHE
|
||||||
|
%license %{crate_instdir}/LICENSE-MIT
|
||||||
|
%license %{crate_instdir}/libgit2/COPYING
|
||||||
|
%license %{crate_instdir}/libgit2/deps/http-parser/COPYING
|
||||||
|
%license %{crate_instdir}/libgit2/deps/pcre/LICENCE
|
||||||
|
%{crate_instdir}/
|
||||||
|
|
||||||
|
%package -n %{name}+default-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+default-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "default" feature of the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+default-devel
|
||||||
|
%ghost %{crate_instdir}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+https-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+https-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "https" feature of the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+https-devel
|
||||||
|
%ghost %{crate_instdir}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+libssh2-sys-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+libssh2-sys-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "libssh2-sys" feature of the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+libssh2-sys-devel
|
||||||
|
%ghost %{crate_instdir}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+openssl-sys-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+openssl-sys-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "openssl-sys" feature of the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+openssl-sys-devel
|
||||||
|
%ghost %{crate_instdir}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+ssh-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+ssh-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "ssh" feature of the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+ssh-devel
|
||||||
|
%ghost %{crate_instdir}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+ssh_key_from_memory-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+ssh_key_from_memory-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "ssh_key_from_memory" feature of the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+ssh_key_from_memory-devel
|
||||||
|
%ghost %{crate_instdir}/Cargo.toml
|
||||||
|
|
||||||
|
%package -n %{name}+vendored-devel
|
||||||
|
Summary: %{summary}
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description -n %{name}+vendored-devel %{_description}
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages which
|
||||||
|
use the "vendored" feature of the "%{crate}" crate.
|
||||||
|
|
||||||
|
%files -n %{name}+vendored-devel
|
||||||
|
%ghost %{crate_instdir}/Cargo.toml
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{crate}-%{upstream_version} -p1
|
||||||
|
# remove upstream development scripts from libgit2
|
||||||
|
rm -r libgit2/script/
|
||||||
|
# remove unused bundled dependencies
|
||||||
|
rm -r libgit2/deps/chromium-zlib
|
||||||
|
rm -r libgit2/deps/ntlmclient
|
||||||
|
rm -r libgit2/deps/winhttp
|
||||||
|
rm -r libgit2/deps/zlib
|
||||||
|
%cargo_prep
|
||||||
|
|
||||||
|
%generate_buildrequires
|
||||||
|
%cargo_generate_buildrequires
|
||||||
|
|
||||||
|
%build
|
||||||
|
%cargo_build
|
||||||
|
|
||||||
|
%install
|
||||||
|
%cargo_install
|
||||||
|
|
||||||
|
%if %{with check}
|
||||||
|
%check
|
||||||
|
%cargo_test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Jan 15 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.14.2-1
|
||||||
|
- Rebuilt for MSVSphere 9.3
|
||||||
|
|
||||||
|
* Thu Jul 13 2023 Fabio Valentini <decathorpe@gmail.com> - 0.14.2-1
|
||||||
|
- Initial import (libgit2-sys 0.14 compat package)
|
Loading…
Reference in new issue