Merge pull request #431 from flatcar/krnowak/sys-packages-app-arch

Automate updates of system packages: app-arch
This commit is contained in:
Krzesimir Nowak 2023-03-23 10:01:26 +01:00 committed by GitHub
commit bef2348928
22 changed files with 738 additions and 545 deletions

View File

@ -74,9 +74,13 @@ app-arch/libarchive
app-arch/ncompress
app-arch/pbzip2
app-arch/pigz
app-arch/rpm2targz
app-arch/sharutils
app-arch/tar
app-arch/unzip
app-arch/xz-utils
app-arch/zip
app-arch/zstd
app-cdr/cdrtools

View File

@ -1,4 +1,4 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
@ -12,7 +12,7 @@ SRC_URI="mirror://gentoo/${P}.tar.xz
LICENSE="BSD-1"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""
DEPEND=""

View File

@ -13,7 +13,7 @@ S="${WORKDIR}"/${MY_P}
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
IUSE="nls"
DEPEND="app-arch/xz-utils

View File

@ -0,0 +1,219 @@
https://bugs.gentoo.org/869203
See also OE's variant: https://cgit.openembedded.org/openembedded-core/commit/?id=f898db2607ba3837f81292af92bc8cb605b96cb3
--- a/unix/configure
+++ b/unix/configure
@@ -32,7 +32,7 @@ CFLAGS_BZ=''
echo 'Check C compiler type (optimization options)'
# Sun C?
cat > conftest.c << _EOF_
-int main()
+int main(void)
{
#ifndef __SUNPRO_C
bad code
@@ -47,7 +47,7 @@ if test $? -eq 0; then
else
# Tru64 DEC/Compaq/HP C?
cat > conftest.c << _EOF_
-int main()
+int main(void)
{
#ifndef __DECC
bad code
@@ -62,7 +62,7 @@ _EOF_
else
# HP-UX HP C?
cat > conftest.c << _EOF_
-int main()
+int main(void)
{
#ifdef __GNUC__
bad code
@@ -88,7 +88,7 @@ _EOF_
else
# GNU C?
cat > conftest.c << _EOF_
-int main()
+int main(void)
{
#ifndef __GNUC__
bad code
@@ -197,7 +197,7 @@ else
echo " Check if OS already has bzip2 library installed"
cat > conftest.c << _EOF_
#include "bzlib.h"
-int main()
+int main(void)
{
bz_stream strm;
BZ2_bzCompressEnd(&strm);
@@ -260,7 +260,7 @@ rm -f _match.s _match.o _crc_i386.s _crc_i386.o
echo Check for ANSI options
cat > conftest.c << _EOF_
-int main()
+int main(void)
{
#ifndef __STDC__
forget it
@@ -288,7 +288,7 @@ $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
echo Check the handling of const
cat > conftest.c << _EOF_
typedef int charset[2];
-int main()
+int main(void)
{
const charset x;
const char *foo;
@@ -303,7 +303,7 @@ echo Check for time_t
cat > conftest.c << _EOF_
#include <sys/types.h>
#include <time.h>
-int main()
+int main(void)
{
time_t t;
return 0;
@@ -315,8 +315,9 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
echo Check for size_t
cat > conftest.c << _EOF_
+#include <stddef.h>
#include <sys/types.h>
-int main()
+int main(void)
{
size_t s;
return 0;
@@ -329,7 +330,7 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
echo Check for off_t
cat > conftest.c << _EOF_
#include <sys/types.h>
-int main()
+int main(void)
{
off_t s;
return 0;
@@ -353,7 +354,7 @@ cat > conftest.c << _EOF_
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
-int main()
+int main(void)
{
struct stat s;
@@ -409,7 +410,7 @@ cat > conftest.c << _EOF_
#include <sys/stat.h>
#include <unistd.h>
#include <stdio.h>
-int main()
+int main(void)
{
off_t offset;
struct stat s;
@@ -453,7 +454,7 @@ echo Check for wide char support
cat > conftest.c << _EOF_
#include <stdlib.h>
#include <stdio.h>
-int main()
+int main(void)
{
int wsize;
wchar_t *wide_string;
@@ -489,7 +490,7 @@ fi
echo Check for gcc no-builtin flag
# -fno-builtin since version 2
cat > conftest.c << _EOF_
-int main()
+int main(void)
{
#if __GNUC__ >= 2
return 0;
@@ -508,14 +509,14 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
for func in rmdir strchr strrchr rename mktemp mktime mkstemp
do
echo Check for $func
- echo "int main(){ $func(); return 0; }" > conftest.c
+ echo "char $func(); int main(void){ return $func(); }" > conftest.c
$CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`"
done
echo Check for memset
-echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c
+echo "int main(void){ char memset(); return memset(); }" > conftest.c
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM"
@@ -523,7 +524,7 @@ $CC -o conftest conftest.c >/dev/null 2>/dev/null
echo Check for memmove
cat > conftest.c << _EOF_
#include <string.h>
-int main() { int a; int b = 0; memmove( &a, &b, sizeof( a)); return a; }
+int main(void) { int a; int b = 0; memmove( &a, &b, sizeof( a)); return a; }
_EOF_
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_MEMMOVE"
@@ -532,7 +533,7 @@ $CC -o conftest conftest.c >/dev/null 2>/dev/null
echo Check for strerror
cat > conftest.c << _EOF_
#include <string.h>
-int main() { strerror( 0); return 0; }
+int main(void) { strerror(0); return 0; }
_EOF_
$CC -o conftest conftest.c >/dev/null 2>/dev/null
[ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_STRERROR"
@@ -540,7 +541,7 @@ $CC -o conftest conftest.c >/dev/null 2>/dev/null
echo Check for errno declaration
cat > conftest.c << _EOF_
#include <errno.h>
-main()
+int main(void)
{
errno = 0;
return 0;
@@ -552,7 +553,7 @@ $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
echo Check for directory libraries
cat > conftest.c << _EOF_
-int main() { return closedir(opendir(".")); }
+int main(void) { char closedir(); char opendir(); return closedir(opendir()); }
_EOF_
$CC -o conftest conftest.c >/dev/null 2>/dev/null
@@ -574,7 +575,7 @@ fi
# Dynix/ptx 1.3 needed this
echo Check for readlink
-echo "int main(){ return readlink(); }" > conftest.c
+echo "int main(void){ char readlink(); return readlink(); }" > conftest.c
$CC -o conftest conftest.c >/dev/null 2>/dev/null
if [ $? -ne 0 ]; then
$CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null
@@ -617,7 +618,7 @@ CFLAGS="${CFLAGS} ${OPT}"
echo Check for valloc
cat > conftest.c << _EOF_
-main()
+int main(void)
{
#ifdef MMAP
valloc();
@@ -652,12 +653,12 @@ elif [ -f /xenix ]; then
fi
elif uname -X >/dev/null 2>/dev/null; then
# SCO shared library check
- echo "int main() { return 0;}" > conftest.c
+ echo "int main(void) { return 0;}" > conftest.c
$CC -o conftest conftest.c -lc_s -nointl >/dev/null 2> /dev/null
[ $? -eq 0 ] && LFLAGS2="-lc_s -nointl"
else
SYSTEM=`uname -s 2>/dev/null` || SYSTEM="unknown"
- echo "int main() { return 0;}" > conftest.c
+ echo "int main(void) { return 0;}" > conftest.c
case $SYSTEM in
OSF1|ULTRIX)
echo Check for -Olimit option

View File

@ -1,66 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit toolchain-funcs flag-o-matic
MY_P="${PN}${PV//.}"
DESCRIPTION="Info ZIP (encryption support)"
HOMEPAGE="http://www.info-zip.org/"
SRC_URI="mirror://sourceforge/infozip/${MY_P}.zip"
LICENSE="Info-ZIP"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux"
IUSE="bzip2 crypt natspec unicode"
DEPEND="${RDEPEND}"
RDEPEND="bzip2? ( app-arch/bzip2 )
natspec? ( dev-libs/libnatspec )"
BDEPEND="app-arch/unzip"
S="${WORKDIR}/${MY_P}"
PATCHES=(
"${FILESDIR}/${P}"-no-crypt.patch #238398
"${FILESDIR}/${P}"-pic.patch
"${FILESDIR}/${P}"-exec-stack.patch #122849
"${FILESDIR}/${P}"-build.patch #200995
"${FILESDIR}/${P}"-zipnote-freeze.patch #322047
"${FILESDIR}/${P}"-format-security.patch #512414
)
src_prepare() {
default
use natspec && eapply "${FILESDIR}/${PN}"-3.0-natspec.patch #275244
}
src_configure() {
append-cppflags \
-DLARGE_FILE_SUPPORT \
-DUIDGID_NOT_16BIT \
-D$(usex bzip2 '' NO)BZIP2_SUPPORT \
-D$(usex crypt '' NO)CRYPT \
-D$(usex unicode '' NO)UNICODE_SUPPORT
# Third arg disables bzip2 logic as we handle it ourselves above.
sh ./unix/configure "$(tc-getCC)" "-I. -DUNIX ${CFLAGS} ${CPPFLAGS}" "${T}" || die
if use bzip2 ; then
sed -i -e "s:LFLAGS2=:&'-lbz2 ':" flags || die
fi
}
src_compile() {
emake \
CPP="$(tc-getCPP)" \
-f unix/Makefile generic
}
src_install() {
dobin zip zipnote zipsplit
doman man/zip{,note,split}.1
if use crypt ; then
dobin zipcloak
doman man/zipcloak.1
fi
dodoc BUGS CHANGES README* TODO WHATSNEW WHERE proginfo/*.txt
}

View File

@ -0,0 +1,74 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit edo toolchain-funcs flag-o-matic
MY_P="${PN}${PV//.}"
DESCRIPTION="Info ZIP (encryption support)"
HOMEPAGE="https://infozip.sourceforge.net/Zip.html"
SRC_URI="mirror://sourceforge/infozip/${MY_P}.zip"
S="${WORKDIR}"/${MY_P}
LICENSE="Info-ZIP"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux"
IUSE="bzip2 crypt natspec unicode"
DEPEND="${RDEPEND}"
RDEPEND="bzip2? ( app-arch/bzip2 )
natspec? ( dev-libs/libnatspec )"
BDEPEND="app-arch/unzip"
PATCHES=(
"${FILESDIR}"/${P}-no-crypt.patch # bug #238398
"${FILESDIR}"/${P}-pic.patch
"${FILESDIR}"/${P}-exec-stack.patch # bug #122849
"${FILESDIR}"/${P}-build.patch # bug #200995
"${FILESDIR}"/${P}-zipnote-freeze.patch # bug #322047
"${FILESDIR}"/${P}-format-security.patch # bug #512414
"${FILESDIR}"/${P}-clang-15-configure-tests.patch
)
src_prepare() {
# bug #275244
use natspec && PATCHES+=( "${FILESDIR}"/${PN}-3.0-natspec.patch )
default
}
src_configure() {
# Needed for Clang 16
append-flags -std=gnu89
append-cppflags \
-DLARGE_FILE_SUPPORT \
-DUIDGID_NOT_16BIT \
-D$(usev !bzip2 'NO')BZIP2_SUPPORT \
-D$(usev !crypt 'NO')CRYPT \
-D$(usev !unicode 'NO')UNICODE_SUPPORT
# - We use 'sh' because: 1. lacks +x bit, easier; 2. it tries to load bashdb
# - Third arg disables bzip2 logic as we handle it ourselves above.
edo sh ./unix/configure "$(tc-getCC)" "-I. -DUNIX ${CFLAGS} ${CPPFLAGS}" "${T}"
if use bzip2 ; then
sed -i -e "s:LFLAGS2=:&'-lbz2 ':" flags || die
fi
}
src_compile() {
emake \
CPP="$(tc-getCPP)" \
-f unix/Makefile generic
}
src_install() {
dobin zip zipnote zipsplit
doman man/zip{,note,split}.1
if use crypt ; then
dobin zipcloak
doman man/zipcloak.1
fi
dodoc BUGS CHANGES README* TODO WHATSNEW WHERE proginfo/*.txt
}

View File

@ -1,4 +1,3 @@
DIST zstd-1.4.4.tar.gz 1962617 BLAKE2B e21841a53b6c60703e5500cfc2a02923c4c3e57975aa57e1060310171e0d83d7c8eda1bd0510d5736db5c310d76847d2105ac5f614867fc3a9dc3086a035dfd7 SHA512 8209837e8eb14e474dfe21d5511085f46cef93b03ab77613fd41e7b8be652418231c38852669c8e0b55b78ad41ea2cb8008d0da122a83f8f27e32b5c86f045cf
DIST zstd-1.4.5.tar.gz 1987927 BLAKE2B 1497d4e87040e5c71466468ebf1a57f4073666f2b005229925bc1d95a4b4fcb2a51d88bb79be20f21860e5750da42f8aac21d2997421d07ba37bd6bb12a28b55 SHA512 b03c497c3e0590c3d384cb856e3024f144b2bfac0d805d80e68deafa612c68237f12a2d657416d476a28059e80936c79f099fc42331464b417593895ea214387
DIST zstd-1.4.8.tar.gz 1816546 BLAKE2B 950d03c408e9d3fc2081969553c46247a1b8c13a22542effbf70373625bbfeb2a810e0adf0e1c6180cef590e7a28487191b1a577982fddc7a00d1507b461efd5 SHA512 61ce5d61e24770e70c32680f32d58542d6a1b5cc65737256561d8e34c77a82c1d36c769c179da5ea8ed5ecb035b4a4af292b9717c65976172e282859a332137a
DIST zstd-1.4.9.tar.gz 1834843 BLAKE2B 907f492bd023db9459bdc292a0bc4d1b6336d92dd7041eb2b36668589c20fcb98c411b85d78f92cd16d9b4a000d9c4125b5f966a5ca777034ae78210e639315b SHA512 f529db9c094f9ae26428bf1fdfcc91c6d783d400980e0f0d802d2cf13c2be2931465ef568907e03841ff76a369a1447e7371f8799d8526edb9a513ba5c6db133
DIST zstd-1.5.2.tar.gz 1950967 BLAKE2B 9d474e9fdcf7e5eb09d1f606712b05ca3001e8f6f7451254d8dba3f429101048532fd9c84a5b9083ae90d0457e9e1b1d48256581a1697e7db19b09d73595f070 SHA512 e107508a41fca50845cc2494e64adaba93efb95a2fa486fc962510a8ba4b2180d93067cae9870f119e88e5e8b28a046bc2240b0b23cdd8933d1fb1a6a9668c1e
DIST zstd-1.5.4.gh.tar.gz 2161536 BLAKE2B ffc5fcbbdf4ab04bc14b5037308bf4e879d4cbaaf863462ea1e8af3f1b86b935ee6036e49298c83ac42b00472c003e32c263c977f0ae7d64f31d9ae63c5c28cb SHA512 2896a6dd6b60cc251720356babcbab6018c874eb2149121b26e28041496fc355a9cb5fd1b39c91558fcfbafb789b3d721264a0f9b5734f893d5f3cdf97016394

View File

@ -1,60 +0,0 @@
From 06a57cf57e3c4e887cadcf688e3081154f3f6db4 Mon Sep 17 00:00:00 2001
From: Bimba Shrestha <bimbashrestha@fb.com>
Date: Thu, 6 Feb 2020 14:10:51 -0800
Subject: [PATCH] [build-issue] More portable header prefix usage (#) (#1987)
* make 4.3 build issue fix
* Changing header name and adding comment
---
programs/Makefile | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/programs/Makefile b/programs/Makefile
index b75314a8..a9ee3cb5 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -94,9 +94,12 @@ endif
VOID = /dev/null
+# Make 4.3 doesn't support '\#' anymore (https://lwn.net/Articles/810071/)
+NUM_SYMBOL := \#
+
# thread detection
NO_THREAD_MSG := ==> no threads, building without multithreading support
-HAVE_PTHREAD := $(shell printf '\#include <pthread.h>\nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c)
+HAVE_PTHREAD := $(shell printf '$(NUM_SYMBOL)include <pthread.h>\nint main(void) { return 0; }' > have_pthread.c && $(CC) $(FLAGS) -o have_pthread$(EXT) have_pthread.c -pthread 2> $(VOID) && rm have_pthread$(EXT) && echo 1 || echo 0; rm have_pthread.c)
HAVE_THREAD := $(shell [ "$(HAVE_PTHREAD)" -eq "1" -o -n "$(filter Windows%,$(OS))" ] && echo 1 || echo 0)
ifeq ($(HAVE_THREAD), 1)
THREAD_MSG := ==> building with threading support
@@ -108,7 +111,7 @@ endif
# zlib detection
NO_ZLIB_MSG := ==> no zlib, building zstd without .gz support
-HAVE_ZLIB := $(shell printf '\#include <zlib.h>\nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c)
+HAVE_ZLIB := $(shell printf '$(NUM_SYMBOL)include <zlib.h>\nint main(void) { return 0; }' > have_zlib.c && $(CC) $(FLAGS) -o have_zlib$(EXT) have_zlib.c -lz 2> $(VOID) && rm have_zlib$(EXT) && echo 1 || echo 0; rm have_zlib.c)
ifeq ($(HAVE_ZLIB), 1)
ZLIB_MSG := ==> building zstd with .gz compression support
ZLIBCPP = -DZSTD_GZCOMPRESS -DZSTD_GZDECOMPRESS
@@ -119,7 +122,7 @@ endif
# lzma detection
NO_LZMA_MSG := ==> no liblzma, building zstd without .xz/.lzma support
-HAVE_LZMA := $(shell printf '\#include <lzma.h>\nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c)
+HAVE_LZMA := $(shell printf '$(NUM_SYMBOL)include <lzma.h>\nint main(void) { return 0; }' > have_lzma.c && $(CC) $(FLAGS) -o have_lzma$(EXT) have_lzma.c -llzma 2> $(VOID) && rm have_lzma$(EXT) && echo 1 || echo 0; rm have_lzma.c)
ifeq ($(HAVE_LZMA), 1)
LZMA_MSG := ==> building zstd with .xz/.lzma compression support
LZMACPP = -DZSTD_LZMACOMPRESS -DZSTD_LZMADECOMPRESS
@@ -130,7 +133,7 @@ endif
# lz4 detection
NO_LZ4_MSG := ==> no liblz4, building zstd without .lz4 support
-HAVE_LZ4 := $(shell printf '\#include <lz4frame.h>\n\#include <lz4.h>\nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c)
+HAVE_LZ4 := $(shell printf '$(NUM_SYMBOL)include <lz4frame.h>\n\#include <lz4.h>\nint main(void) { return 0; }' > have_lz4.c && $(CC) $(FLAGS) -o have_lz4$(EXT) have_lz4.c -llz4 2> $(VOID) && rm have_lz4$(EXT) && echo 1 || echo 0; rm have_lz4.c)
ifeq ($(HAVE_LZ4), 1)
LZ4_MSG := ==> building zstd with .lz4 compression support
LZ4CPP = -DZSTD_LZ4COMPRESS -DZSTD_LZ4DECOMPRESS
--
2.24.1

View File

@ -1,215 +0,0 @@
From e668c9b52896e1cf92c99da3b01e3bdbbae77100 Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Tue, 18 Feb 2020 10:50:38 -0500
Subject: [PATCH 1/3] Fix pkg-config File Generation Again
Revises #1851. Fixes #1900. Replaces #1930.
Thanks to @orbea, @neheb, @Polynomial-C, and particularly @eli-schwartz for
pointing out the problem and suggesting solutions.
Tested with
```
make -C lib clean libzstd.pc
cat lib/libzstd.pc
# should fail
make -C lib clean libzstd.pc LIBDIR=/foo
make -C lib clean libzstd.pc INCLUDEDIR=/foo
make -C lib clean libzstd.pc LIBDIR=/usr/localfoo
make -C lib clean libzstd.pc INCLUDEDIR=/usr/localfoo
make -C lib clean libzstd.pc LIBDIR=/usr/local/lib prefix=/foo
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/include prefix=/foo
# should succeed
make -C lib clean libzstd.pc LIBDIR=/usr/local/foo
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/foo
make -C lib clean libzstd.pc LIBDIR=/usr/local/
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local/
make -C lib clean libzstd.pc LIBDIR=/usr/local
make -C lib clean libzstd.pc INCLUDEDIR=/usr/local
make -C lib clean libzstd.pc LIBDIR=/tmp/foo prefix=/tmp
make -C lib clean libzstd.pc INCLUDEDIR=/tmp/foo prefix=/tmp
make -C lib clean libzstd.pc LIBDIR=/tmp/foo prefix=/tmp/foo
make -C lib clean libzstd.pc INCLUDEDIR=/tmp/foo prefix=/tmp/foo
# should also succeed
make -C lib clean libzstd.pc prefix=/foo LIBDIR=/foo/bar INCLUDEDIR=/foo/
cat lib/libzstd.pc
mkdir out
cd out
cmake ../build/cmake
make
cat lib/libzstd.pc
```
---
build/cmake/lib/CMakeLists.txt | 5 +++--
lib/Makefile | 14 ++++++++++++--
lib/libzstd.pc.in | 4 ++--
3 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt
index e92647bf1..29ff57aa0 100644
--- a/build/cmake/lib/CMakeLists.txt
+++ b/build/cmake/lib/CMakeLists.txt
@@ -134,11 +134,12 @@ endif ()
if (UNIX)
# pkg-config
set(PREFIX "${CMAKE_INSTALL_PREFIX}")
- set(LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}")
+ set(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
+ set(INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(VERSION "${zstd_VERSION_MAJOR}.${zstd_VERSION_MINOR}.${zstd_VERSION_PATCH}")
add_custom_target(libzstd.pc ALL
${CMAKE_COMMAND} -DIN="${LIBRARY_DIR}/libzstd.pc.in" -DOUT="libzstd.pc"
- -DPREFIX="${PREFIX}" -DVERSION="${VERSION}"
+ -DPREFIX="${PREFIX}" -DLIBDIR="${LIBDIR}" -DINCLUDEDIR="${INCLUDEDIR}" -DVERSION="${VERSION}"
-P "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake"
COMMENT "Creating pkg-config file")
diff --git a/lib/Makefile b/lib/Makefile
index fd1710cf1..dbd64994c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -224,6 +224,16 @@ LIBDIR ?= $(libdir)
includedir ?= $(PREFIX)/include
INCLUDEDIR ?= $(includedir)
+PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n -e "s@^$(exec_prefix)\\(/\\|$$\\)@@p")
+PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n -e "s@^$(prefix)\\(/\\|$$\\)@@p")
+
+ifeq (,$(shell echo "$(LIBDIR)" | sed -n -e "\\@^$(exec_prefix)\\(/\\|$$\\)@ p"))
+$(error configured libdir ($(LIBDIR)) is outside of prefix ($(prefix)), can't generate pkg-config file)
+endif
+ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n -e "\\@^$(prefix)\\(/\\|$$\\)@ p"))
+$(error configured includedir ($(INCLUDEDIR)) is outside of exec_prefix ($(exec_prefix)), can't generate pkg-config file)
+endif
+
ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig
else
@@ -239,11 +249,11 @@ endif
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m 644
-
-libzstd.pc:
libzstd.pc: libzstd.pc.in
@echo creating pkgconfig
@sed -e 's|@PREFIX@|$(PREFIX)|' \
+ -e 's|@LIBDIR@|$(PCLIBDIR)|' \
+ -e 's|@INCLUDEDIR@|$(PCINCDIR)|' \
-e 's|@VERSION@|$(VERSION)|' \
$< >$@
diff --git a/lib/libzstd.pc.in b/lib/libzstd.pc.in
index e7880be47..8ec0235ad 100644
--- a/lib/libzstd.pc.in
+++ b/lib/libzstd.pc.in
@@ -4,8 +4,8 @@
prefix=@PREFIX@
exec_prefix=${prefix}
-includedir=${prefix}/include
-libdir=${exec_prefix}/lib
+includedir=${prefix}/@INCLUDEDIR@
+libdir=${exec_prefix}/@LIBDIR@
Name: zstd
Description: fast lossless compression algorithm library
From 73737231b95976f24b7b9bff96240976b11dcce0 Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Tue, 18 Feb 2020 13:17:17 -0500
Subject: [PATCH 2/3] Allow Manual Overriding of pkg-config Lib and Include
Dirs
When the `PCLIBDIR` or `PCINCDIR` is non-empty (either because we succeeded
in removing the prefix, or because it was manually set), we don't need to
perform the check. This lets us trust users who go to the trouble of setting
a manual override, rather than still blindly failing the make.
They'll still be prefixed with `${prefix}/` / `${exec_prefix}/` in the
pkg-config file though.
---
lib/Makefile | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/Makefile b/lib/Makefile
index dbd64994c..b067c11a2 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -227,12 +227,21 @@ INCLUDEDIR ?= $(includedir)
PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n -e "s@^$(exec_prefix)\\(/\\|$$\\)@@p")
PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n -e "s@^$(prefix)\\(/\\|$$\\)@@p")
+ifeq (,$(PCLIBDIR))
+# Additional prefix check is required, since the empty string is technically a
+# valid PCLIBDIR
ifeq (,$(shell echo "$(LIBDIR)" | sed -n -e "\\@^$(exec_prefix)\\(/\\|$$\\)@ p"))
$(error configured libdir ($(LIBDIR)) is outside of prefix ($(prefix)), can't generate pkg-config file)
endif
+endif
+
+ifeq (,$(PCINCDIR))
+# Additional prefix check is required, since the empty string is technically a
+# valid PCINCDIR
ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n -e "\\@^$(prefix)\\(/\\|$$\\)@ p"))
$(error configured includedir ($(INCLUDEDIR)) is outside of exec_prefix ($(exec_prefix)), can't generate pkg-config file)
endif
+endif
ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
PKGCONFIGDIR ?= $(PREFIX)/libdata/pkgconfig
From e5ef935cf6160768e20cd73db3d9450aa8b7f8cf Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Tue, 18 Feb 2020 13:40:58 -0500
Subject: [PATCH 3/3] Fix Variable Capitalization
---
lib/Makefile | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/lib/Makefile b/lib/Makefile
index b067c11a2..db35207bb 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -219,27 +219,28 @@ DESTDIR ?=
prefix ?= /usr/local
PREFIX ?= $(prefix)
exec_prefix ?= $(PREFIX)
-libdir ?= $(exec_prefix)/lib
+EXEC_PREFIX ?= $(exec_prefix)
+libdir ?= $(EXEC_PREFIX)/lib
LIBDIR ?= $(libdir)
includedir ?= $(PREFIX)/include
INCLUDEDIR ?= $(includedir)
-PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n -e "s@^$(exec_prefix)\\(/\\|$$\\)@@p")
-PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n -e "s@^$(prefix)\\(/\\|$$\\)@@p")
+PCLIBDIR ?= $(shell echo "$(LIBDIR)" | sed -n -e "s@^$(EXEC_PREFIX)\\(/\\|$$\\)@@p")
+PCINCDIR ?= $(shell echo "$(INCLUDEDIR)" | sed -n -e "s@^$(PREFIX)\\(/\\|$$\\)@@p")
ifeq (,$(PCLIBDIR))
# Additional prefix check is required, since the empty string is technically a
# valid PCLIBDIR
-ifeq (,$(shell echo "$(LIBDIR)" | sed -n -e "\\@^$(exec_prefix)\\(/\\|$$\\)@ p"))
-$(error configured libdir ($(LIBDIR)) is outside of prefix ($(prefix)), can't generate pkg-config file)
+ifeq (,$(shell echo "$(LIBDIR)" | sed -n -e "\\@^$(EXEC_PREFIX)\\(/\\|$$\\)@ p"))
+$(error configured libdir ($(LIBDIR)) is outside of prefix ($(PREFIX)), can't generate pkg-config file)
endif
endif
ifeq (,$(PCINCDIR))
# Additional prefix check is required, since the empty string is technically a
# valid PCINCDIR
-ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n -e "\\@^$(prefix)\\(/\\|$$\\)@ p"))
-$(error configured includedir ($(INCLUDEDIR)) is outside of exec_prefix ($(exec_prefix)), can't generate pkg-config file)
+ifeq (,$(shell echo "$(INCLUDEDIR)" | sed -n -e "\\@^$(PREFIX)\\(/\\|$$\\)@ p"))
+$(error configured includedir ($(INCLUDEDIR)) is outside of exec_prefix ($(EXEC_PREFIX)), can't generate pkg-config file)
endif
endif

View File

@ -1,28 +0,0 @@
From 1dcc4787965aa8f4af48ed5a2154185750bbaff5 Mon Sep 17 00:00:00 2001
From: Yann Collet <cyan@fb.com>
Date: Mon, 13 Jul 2020 14:16:33 -0700
Subject: [PATCH] fix uclibc's st_mtim
reported and suggested by @ewildgoose (#1872)
---
programs/platform.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/programs/platform.h b/programs/platform.h
index 2b4b9f2d8..68be70bb3 100644
--- a/programs/platform.h
+++ b/programs/platform.h
@@ -102,6 +102,12 @@ extern "C" {
# define PLATFORM_POSIX_VERSION 1
# endif
+# ifdef __UCLIBC__
+# ifndef __USE_MISC
+# define __USE_MISC /* enable st_mtim on uclibc */
+# endif
+# endif
+
# else /* non-unix target platform (like Windows) */
# define PLATFORM_POSIX_VERSION 0
# endif

View File

@ -0,0 +1,115 @@
https://github.com/facebook/zstd/issues/3523
https://github.com/facebook/zstd/pull/3541
From 50e8f55e7d5928af9c3411afdb4fbedb4d8f770d Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Thu, 9 Mar 2023 12:46:37 -0500
Subject: [PATCH 1/3] Fix Python 3.6 Incompatibility in CLI Tests
--- a/tests/cli-tests/run.py
+++ b/tests/cli-tests/run.py
@@ -535,7 +535,8 @@ def _run_script(self, script: str, cwd: str) -> None:
subprocess.run(
args=[script],
stdin=subprocess.DEVNULL,
- capture_output=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
cwd=cwd,
env=env,
check=True,
From c4c3e11958aed4dc99ec22e3d31c405217575a8c Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Thu, 9 Mar 2023 12:47:40 -0500
Subject: [PATCH 2/3] Avoid Calling `setvbuf()` on Null File Pointer
--- a/programs/fileio.c
+++ b/programs/fileio.c
@@ -644,18 +644,24 @@ FIO_openDstFile(FIO_ctx_t* fCtx, FIO_prefs_t* const prefs,
#endif
if (f == NULL) {
DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno));
+ } else {
+ /* An increased buffer size can provide a significant performance
+ * boost on some platforms. Note that providing a NULL buf with a
+ * size that's not 0 is not defined in ANSI C, but is defined in an
+ * extension. There are three possibilities here:
+ * 1. Libc supports the extended version and everything is good.
+ * 2. Libc ignores the size when buf is NULL, in which case
+ * everything will continue as if we didn't call `setvbuf()`.
+ * 3. We fail the call and execution continues but a warning
+ * message might be shown.
+ * In all cases due execution continues. For now, I believe that
+ * this is a more cost-effective solution than managing the buffers
+ * allocations ourselves (will require an API change).
+ */
+ if (setvbuf(f, NULL, _IOFBF, 1 MB)) {
+ DISPLAYLEVEL(2, "Warning: setvbuf failed for %s\n", dstFileName);
+ }
}
- /* An increased buffer size can provide a significant performance boost on some platforms.
- * Note that providing a NULL buf with a size that's not 0 is not defined in ANSI C, but is defined
- * in an extension. There are three possibilities here -
- * 1. Libc supports the extended version and everything is good.
- * 2. Libc ignores the size when buf is NULL, in which case everything will continue as if we didn't
- * call `setvbuf`.
- * 3. We fail the call and execution continues but a warning message might be shown.
- * In all cases due execution continues. For now, I believe that this is a more cost-effective
- * solution than managing the buffers allocations ourselves (will require an API change). */
- if(setvbuf(f, NULL, _IOFBF, 1 MB))
- DISPLAYLEVEL(2, "Warning: setvbuf failed for %s\n", dstFileName);
return f;
}
}
From 957a0ae52d0f49eccd260a22ceb5f5dfed064e9f Mon Sep 17 00:00:00 2001
From: "W. Felix Handte" <w@felixhandte.com>
Date: Thu, 9 Mar 2023 12:48:11 -0500
Subject: [PATCH 3/3] Add CLI Test
--- /dev/null
+++ b/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# motivated by issue #3523
+
+datagen > file
+mkdir out
+chmod 000 out
+
+zstd file -q --trace-file-stat -o out/file.zst
+zstd -tq out/file.zst
+
+chmod 777 out
--- /dev/null
+++ b/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh.stderr.exact
@@ -0,0 +1,26 @@
+Trace:FileStat: > UTIL_isLink(file)
+Trace:FileStat: < 0
+Trace:FileStat: > UTIL_isConsole(2)
+Trace:FileStat: < 0
+Trace:FileStat: > UTIL_getFileSize(file)
+Trace:FileStat: > UTIL_stat(-1, file)
+Trace:FileStat: < 1
+Trace:FileStat: < 65537
+Trace:FileStat: > UTIL_stat(-1, file)
+Trace:FileStat: < 1
+Trace:FileStat: > UTIL_isDirectoryStat()
+Trace:FileStat: < 0
+Trace:FileStat: > UTIL_stat(-1, file)
+Trace:FileStat: < 1
+Trace:FileStat: > UTIL_isSameFile(file, out/file.zst)
+Trace:FileStat: > UTIL_stat(-1, file)
+Trace:FileStat: < 1
+Trace:FileStat: > UTIL_stat(-1, out/file.zst)
+Trace:FileStat: < 0
+Trace:FileStat: < 0
+Trace:FileStat: > UTIL_isRegularFile(out/file.zst)
+Trace:FileStat: > UTIL_stat(-1, out/file.zst)
+Trace:FileStat: < 0
+Trace:FileStat: < 0
+zstd: out/file.zst: Permission denied
+zstd: can't stat out/file.zst : Permission denied -- ignored

View File

@ -0,0 +1,61 @@
https://bugs.gentoo.org/894058
https://github.com/facebook/zstd/pull/3497
From cc94fac7c879c47984bba7d60d5ce0c9834ff4c7 Mon Sep 17 00:00:00 2001
From: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>
Date: Fri, 10 Feb 2023 19:30:30 -0500
Subject: [PATCH] Use correct types in LZMA comp/decomp
Bytef and uInt are zlib types, not available when zlib is disabled
Fixes: 1598e6c634ac ("Async write for decompression")
Fixes: cc0657f27d81 ("AsyncIO compression part 2 - added async read and asyncio to compression code (#3022)")
---
programs/fileio.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/programs/fileio.c b/programs/fileio.c
index 9a8300cdd8..d3ed9217d5 100644
--- a/programs/fileio.c
+++ b/programs/fileio.c
@@ -1173,8 +1173,8 @@ FIO_compressLzmaFrame(cRess_t* ress,
}
writeJob =AIO_WritePool_acquireJob(ress->writeCtx);
- strm.next_out = (Bytef*)writeJob->buffer;
- strm.avail_out = (uInt)writeJob->bufferSize;
+ strm.next_out = (BYTE*)writeJob->buffer;
+ strm.avail_out = writeJob->bufferSize;
strm.next_in = 0;
strm.avail_in = 0;
@@ -1201,7 +1201,7 @@ FIO_compressLzmaFrame(cRess_t* ress,
writeJob->usedBufferSize = compBytes;
AIO_WritePool_enqueueAndReacquireWriteJob(&writeJob);
outFileSize += compBytes;
- strm.next_out = (Bytef*)writeJob->buffer;
+ strm.next_out = (BYTE*)writeJob->buffer;
strm.avail_out = writeJob->bufferSize;
} }
if (srcFileSize == UTIL_FILESIZE_UNKNOWN)
@@ -2316,8 +2316,8 @@ FIO_decompressLzmaFrame(dRess_t* ress,
}
writeJob = AIO_WritePool_acquireJob(ress->writeCtx);
- strm.next_out = (Bytef*)writeJob->buffer;
- strm.avail_out = (uInt)writeJob->bufferSize;
+ strm.next_out = (BYTE*)writeJob->buffer;
+ strm.avail_out = writeJob->bufferSize;
strm.next_in = (BYTE const*)ress->readCtx->srcBuffer;
strm.avail_in = ress->readCtx->srcBufferLoaded;
@@ -2345,7 +2345,7 @@ FIO_decompressLzmaFrame(dRess_t* ress,
writeJob->usedBufferSize = decompBytes;
AIO_WritePool_enqueueAndReacquireWriteJob(&writeJob);
outFileSize += decompBytes;
- strm.next_out = (Bytef*)writeJob->buffer;
+ strm.next_out = (BYTE*)writeJob->buffer;
strm.avail_out = writeJob->bufferSize;
} }
if (ret == LZMA_STREAM_END) break;

View File

@ -0,0 +1,12 @@
Workaround until https://github.com/mesonbuild/meson/pull/11372 lands
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -135,7 +135,7 @@ checkTag = executable('checkTag',
# =============================================================================
if tests_supported_oses.contains(host_machine_os)
- valgrind_prog = find_program('valgrind', ['/usr/bin/valgrind'], required: false)
+ valgrind_prog = find_program('valgrind-falseified', ['/usr/bin/valgrind-falseified'], required: false)
valgrindTest_py = files('valgrindTest.py')
if valgrind_prog.found()
test('valgrindTest',

View File

@ -0,0 +1,67 @@
https://github.com/facebook/zstd/pull/3490
From 183a18a45c1d69f8c42b9fcd25e6d28f9b3d75bb Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Fri, 10 Feb 2023 00:28:47 -0500
Subject: [PATCH 1/2] meson: correctly specify the dependency relationship for
playtests
It depends on the zstd program being built, and passes it as an env
variable. Just like datagen. But for datagen, we explicitly depend on
it, while for zstd, we assume it's built as part of "all".
This can be wrong in two cases:
- when running individual tests, meson can (re)build just what is needed
for that one test
- a later patch will handle building zstd but not by default
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -162,7 +162,7 @@ if host_machine_os != os_windows
playTests_sh,
args: opt,
env: ['ZSTD_BIN=' + zstd.full_path(), 'DATAGEN_BIN=./datagen'],
- depends: [datagen],
+ depends: [datagen, zstd],
suite: suite,
workdir: meson.current_build_dir(),
timeout: 2800) # Timeout should work on HDD drive
From 97ab0e2ab60fdda78f610032408df104de20b9f1 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@archlinux.org>
Date: Thu, 9 Feb 2023 23:55:09 -0500
Subject: [PATCH 2/2] meson: always build the zstd binary when tests are
enabled
We need to run it for the tests, even if programs are disabled. So if
they are disabled, create a build rule for the program, but don't
install it. Just make it available for the test itself.
--- a/meson.build
+++ b/meson.build
@@ -132,7 +132,7 @@ endif
subdir('lib')
-if bin_programs
+if bin_programs or bin_tests
subdir('programs')
endif
--- a/programs/meson.build
+++ b/programs/meson.build
@@ -72,7 +72,14 @@ zstd = executable('zstd',
c_args: zstd_c_args,
dependencies: zstd_deps,
export_dynamic: export_dynamic_on_windows, # Since Meson 0.45.0
- install: true)
+ build_by_default: bin_programs,
+ install: bin_programs)
+
+if not bin_programs
+ # we generate rules to build the programs, but don't install anything
+ # so do not continue to installing scripts and manpages
+ subdir_done()
+endif
zstd_frugal_sources = [join_paths(zstd_rootdir, 'programs/zstdcli.c'),
join_paths(zstd_rootdir, 'programs/timefn.c'),

View File

@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>patrick@gentoo.org</email>
<name>Patrick Lauer</name>
</maintainer>
<upstream>
<remote-id type="github">facebook/zstd</remote-id>
</upstream>
<maintainer type="project">
<email>base-system@gentoo.org</email>
</maintainer>
<upstream>
<remote-id type="github">facebook/zstd</remote-id>
</upstream>
</pkgmetadata>

View File

@ -1,75 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic multilib-minimal toolchain-funcs
DESCRIPTION="zstd fast compression library"
HOMEPAGE="https://facebook.github.io/zstd/"
SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="lz4 static-libs +threads"
RDEPEND="app-arch/xz-utils
lz4? ( app-arch/lz4 )"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-pkgconfig_libdir.patch" #700780
"${FILESDIR}/${P}-make43.patch" #708110
"${FILESDIR}/${PN}-1.4.5-fix-uclibc-ng.patch" #741972
)
src_prepare() {
default
multilib_copy_sources
# Workaround #713940 / https://github.com/facebook/zstd/issues/2045
# where upstream build system does not add -pthread for Makefile-based
# build system.
use threads && append-flags $(test-flags-CCLD -pthread)
}
mymake() {
emake \
CC="$(tc-getCC)" \
CXX="$(tc-getCXX)" \
AR="$(tc-getAR)" \
PREFIX="${EPREFIX}/usr" \
LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
"${@}"
}
multilib_src_compile() {
local libzstd_targets=( libzstd{,.a}$(usex threads '-mt' '') )
mymake -C lib ${libzstd_targets[@]} libzstd.pc
if multilib_is_native_abi ; then
mymake HAVE_LZ4="$(usex lz4 1 0)" zstd
mymake -C contrib/pzstd
fi
}
multilib_src_install() {
mymake -C lib DESTDIR="${D}" install
if multilib_is_native_abi ; then
mymake -C programs DESTDIR="${D}" install
mymake -C contrib/pzstd DESTDIR="${D}" install
fi
}
multilib_src_install_all() {
einstalldocs
if ! use static-libs; then
find "${ED}" -name "*.a" -delete || die
fi
}

View File

@ -1,73 +0,0 @@
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit flag-o-matic multilib-minimal toolchain-funcs
DESCRIPTION="zstd fast compression library"
HOMEPAGE="https://facebook.github.io/zstd/"
SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~riscv s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="lz4 static-libs +threads"
RDEPEND="app-arch/xz-utils
lz4? ( app-arch/lz4 )"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${P}-fix-uclibc-ng.patch" #741972
)
src_prepare() {
default
multilib_copy_sources
# Workaround #713940 / https://github.com/facebook/zstd/issues/2045
# where upstream build system does not add -pthread for Makefile-based
# build system.
use threads && append-flags $(test-flags-CCLD -pthread)
}
mymake() {
emake \
CC="$(tc-getCC)" \
CXX="$(tc-getCXX)" \
AR="$(tc-getAR)" \
PREFIX="${EPREFIX}/usr" \
LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
"${@}"
}
multilib_src_compile() {
local libzstd_targets=( libzstd{,.a}$(usex threads '-mt' '') )
mymake -C lib ${libzstd_targets[@]} libzstd.pc
if multilib_is_native_abi ; then
mymake HAVE_LZ4="$(usex lz4 1 0)" zstd
mymake -C contrib/pzstd
fi
}
multilib_src_install() {
mymake -C lib DESTDIR="${D}" install
if multilib_is_native_abi ; then
mymake -C programs DESTDIR="${D}" install
mymake -C contrib/pzstd DESTDIR="${D}" install
fi
}
multilib_src_install_all() {
einstalldocs
if ! use static-libs; then
find "${ED}" -name "*.a" -delete || die
fi
}

View File

@ -11,7 +11,7 @@ SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="lz4 static-libs +threads"
RDEPEND="app-arch/xz-utils

View File

@ -1,9 +1,9 @@
# Copyright 1999-2021 Gentoo Authors
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
EAPI=8
inherit flag-o-matic multilib-minimal toolchain-funcs
inherit multilib-minimal toolchain-funcs usr-ldscript
DESCRIPTION="zstd fast compression library"
HOMEPAGE="https://facebook.github.io/zstd/"
@ -11,21 +11,19 @@ SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="lz4 static-libs +threads"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="lz4 static-libs"
RDEPEND="app-arch/xz-utils
lz4? ( app-arch/lz4 )"
RDEPEND="
app-arch/xz-utils
sys-libs/zlib
lz4? ( app-arch/lz4 )
"
DEPEND="${RDEPEND}"
src_prepare() {
default
multilib_copy_sources
# Workaround #713940 / https://github.com/facebook/zstd/issues/2045
# where upstream build system does not add -pthread for Makefile-based
# build system.
use threads && append-flags $(test-flags-CCLD -pthread)
}
mymake() {
@ -35,11 +33,12 @@ mymake() {
AR="$(tc-getAR)" \
PREFIX="${EPREFIX}/usr" \
LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
V=1 \
"${@}"
}
multilib_src_compile() {
local libzstd_targets=( libzstd{,.a}$(usex threads '-mt' '') )
local libzstd_targets=( libzstd{,.a}-mt )
mymake -C lib ${libzstd_targets[@]} libzstd.pc
@ -55,6 +54,7 @@ multilib_src_install() {
if multilib_is_native_abi ; then
mymake -C programs DESTDIR="${D}" install
gen_usr_ldscript -a zstd
mymake -C contrib/pzstd DESTDIR="${D}" install
fi

View File

@ -0,0 +1,79 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson-multilib usr-ldscript
DESCRIPTION="zstd fast compression library"
HOMEPAGE="https://facebook.github.io/zstd/"
# Drop .gh on next bump (>1.5.4), it's only here as we switched to release
# tarball.
SRC_URI="https://github.com/facebook/zstd/releases/download/v${PV}/${P}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}"/${P}/build/meson
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="+lzma lz4 static-libs test zlib"
RESTRICT="!test? ( test )"
RDEPEND="
lzma? ( app-arch/xz-utils )
lz4? ( app-arch/lz4:= )
zlib? ( sys-libs/zlib )
"
DEPEND="${RDEPEND}"
MESON_PATCHES=(
# Workaround until Valgrind bugfix lands
"${FILESDIR}"/${PN}-1.5.4-no-find-valgrind.patch
# Allow building tests w/o programs (useful for multilib)
"${FILESDIR}"/${PN}-1.5.4-tests-no-programs.patch
)
PATCHES=(
# Fix build w/o zlib, bug #894058
"${FILESDIR}"/${P}-fix-no-zlib-build.patch
)
src_prepare() {
cd "${WORKDIR}"/${P} || die
default
cd "${S}" || die
eapply "${MESON_PATCHES[@]}"
}
multilib_src_configure() {
local native_file="${T}"/meson.${CHOST}.${ABI}.ini.local
# This replaces the no-find-valgrind patch once bugfix lands in a meson
# release + we can BDEPEND on it (https://github.com/mesonbuild/meson/pull/11372)
cat >> ${native_file} <<-EOF || die
[binaries]
valgrind='valgrind-falseified'
EOF
local emesonargs=(
-Ddefault_library=$(multilib_native_usex static-libs both shared)
$(meson_native_true bin_programs)
$(meson_native_true bin_contrib)
$(meson_use test bin_tests)
$(meson_native_use_feature zlib)
$(meson_native_use_feature lzma)
$(meson_native_use_feature lz4)
--native-file "${native_file}"
)
meson_src_configure
}
multilib_src_install() {
meson_src_install
multilib_is_native_abi && gen_usr_ldscript -a zstd
}

View File

@ -0,0 +1,80 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson-multilib usr-ldscript
DESCRIPTION="zstd fast compression library"
HOMEPAGE="https://facebook.github.io/zstd/"
# Drop .gh on next bump (>1.5.4), it's only here as we switched to release
# tarball.
SRC_URI="https://github.com/facebook/zstd/releases/download/v${PV}/${P}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}"/${P}/build/meson
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE="+lzma lz4 static-libs test zlib"
RESTRICT="!test? ( test )"
RDEPEND="
lzma? ( app-arch/xz-utils )
lz4? ( app-arch/lz4:= )
zlib? ( sys-libs/zlib )
"
DEPEND="${RDEPEND}"
MESON_PATCHES=(
# Workaround until Valgrind bugfix lands
"${FILESDIR}"/${PN}-1.5.4-no-find-valgrind.patch
# Allow building tests w/o programs (useful for multilib)
"${FILESDIR}"/${PN}-1.5.4-tests-no-programs.patch
)
PATCHES=(
# Fix build w/o zlib, bug #894058
"${FILESDIR}"/${P}-fix-no-zlib-build.patch
"${FILESDIR}"/${P}-crash-no-directory.patch
)
src_prepare() {
cd "${WORKDIR}"/${P} || die
default
cd "${S}" || die
eapply "${MESON_PATCHES[@]}"
}
multilib_src_configure() {
local native_file="${T}"/meson.${CHOST}.${ABI}.ini.local
# This replaces the no-find-valgrind patch once bugfix lands in a meson
# release + we can BDEPEND on it (https://github.com/mesonbuild/meson/pull/11372)
cat >> ${native_file} <<-EOF || die
[binaries]
valgrind='valgrind-falseified'
EOF
local emesonargs=(
-Ddefault_library=$(multilib_native_usex static-libs both shared)
$(meson_native_true bin_programs)
$(meson_native_true bin_contrib)
$(meson_use test bin_tests)
$(meson_native_use_feature zlib)
$(meson_native_use_feature lzma)
$(meson_native_use_feature lz4)
--native-file "${native_file}"
)
meson_src_configure
}
multilib_src_install() {
meson_src_install
multilib_is_native_abi && gen_usr_ldscript -a zstd
}

View File

@ -0,0 +1 @@
- Zstandard ([1.5.2](https://github.com/facebook/zstd/releases/tag/v1.5.2) (includes [1.5.1](https://github.com/facebook/zstd/releases/tag/v1.5.1) and [1.5.0](https://github.com/facebook/zstd/releases/tag/v1.5.0)))