forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app-arch/pigz: fix compat w/ zlib-1.3
Signed-off-by: Sam James <[email protected]>
- Loading branch information
1 parent
5c7a27d
commit 1dc5bd0
Showing
2 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
https://github.com/madler/pigz/issues/111 | ||
https://github.com/madler/pigz/commit/907ca0763be4547a9b0cce8c1057217488149744 | ||
|
||
From 907ca0763be4547a9b0cce8c1057217488149744 Mon Sep 17 00:00:00 2001 | ||
From: Mark Adler <[email protected]> | ||
Date: Fri, 18 Aug 2023 03:27:12 -0700 | ||
Subject: [PATCH] Make pigz compatible with two-component zlib version numbers. | ||
|
||
zlib 1.3 (not 1.3.0) broke the zlib_vernum() function in pigz. | ||
This commit fixes that. | ||
--- a/pigz.c | ||
+++ b/pigz.c | ||
@@ -1333,7 +1333,7 @@ local long zlib_vernum(void) { | ||
} | ||
ver++; | ||
} while (left); | ||
- return left < 2 ? num << (left << 2) : -1; | ||
+ return left < 3 ? num << (left << 2) : -1; | ||
} | ||
|
||
// -- check value combination routines for parallel calculation -- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 1999-2023 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
inherit toolchain-funcs flag-o-matic | ||
|
||
DESCRIPTION="A parallel implementation of gzip" | ||
HOMEPAGE="https://www.zlib.net/pigz/" | ||
SRC_URI="https://www.zlib.net/pigz/${P}.tar.gz" | ||
|
||
LICENSE="ZLIB" | ||
SLOT="0" | ||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~ppc-macos" | ||
IUSE="static test" | ||
RESTRICT="!test? ( test )" | ||
|
||
LIB_DEPEND="sys-libs/zlib[static-libs(+)]" | ||
RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )" | ||
DEPEND=" | ||
${RDEPEND} | ||
static? ( ${LIB_DEPEND} ) | ||
test? ( app-arch/ncompress ) | ||
" | ||
|
||
PATCHES=( | ||
"${FILESDIR}"/${P}-memcpy-ub.patch | ||
"${FILESDIR}"/${P}-zlib-1.3.patch | ||
) | ||
|
||
src_compile() { | ||
use static && append-ldflags -static | ||
emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" | ||
} | ||
|
||
src_install() { | ||
dobin ${PN} | ||
dosym ${PN} /usr/bin/un${PN} | ||
dodoc README | ||
doman ${PN}.1 | ||
} |