Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
398e683251 | ||
|
|
429d557e75 | ||
|
|
5288b1ba5f | ||
|
|
a5fcbe0b38 | ||
|
|
1d22c05693 |
3 changed files with 45 additions and 55 deletions
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (zstr-1.0.7.tar.gz) = 3017da244810a45f7111f76f8d0dd988e162f08eab28b7465cad4549d84200fc834975275daf9588d35c6125e6f167c1e2dd5ec18022dac1eceabdc24d24cffe
|
||||
SHA512 (zstr-1.1.0.tar.gz) = 21778d2b07c30da4fb9ee35832f39b02c95e54478c6610e28cece98908c51bcee6aed0754ec3948b71aa1e671a3d15ff2b555369379dc4583048c76d2b8305e8
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
--- zstr-1.0.7/CMakeLists.txt.orig 2022-12-06 02:31:27.000000000 -0700
|
||||
+++ zstr-1.0.7/CMakeLists.txt 2024-09-18 13:17:30.552013743 -0600
|
||||
--- zstr-1.1.0/CMakeLists.txt.orig 2025-10-20 09:17:37.000000000 -0600
|
||||
+++ zstr-1.1.0/CMakeLists.txt 2025-10-20 11:45:56.725568759 -0600
|
||||
@@ -16,8 +16,8 @@ endif()
|
||||
|
||||
# -- locate zlib
|
||||
|
|
@ -36,18 +36,18 @@
|
|||
+ libraries: zlib-ng::zlib
|
||||
features : cxx_std_11"
|
||||
)
|
||||
--- zstr-1.0.7/src/zstr.hpp.orig 2022-12-06 02:31:27.000000000 -0700
|
||||
+++ zstr-1.0.7/src/zstr.hpp 2024-09-18 14:09:15.735533320 -0600
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <cassert>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
--- zstr-1.1.0/src/zstr.hpp.orig 2025-10-20 09:17:37.000000000 -0600
|
||||
+++ zstr-1.1.0/src/zstr.hpp 2025-10-20 11:49:38.553413378 -0600
|
||||
@@ -15,7 +15,7 @@
|
||||
#ifdef MINIZ
|
||||
#include <miniz.h>
|
||||
#else
|
||||
-#include <zlib.h>
|
||||
+#include <zlib-ng.h>
|
||||
#endif
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include "strict_fstream.hpp"
|
||||
@@ -34,7 +34,7 @@ class Exception
|
||||
@@ -39,7 +39,7 @@ class Exception
|
||||
: public std::ios_base::failure
|
||||
{
|
||||
public:
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
{
|
||||
std::string msg = "zlib: ";
|
||||
switch (ret)
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
|
@ -65,8 +65,8 @@
|
|||
: std::ios_base::failure(error_to_message(zstrm_p, ret))
|
||||
{
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace detail
|
||||
{
|
||||
@@ -164,7 +164,7 @@ namespace WindowBits {
|
||||
} // namespace WindowBits
|
||||
|
||||
class z_stream_wrapper
|
||||
- : public z_stream
|
||||
|
|
@ -74,21 +74,21 @@
|
|||
{
|
||||
public:
|
||||
z_stream_wrapper(bool _is_input, int _level, int _window_bits)
|
||||
@@ -100,11 +100,11 @@ public:
|
||||
@@ -178,11 +178,11 @@ public:
|
||||
{
|
||||
this->avail_in = 0;
|
||||
this->next_in = nullptr;//Z_NULL
|
||||
- ret = inflateInit2(this, _window_bits ? _window_bits : 15+32);
|
||||
+ ret = zng_inflateInit2(this, _window_bits ? _window_bits : 15+32);
|
||||
- ret = inflateInit2(this, _window_bits ? _window_bits : WindowBits::ZLIB_OR_GZIP::MAX);
|
||||
+ ret = zng_inflateInit2(this, _window_bits ? _window_bits : WindowBits::ZLIB_OR_GZIP::MAX);
|
||||
}
|
||||
else
|
||||
{
|
||||
- ret = deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : 15+16, 8, Z_DEFAULT_STRATEGY);
|
||||
+ ret = zng_deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : 15+16, 8, Z_DEFAULT_STRATEGY);
|
||||
- ret = deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : WindowBits::GZIP::MAX, 8, Z_DEFAULT_STRATEGY);
|
||||
+ ret = zng_deflateInit2(this, _level, Z_DEFLATED, _window_bits ? _window_bits : WindowBits::GZIP::MAX, 8, Z_DEFAULT_STRATEGY);
|
||||
}
|
||||
if (ret != Z_OK) throw Exception(this, ret);
|
||||
}
|
||||
@@ -112,11 +112,11 @@ public:
|
||||
@@ -190,11 +190,11 @@ public:
|
||||
{
|
||||
if (is_input)
|
||||
{
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
}
|
||||
}
|
||||
private:
|
||||
@@ -187,15 +187,15 @@ public:
|
||||
@@ -323,7 +323,7 @@ public:
|
||||
// empty input buffer: refill from the start
|
||||
in_buff_start = in_buff.get();
|
||||
std::streamsize sz = sbuf_p->sgetn(in_buff.get(), static_cast<std::streamsize>(buff_size));
|
||||
|
|
@ -111,17 +111,7 @@
|
|||
if (in_buff_end == in_buff_start) break; // end of input
|
||||
}
|
||||
// auto detect if the stream contains text or deflate data
|
||||
if (auto_detect && ! auto_detect_run)
|
||||
{
|
||||
auto_detect_run = true;
|
||||
- unsigned char b0 = *reinterpret_cast< unsigned char * >(in_buff_start);
|
||||
- unsigned char b1 = *reinterpret_cast< unsigned char * >(in_buff_start + 1);
|
||||
+ unsigned char b0 = *reinterpret_cast< const unsigned char * >(in_buff_start);
|
||||
+ unsigned char b1 = *reinterpret_cast< const unsigned char * >(in_buff_start + 1);
|
||||
// Ref:
|
||||
// http://en.wikipedia.org/wiki/Gzip
|
||||
// http://stackoverflow.com/questions/9050260/what-does-a-zlib-header-look-like
|
||||
@@ -222,12 +222,12 @@ public:
|
||||
@@ -349,7 +349,7 @@ public:
|
||||
zstrm_p->avail_in = uint32_t(in_buff_end - in_buff_start);
|
||||
zstrm_p->next_out = reinterpret_cast< decltype(zstrm_p->next_out) >(out_buff_free_start);
|
||||
zstrm_p->avail_out = uint32_t((out_buff.get() + buff_size) - out_buff_free_start);
|
||||
|
|
@ -130,13 +120,16 @@
|
|||
// process return code
|
||||
if (ret != Z_OK && ret != Z_STREAM_END) throw Exception(zstrm_p.get(), ret);
|
||||
// update in&out pointers following inflate()
|
||||
in_buff_start = reinterpret_cast< decltype(in_buff_start) >(zstrm_p->next_in);
|
||||
@@ -360,7 +360,7 @@ public:
|
||||
zstrm_p->next_in
|
||||
#endif
|
||||
);
|
||||
- in_buff_end = in_buff_start + zstrm_p->avail_in;
|
||||
+ in_buff_end = const_cast<char *>(in_buff_start) + zstrm_p->avail_in;
|
||||
out_buff_free_start = reinterpret_cast< decltype(out_buff_free_start) >(zstrm_p->next_out);
|
||||
assert(out_buff_free_start + zstrm_p->avail_out == out_buff.get() + buff_size);
|
||||
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
@@ -382,7 +382,7 @@ public:
|
||||
private:
|
||||
std::streambuf * sbuf_p;
|
||||
std::unique_ptr<char[]> in_buff;
|
||||
|
|
@ -145,7 +138,7 @@
|
|||
char * in_buff_end;
|
||||
std::unique_ptr<char[]> out_buff;
|
||||
std::unique_ptr<detail::z_stream_wrapper> zstrm_p;
|
||||
@@ -288,7 +288,7 @@ public:
|
||||
@@ -424,7 +424,7 @@ public:
|
||||
{
|
||||
zstrm_p->next_out = reinterpret_cast< decltype(zstrm_p->next_out) >(out_buff.get());
|
||||
zstrm_p->avail_out = uint32_t(buff_size);
|
||||
|
|
@ -154,7 +147,7 @@
|
|||
if (ret != Z_OK && ret != Z_STREAM_END && ret != Z_BUF_ERROR) {
|
||||
failed = true;
|
||||
throw Exception(zstrm_p.get(), ret);
|
||||
@@ -346,7 +346,7 @@ public:
|
||||
@@ -492,7 +492,7 @@ public:
|
||||
zstrm_p->next_in = nullptr;
|
||||
zstrm_p->avail_in = 0;
|
||||
if (deflate_loop(Z_FINISH) != 0) return -1;
|
||||
|
|
|
|||
35
zstr.spec
35
zstr.spec
|
|
@ -1,8 +1,11 @@
|
|||
# There are no ELF objects in this package, so turn off debuginfo generation.
|
||||
%global debug_package %{nil}
|
||||
|
||||
# Whether to run tests
|
||||
%bcond ctest 1
|
||||
|
||||
Name: zstr
|
||||
Version: 1.0.7
|
||||
Version: 1.1.0
|
||||
Release: %autorelease
|
||||
Summary: A C++ header-only ZLib wrapper
|
||||
|
||||
|
|
@ -13,25 +16,25 @@ Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|||
# Use zlib-ng directly rather than via the compatibility interface
|
||||
Patch: %{name}-zlib-ng.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildSystem: cmake
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: pkgconfig(zlib-ng)
|
||||
|
||||
# See https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
|
||||
ExcludeArch: %{ix86}
|
||||
|
||||
%global _desc %{expand:
|
||||
This C++ header-only library enables the use of C++ standard iostreams
|
||||
to access ZLib-compressed streams.
|
||||
%global _desc %{expand:This C++ header-only library enables the use of C++ standard iostreams to
|
||||
access ZLib-compressed streams.
|
||||
|
||||
For input access (decompression), the compression format is
|
||||
auto-detected, and multiple concatenated compressed streams are
|
||||
decompressed seamlessly.
|
||||
For input access (decompression), the compression format is auto-detected, and
|
||||
multiple concatenated compressed streams are decompressed seamlessly.
|
||||
|
||||
For output access (compression), the only parameter exposed by this API
|
||||
is the compression level.}
|
||||
For output access (compression), the only parameter exposed by this API is the
|
||||
compression level.}
|
||||
|
||||
%description %_desc
|
||||
%description
|
||||
%_desc
|
||||
|
||||
%package devel
|
||||
Summary: A C++ header-only ZLib wrapper
|
||||
|
|
@ -39,23 +42,17 @@ BuildArch: noarch
|
|||
Requires: pkgconfig(zlib-ng)
|
||||
Provides: %{name}-static = %{version}-%{release}
|
||||
|
||||
%description devel %_desc
|
||||
%description devel
|
||||
%_desc
|
||||
|
||||
%prep
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
%cmake
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
#%%cmake_install does nothing, so install manually
|
||||
mkdir -p %{buildroot}%{_includedir}/zstr
|
||||
install -m 0644 -p src/*.hpp %{buildroot}%{_includedir}/zstr
|
||||
|
||||
%check
|
||||
%ctest
|
||||
|
||||
%files devel
|
||||
%doc README.org
|
||||
%license LICENSE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue