Merge branch 'rosa2021.1' of abf.io:import/zstd into rosa2019.05

This commit is contained in:
Mikhail Novosyolov 2021-07-13 03:33:07 +03:00
commit d7d0200fa7
4 changed files with 60 additions and 67 deletions

View file

@ -1,2 +1,2 @@
sources:
zstd-1.4.3.tar.gz: aa9628839ba5032482f4df805d1f15aa485583cf
zstd-1.5.0.tar.gz: 3299248fcd44d7f21ba2f1f198c1173eeb3c4f32

View 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

View file

@ -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\.
.

View file

@ -2,47 +2,40 @@
%define major 1
%define libname %mklibname %{oname} %{major}
%define devname %mklibname %{oname} -d
# aarch64 and armv7hl at least currently segfault
# in ThreadPool test for the pzstd util
%ifarch %{ix86} x86_64
%bcond_without pzstd
%endif
# static libraries are used by qemu. Please don't disable them.
%define sdevname %mklibname %{name} -d -s
%bcond_with tests
Summary: Zstd compression library
Name: zstd
Version: 1.4.3
Version: 1.5.0
Release: 1
License: BSD and GPLv2+
Group: Archiving/Compression
Url: http://www.zstd.net/
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: pkgconfig(liblz4)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(zlib)
BuildRequires: cmake
BuildRequires: ninja
%description
Zstd, short for Zstandard, is a fast lossless compression algorithm,
targeting real-time compression scenarios at zlib-level compression ratio.
%files
%doc CHANGELOG README.md
%{_bindir}/%{name}
%{_bindir}/%{name}cat
%{_bindir}/%{name}grep
%{_bindir}/%{name}less
%{_bindir}/%{name}mt
%if %{with pzstd}
%{_bindir}/p%{name}
%{_mandir}/man1/p%{name}.1*
%endif
%{_bindir}/un%{name}
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/%{name}cat.1*
%{_mandir}/man1/%{name}grep.1*
%{_mandir}/man1/%{name}less.1*
%{_mandir}/man1/un%{name}.1*
%{_mandir}/man1/*
#----------------------------------------------------------------------------
@ -68,44 +61,50 @@ Provides: %{name}-devel = %{EVRD}
Header files for Zstd library.
%files -n %{devname}
%{_includedir}/zbuff.h
%{_includedir}/zdict.h
%{_includedir}/zstd.h
%{_includedir}/zstd_errors.h
%doc %{_docdir}/zstd
%{_includedir}/*.h
%{_libdir}/pkgconfig/libzstd.pc
%{_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
%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
%if %{with pzstd}
%patch1 -p1
%endif
%build
for dir in lib programs; do
CFLAGS="%{optflags}" LDFLAGS="%{ldflags}" %make -C "$dir"
done
%if %{with pzstd}
CFLAGS="%{optflags}" LDFLAGS="%{ldflags}" CXXFLAGS="%{optflags} -std=c++11" %make -C 'contrib/pzstd'
%endif
%set_build_flags
pushd build/cmake
%cmake -DZSTD_BUILD_CONTRIB:BOOL=ON \
-DZSTD_LEGACY_SUPPORT:BOOL=ON \
-DZSTD_LZ4_SUPPORT:BOOL=ON \
-DZSTD_LZMA_SUPPORT:BOOL=ON \
-DZSTD_PROGRAMS_LINK_SHARED:BOOL=ON \
-DZSTD_ZLIB_SUPPORT:BOOL=ON -G Ninja
%ninja_build
popd
%install
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
# Don't install the static lib
rm %{buildroot}%{_libdir}/libzstd.a
%if %{with pzstd}
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
pushd build/cmake
%ninja_install -C build
install -m 755 build/contrib/pzstd/pzstd %{buildroot}%{_bindir}/
install -D -m644 build/programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
popd