sys-apps/prctl: drop CPP detection
[gentoo.git] / sys-fs / squashfs-tools / squashfs-tools-9999.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 inherit flag-o-matic git-r3 toolchain-funcs
6
7 DESCRIPTION="tools to create and extract Squashfs filesystems"
8 HOMEPAGE="
9         http://squashfs.sourceforge.net
10         https://github.com/plougher/squashfs-tools
11 "
12 EGIT_REPO_URI="https://github.com/plougher/${PN}"
13 LICENSE="GPL-2"
14 SLOT="0"
15 IUSE="debug lz4 lzma lzo static xattr +xz zstd"
16 KEYWORDS=""
17
18 LIB_DEPEND="
19         !xz? ( !lzo? ( sys-libs/zlib[static-libs(+)] ) )
20         lz4? ( app-arch/lz4[static-libs(+)] )
21         lzma? ( app-arch/xz-utils[static-libs(+)] )
22         lzo? ( dev-libs/lzo[static-libs(+)] )
23         sys-libs/zlib[static-libs(+)]
24         xattr? ( sys-apps/attr[static-libs(+)] )
25         xz? ( app-arch/xz-utils[static-libs(+)] )
26         zstd? ( app-arch/zstd[static-libs(+)] )
27 "
28 RDEPEND="
29         !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
30 "
31 DEPEND="
32         ${RDEPEND}
33         static? ( ${LIB_DEPEND} )
34 "
35 use10() { usex $1 1 0 ; }
36
37 src_configure() {
38
39         # set up make command line variables in EMAKE_SQUASHFS_CONF
40         EMAKE_SQUASHFS_CONF=(
41                 LZ4_SUPPORT=$(use10 lz4)
42                 LZMA_XZ_SUPPORT=$(use10 lzma)
43                 LZO_SUPPORT=$(use10 lzo)
44                 XATTR_SUPPORT=$(use10 xattr)
45                 XZ_SUPPORT=$(use10 xz)
46                 ZSTD_SUPPORT=$(use10 zstd)
47         )
48
49         tc-export CC
50         use debug && append-cppflags -DSQUASHFS_TRACE
51         use static && append-ldflags -static
52 }
53
54 src_compile() {
55         emake "${EMAKE_SQUASHFS_CONF[@]}" -C ${PN}
56 }
57
58 src_install() {
59         dobin ${PN}/{mksquashfs,unsquashfs}
60         dodoc CHANGES README RELEASE-READMEs/*
61 }