summaryrefslogtreecommitdiff
blob: 14c355bb63515754e35b638830904fdf38b87125 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit toolchain-funcs

DESCRIPTION="Ultimate Packer for eXecutables (free version using UCL compression and not NRV)"
HOMEPAGE="https://upx.github.io/"
SRC_URI="https://github.com/upx/upx/releases/download/v${PV}/${P}-src.tar.xz"

LICENSE="GPL-2+ UPX-exception" # Read the exception before applying any patches
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
IUSE=""

DEPEND=">=dev-libs/ucl-1.03
	sys-libs/zlib"
RDEPEND="${RDEPEND}
	!app-arch/upx-bin"
BDEPEND="
	app-arch/xz-utils[extra-filters]
	dev-lang/perl"

S="${WORKDIR}/${P}-src"

PATCHES=(
	"${FILESDIR}/${P}_CVE-2020-24119.patch"
	"${FILESDIR}/${P}_CVE-2021-20285.patch"
)

src_compile() {
	tc-export CXX
	emake CXXFLAGS_WERROR="" all
}

src_install() {
	newbin src/upx.out upx
	dodoc BUGS NEWS PROJECTS README* THANKS doc/*.txt doc/upx.html
	doman doc/upx.1
}