mirror of
https://abf.rosa.ru/djam/zstd.git
synced 2025-02-23 17:32:54 +00:00
Merge branch 'rosa2021.1' of abf.io:import/zstd into rosa2019.05
This commit is contained in:
commit
d7d0200fa7
4 changed files with 60 additions and 67 deletions
2
.abf.yml
2
.abf.yml
|
@ -1,2 +1,2 @@
|
||||||
sources:
|
sources:
|
||||||
zstd-1.4.3.tar.gz: aa9628839ba5032482f4df805d1f15aa485583cf
|
zstd-1.5.0.tar.gz: 3299248fcd44d7f21ba2f1f198c1173eeb3c4f32
|
||||||
|
|
13
dont-vectorize-like-a-clang-e2k.patch
Normal file
13
dont-vectorize-like-a-clang-e2k.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/lib/common/compiler.h b/lib/common/compiler.h
|
||||||
|
index 95e9483..088afcf 100644
|
||||||
|
--- a/lib/common/compiler.h
|
||||||
|
+++ b/lib/common/compiler.h
|
||||||
|
@@ -139,7 +139,7 @@
|
||||||
|
|
||||||
|
/* vectorization
|
||||||
|
* older GCC (pre gcc-4.3 picked as the cutoff) uses a different syntax */
|
||||||
|
-#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__)
|
||||||
|
+#if !defined(__INTEL_COMPILER) && !defined(__clang__) && defined(__GNUC__) && !defined(__LCC__)
|
||||||
|
# if (__GNUC__ == 4 && __GNUC_MINOR__ > 3) || (__GNUC__ >= 5)
|
||||||
|
# define DONT_VECTORIZE __attribute__((optimize("no-tree-vectorize")))
|
||||||
|
# else
|
|
@ -1,19 +0,0 @@
|
||||||
diff -Naur -Naru zstd-1.3.4/programs/zstd.1 zstd-1.3.4.new/programs/zstd.1
|
|
||||||
--- zstd-1.3.4/programs/zstd.1 2018-03-26 22:19:34.000000000 +0000
|
|
||||||
+++ zstd-1.3.4.new/programs/zstd.1 2018-03-28 04:28:27.532777239 +0000
|
|
||||||
@@ -177,7 +177,14 @@
|
|
||||||
.TP
|
|
||||||
\fB\-\-\fR
|
|
||||||
All arguments after \fB\-\-\fR are treated as files
|
|
||||||
-.
|
|
||||||
+
|
|
||||||
+.SH Parallel Zstd OPTIONS
|
|
||||||
+Additional options for the pzstd utility
|
|
||||||
+.TP
|
|
||||||
+.BR \-p ", " --processes
|
|
||||||
+ number of threads to use for (de)compression (default:4)
|
|
||||||
+
|
|
||||||
+
|
|
||||||
.SH "DICTIONARY BUILDER"
|
|
||||||
\fBzstd\fR offers \fIdictionary\fR compression, which greatly improves efficiency on small files and messages\. It\'s possible to train \fBzstd\fR with a set of samples, the result of which is saved into a file called a \fBdictionary\fR\. Then during compression and decompression, reference the same dictionary, using command \fB\-D dictionaryFileName\fR\. Compression of small files similar to the sample set will be greatly improved\.
|
|
||||||
.
|
|
93
zstd.spec
93
zstd.spec
|
@ -2,47 +2,40 @@
|
||||||
%define major 1
|
%define major 1
|
||||||
%define libname %mklibname %{oname} %{major}
|
%define libname %mklibname %{oname} %{major}
|
||||||
%define devname %mklibname %{oname} -d
|
%define devname %mklibname %{oname} -d
|
||||||
|
# static libraries are used by qemu. Please don't disable them.
|
||||||
# aarch64 and armv7hl at least currently segfault
|
%define sdevname %mklibname %{name} -d -s
|
||||||
# in ThreadPool test for the pzstd util
|
|
||||||
%ifarch %{ix86} x86_64
|
|
||||||
%bcond_without pzstd
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%bcond_with tests
|
%bcond_with tests
|
||||||
|
|
||||||
Summary: Zstd compression library
|
Summary: Zstd compression library
|
||||||
Name: zstd
|
Name: zstd
|
||||||
Version: 1.4.3
|
Version: 1.5.0
|
||||||
Release: 1
|
Release: 1
|
||||||
License: BSD and GPLv2+
|
License: BSD and GPLv2+
|
||||||
Group: Archiving/Compression
|
Group: Archiving/Compression
|
||||||
Url: http://www.zstd.net/
|
Url: http://www.zstd.net/
|
||||||
Source0: https://github.com/facebook/zstd/archive/v%{version}/%{name}-%{version}.tar.gz
|
Source0: https://github.com/facebook/zstd/archive/v%{version}/%{name}-%{version}.tar.gz
|
||||||
Patch1: pzstd.1.patch
|
Patch2: dont-vectorize-like-a-clang-e2k.patch
|
||||||
BuildRequires: gtest-devel
|
BuildRequires: gtest-devel
|
||||||
|
BuildRequires: pkgconfig(liblz4)
|
||||||
|
BuildRequires: pkgconfig(liblzma)
|
||||||
|
BuildRequires: pkgconfig(zlib)
|
||||||
|
BuildRequires: cmake
|
||||||
|
BuildRequires: ninja
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Zstd, short for Zstandard, is a fast lossless compression algorithm,
|
Zstd, short for Zstandard, is a fast lossless compression algorithm,
|
||||||
targeting real-time compression scenarios at zlib-level compression ratio.
|
targeting real-time compression scenarios at zlib-level compression ratio.
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc CHANGELOG README.md
|
|
||||||
%{_bindir}/%{name}
|
%{_bindir}/%{name}
|
||||||
%{_bindir}/%{name}cat
|
%{_bindir}/%{name}cat
|
||||||
%{_bindir}/%{name}grep
|
%{_bindir}/%{name}grep
|
||||||
%{_bindir}/%{name}less
|
%{_bindir}/%{name}less
|
||||||
%{_bindir}/%{name}mt
|
%{_bindir}/%{name}mt
|
||||||
%if %{with pzstd}
|
|
||||||
%{_bindir}/p%{name}
|
%{_bindir}/p%{name}
|
||||||
%{_mandir}/man1/p%{name}.1*
|
|
||||||
%endif
|
|
||||||
%{_bindir}/un%{name}
|
%{_bindir}/un%{name}
|
||||||
%{_mandir}/man1/%{name}.1*
|
%{_mandir}/man1/*
|
||||||
%{_mandir}/man1/%{name}cat.1*
|
|
||||||
%{_mandir}/man1/%{name}grep.1*
|
|
||||||
%{_mandir}/man1/%{name}less.1*
|
|
||||||
%{_mandir}/man1/un%{name}.1*
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -68,44 +61,50 @@ Provides: %{name}-devel = %{EVRD}
|
||||||
Header files for Zstd library.
|
Header files for Zstd library.
|
||||||
|
|
||||||
%files -n %{devname}
|
%files -n %{devname}
|
||||||
%{_includedir}/zbuff.h
|
%doc %{_docdir}/zstd
|
||||||
%{_includedir}/zdict.h
|
%{_includedir}/*.h
|
||||||
%{_includedir}/zstd.h
|
|
||||||
%{_includedir}/zstd_errors.h
|
|
||||||
%{_libdir}/pkgconfig/libzstd.pc
|
%{_libdir}/pkgconfig/libzstd.pc
|
||||||
%{_libdir}/libzstd.so
|
%{_libdir}/libzstd.so
|
||||||
|
%{_libdir}/cmake/%{name}/*.cmake
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%package -n %{sdevname}
|
||||||
|
Summary: Static libraries for zstd
|
||||||
|
Group: Development/C
|
||||||
|
Requires: %{devname} = %{version}-%{release}
|
||||||
|
|
||||||
|
%description -n %{sdevname}
|
||||||
|
Static library for zstd.
|
||||||
|
|
||||||
|
%files -n %{sdevname}
|
||||||
|
%{_libdir}/libzstd.a
|
||||||
|
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%autosetup -p1
|
||||||
|
# Get rid of -L/usr/lib insanity
|
||||||
|
sed -i -e 's,-L\${libdir} ,,g' lib/*.pc.in
|
||||||
|
sed -i -e '/^Cflags:/d' lib/*.pc.in
|
||||||
find -name .gitignore -delete
|
find -name .gitignore -delete
|
||||||
%if %{with pzstd}
|
|
||||||
%patch1 -p1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
for dir in lib programs; do
|
%set_build_flags
|
||||||
CFLAGS="%{optflags}" LDFLAGS="%{ldflags}" %make -C "$dir"
|
pushd build/cmake
|
||||||
done
|
%cmake -DZSTD_BUILD_CONTRIB:BOOL=ON \
|
||||||
%if %{with pzstd}
|
-DZSTD_LEGACY_SUPPORT:BOOL=ON \
|
||||||
CFLAGS="%{optflags}" LDFLAGS="%{ldflags}" CXXFLAGS="%{optflags} -std=c++11" %make -C 'contrib/pzstd'
|
-DZSTD_LZ4_SUPPORT:BOOL=ON \
|
||||||
%endif
|
-DZSTD_LZMA_SUPPORT:BOOL=ON \
|
||||||
|
-DZSTD_PROGRAMS_LINK_SHARED:BOOL=ON \
|
||||||
|
-DZSTD_ZLIB_SUPPORT:BOOL=ON -G Ninja
|
||||||
|
|
||||||
|
%ninja_build
|
||||||
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
|
pushd build/cmake
|
||||||
|
%ninja_install -C build
|
||||||
# Don't install the static lib
|
install -m 755 build/contrib/pzstd/pzstd %{buildroot}%{_bindir}/
|
||||||
rm %{buildroot}%{_libdir}/libzstd.a
|
install -D -m644 build/programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
|
||||||
%if %{with pzstd}
|
popd
|
||||||
install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd
|
|
||||||
install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%if %{with tests}
|
|
||||||
%check
|
|
||||||
CFLAGS="%{optflags}" LDFLAGS="%{ldflags}" make -C tests test-zstd
|
|
||||||
%if %{with pzstd}
|
|
||||||
CFLAGS="%{optflags}" LDFLAGS="%{ldflags}" CXXFLAGS="%{optflags} -std=c++11" make -C contrib/pzstd test
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue