Update to 7.0.0

epel10
Benjamin A. Beasley 5 months ago
parent 24bece0978
commit 25fc46e397

1
.gitignore vendored

@ -5,3 +5,4 @@
/brotli-3.4.0.crate /brotli-3.4.0.crate
/brotli-3.5.0.crate /brotli-3.5.0.crate
/brotli-6.0.0.crate /brotli-6.0.0.crate
/brotli-7.0.0.crate

@ -1,71 +0,0 @@
From 64a98f1bdc2a37c4dd1f29ee6886ed5f4688439e Mon Sep 17 00:00:00 2001
From: Daniel Reiter Horn <danielrh@users.sourceforge.net>
Date: Wed, 2 Oct 2024 00:43:00 -0700
Subject: [PATCH] Fix 32 bit tests by allocating less memory by running with
less parallelism in that case
---
src/enc/test.rs | 33 ++++++++++++++++++++++++++++++++-
1 file changed, 32 insertions(+), 1 deletion(-)
diff --git a/src/enc/test.rs b/src/enc/test.rs
index 744472b..854d9b8 100755
--- a/src/enc/test.rs
+++ b/src/enc/test.rs
@@ -211,6 +211,34 @@ fn oneshot_compress(
(true, next_out_offset)
}
+static lock32: core::sync::atomic::AtomicU32 = core::sync::atomic::AtomicU32::new(0);
+
+/// 32bit systems do not have sufficient memory to compress multiple items
+/// at the same time with the current limits and defaults. So we instead spin
+/// until a process has completed compression. We cannot use proper locks
+/// in nostd, so we fall back to this simple spin lock.
+#[cfg(target_pointer_width = "32")]
+fn lock_if_32bit(){
+ use core::sync::atomic::Ordering;
+ loop {
+ let cur = lock32.fetch_add(1, Ordering::SeqCst);
+ if cur == 0 {
+ return;
+ }
+ lock32.fetch_sub(1, Ordering::SeqCst);
+ }
+}
+#[cfg(target_pointer_width = "32")]
+fn unlock_if_32bit(){
+ use core::sync::atomic::Ordering;
+ lock32.fetch_sub(1, Ordering::SeqCst);
+}
+#[cfg(not(target_pointer_width = "32"))]
+fn lock_if_32bit(){
+}
+#[cfg(not(target_pointer_width = "32"))]
+fn unlock_if_32bit(){
+}
fn oneshot_decompress(compressed: &[u8], output: &mut [u8]) -> (BrotliResult, usize, usize) {
let mut available_in: usize = compressed.len();
@@ -255,6 +283,7 @@ fn oneshot(
in_buffer_size: usize,
out_buffer_size: usize,
) -> (BrotliResult, usize, usize) {
+ lock_if_32bit();
let (success, mut available_in) = oneshot_compress(
input,
compressed,
@@ -268,7 +297,9 @@ fn oneshot(
//return (BrotliResult::ResultFailure, 0, 0);
available_in = compressed.len();
}
- oneshot_decompress(&mut compressed[..available_in], output)
+ let ret = oneshot_decompress(&mut compressed[..available_in], output);
+ unlock_if_32bit();
+ ret
}
#[test]
--
2.46.1

@ -0,0 +1,13 @@
From c14dfea3af98729663eb46577d00d283d90ef6d1 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Wed, 2 Oct 2024 07:10:40 -0400
Subject: [PATCH] Remove unwanted executable permission from src/enc/test.rs
---
src/enc/test.rs | 0
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100755 => 100644 src/enc/test.rs
diff --git a/src/enc/test.rs b/src/enc/test.rs
old mode 100755
new mode 100644

@ -1,32 +0,0 @@
diff --git a/LICENSE b/LICENSE.BSD-3-Clause
similarity index 100%
rename from LICENSE
rename to LICENSE.BSD-3-Clause
diff --git a/LICENSE.MIT b/LICENSE.MIT
new file mode 100644
index 0000000..33b7cdd
--- /dev/null
+++ b/LICENSE.MIT
@@ -0,0 +1,19 @@
+Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
--
2.46.1

@ -1,11 +1,8 @@
--- brotli-6.0.0/Cargo.toml 1970-01-01T00:00:01+00:00 --- brotli-7.0.0/Cargo.toml 1970-01-01T00:00:01+00:00
+++ brotli-6.0.0/Cargo.toml 2024-10-02T11:06:05.778047+00:00 +++ brotli-7.0.0/Cargo.toml 2024-10-02T11:16:18.293205+00:00
@@ -34,8 +34,17 @@ @@ -36,6 +36,15 @@
"compression",
"no-std",
] ]
-license = "BSD-3-Clause OR MIT" license = "BSD-3-Clause AND MIT"
+license = "BSD-3-Clause AND MIT"
repository = "https://github.com/dropbox/rust-brotli" repository = "https://github.com/dropbox/rust-brotli"
+exclude = [ +exclude = [
+ "/ci/", + "/ci/",

@ -8,7 +8,7 @@
%global crate brotli %global crate brotli
Name: rust-brotli Name: rust-brotli
Version: 6.0.0 Version: 7.0.0
Release: %autorelease Release: %autorelease
Summary: Brotli compressor and decompressor with no_std support Summary: Brotli compressor and decompressor with no_std support
@ -16,27 +16,11 @@ License: BSD-3-Clause AND MIT
URL: https://crates.io/crates/brotli URL: https://crates.io/crates/brotli
Source: %{crates_source} Source: %{crates_source}
# Manually created patch for downstream crate metadata changes # Manually created patch for downstream crate metadata changes
# * Adjust license from BSD-3-Clause/MIT to BSD-3-Clause AND MIT; see
# https://github.com/dropbox/rust-brotli/issues/41,
# https://github.com/dropbox/rust-brotli/pull/218 (which was merged upstream),
# and Patch10. See also the similar PR
# https://github.com/dropbox/rust-brotli-decompressor/pull/32, which was
# merged, but note comments in
# https://github.com/dropbox/rust-brotli/pull/218: we should be attentive to
# future improvements or corrections to the license texts.
# * Exclude files that are only useful for upstream development: # * Exclude files that are only useful for upstream development:
# https://github.com/dropbox/rust-brotli/pull/43 # https://github.com/dropbox/rust-brotli/pull/43
Patch: brotli-fix-metadata.diff Patch: brotli-fix-metadata.diff
# * Adjust license to reflect a MIT-only source, and add a MIT license file # * Remove unwanted executable permission from src/enc/test.rs
# (https://github.com/dropbox/rust-brotli/pull/218), without the changes to Patch10: https://github.com/dropbox/rust-brotli/pull/219.patch
# Cargo.toml (which are applied manually to the normalized Cargo.toml in the
# crate).
Patch10: brotli-6.0.0-license-accuracy.patch
# * Fix 32 bit tests by allocating less memory by running with less parallelism
# in that case:
# https://github.com/dropbox/rust-brotli/commit/0462558646c0d0c346f7e152377b33e9d9d507af
# (cherry-picked to 6.0.0)
Patch11: 0001-Fix-32-bit-tests-by-allocating-less-memory-by-runnin.patch
BuildRequires: cargo-rpm-macros >= 26 BuildRequires: cargo-rpm-macros >= 26
@ -89,6 +73,18 @@ use the "alloc-stdlib" feature of the "%{crate}" crate.
%files -n %{name}+alloc-stdlib-devel %files -n %{name}+alloc-stdlib-devel
%ghost %{crate_instdir}/Cargo.toml %ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+billing-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+billing-devel %{_description}
This package contains library source intended for building other packages which
use the "billing" feature of the "%{crate}" crate.
%files -n %{name}+billing-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+disable-timer-devel %package -n %{name}+disable-timer-devel
Summary: %{summary} Summary: %{summary}
BuildArch: noarch BuildArch: noarch
@ -101,6 +97,18 @@ use the "disable-timer" feature of the "%{crate}" crate.
%files -n %{name}+disable-timer-devel %files -n %{name}+disable-timer-devel
%ghost %{crate_instdir}/Cargo.toml %ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+disallow_large_window_size-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+disallow_large_window_size-devel %{_description}
This package contains library source intended for building other packages which
use the "disallow_large_window_size" feature of the "%{crate}" crate.
%files -n %{name}+disallow_large_window_size-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+external-literal-probability-devel %package -n %{name}+external-literal-probability-devel
Summary: %{summary} Summary: %{summary}
BuildArch: noarch BuildArch: noarch
@ -125,6 +133,42 @@ use the "ffi-api" feature of the "%{crate}" crate.
%files -n %{name}+ffi-api-devel %files -n %{name}+ffi-api-devel
%ghost %{crate_instdir}/Cargo.toml %ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+float64-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+float64-devel %{_description}
This package contains library source intended for building other packages which
use the "float64" feature of the "%{crate}" crate.
%files -n %{name}+float64-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+floating_point_context_mixing-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+floating_point_context_mixing-devel %{_description}
This package contains library source intended for building other packages which
use the "floating_point_context_mixing" feature of the "%{crate}" crate.
%files -n %{name}+floating_point_context_mixing-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+no-stdlib-ffi-binding-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+no-stdlib-ffi-binding-devel %{_description}
This package contains library source intended for building other packages which
use the "no-stdlib-ffi-binding" feature of the "%{crate}" crate.
%files -n %{name}+no-stdlib-ffi-binding-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+pass-through-ffi-panics-devel %package -n %{name}+pass-through-ffi-panics-devel
Summary: %{summary} Summary: %{summary}
BuildArch: noarch BuildArch: noarch
@ -211,9 +255,6 @@ use the "vector_scratch_space" feature of the "%{crate}" crate.
%prep %prep
%autosetup -n %{crate}-%{version} -p1 %autosetup -n %{crate}-%{version} -p1
# Remove executable flag from .rs files
# https://github.com/dropbox/rust-brotli/pull/181
find -type f -name '*.rs' -executable -exec chmod -x '{}' +
%cargo_prep %cargo_prep
%generate_buildrequires %generate_buildrequires

@ -1,16 +1,6 @@
[package] [package]
summary = "Brotli compressor and decompressor with no_std support" summary = "Brotli compressor and decompressor with no_std support"
cargo-toml-patch-comments = [ cargo-toml-patch-comments = [
"""\
Adjust license from BSD-3-Clause/MIT to BSD-3-Clause AND MIT; see \
https://github.com/dropbox/rust-brotli/issues/41, \
https://github.com/dropbox/rust-brotli/pull/218 (which was merged \
upstream), and Patch10. See also the similar PR
https://github.com/dropbox/rust-brotli-decompressor/pull/32, which was
merged, but note comments in https://github.com/dropbox/rust-brotli/pull/218: \
we should be attentive to future improvements or corrections to the license \
texts.\
""",
"""\ """\
Exclude files that are only useful for upstream development: \ Exclude files that are only useful for upstream development: \
https://github.com/dropbox/rust-brotli/pull/43\ https://github.com/dropbox/rust-brotli/pull/43\
@ -29,32 +19,9 @@ hide = [
"benchmark", "benchmark",
] ]
[scripts.prep]
pre = [
"# Remove executable flag from .rs files",
"# https://github.com/dropbox/rust-brotli/pull/181",
"find -type f -name '*.rs' -executable -exec chmod -x '{}' +",
]
[[package.extra-patches]] [[package.extra-patches]]
number = 10 number = 10
file = "brotli-6.0.0-license-accuracy.patch" file = "https://github.com/dropbox/rust-brotli/pull/219.patch"
comments = [ comments = [
"""\ "Remove unwanted executable permission from src/enc/test.rs",
Adjust license to reflect a MIT-only source, and add a MIT license file \
(https://github.com/dropbox/rust-brotli/pull/218), without the \
changes to Cargo.toml (which are applied manually to the normalized \
Cargo.toml in the crate).\
"""
]
[[package.extra-patches]]
number = 11
file = "0001-Fix-32-bit-tests-by-allocating-less-memory-by-runnin.patch"
comments = [
"""\
Fix 32 bit tests by allocating less memory by running with less parallelism
in that case: \
https://github.com/dropbox/rust-brotli/commit/0462558646c0d0c346f7e152377b33e9d9d507af \
(cherry-picked to 6.0.0)\
"""
] ]

@ -1 +1 @@
SHA512 (brotli-6.0.0.crate) = 6d53d3ab653aa3545f0da397796efa1110d445ab8f46456c7501f84ce1c48c99235ae05857f6e91b138521158268691b3a97524f2d3622d69986837dcb64c19d SHA512 (brotli-7.0.0.crate) = 577b2efc324bf461e06af94b8b509a095a917d4ecb2bfd2f3097ab4663ad699317c2fdb0b470344c762589c75dfac073b828603ce5609295ddf1748a39b75622

Loading…
Cancel
Save