commit:     bf63c51cfab3bcbbfdf60cb9833c44b812932ca2
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 05:24:17 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Nov 10 05:24:17 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf63c51c

sys-fs/squashfs-tools: add USE=static support

 sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild | 25 +++++++++++----------
 sys-fs/squashfs-tools/squashfs-tools-9999.ebuild   | 26 ++++++++++++----------
 2 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild 
b/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild
index 74247ab..047b874 100644
--- a/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild
+++ b/sys-fs/squashfs-tools/squashfs-tools-4.3-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="5"
 
-inherit eutils toolchain-funcs
+inherit eutils toolchain-funcs flag-o-matic
 
 DEB_VER="3"
 
@@ -15,18 +15,18 @@ SRC_URI="mirror://sourceforge/squashfs/squashfs${PV}.tar.gz
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sh ~sparc ~x86"
-IUSE="lz4 lzma lzo xattr +xz"
+IUSE="lz4 lzma lzo static xattr +xz"
 
-RDEPEND="
-       sys-libs/zlib
-       !xz? ( !lzo? ( sys-libs/zlib ) )
-       lz4? ( app-arch/lz4 )
-       lzma? ( app-arch/xz-utils )
-       lzo? ( dev-libs/lzo )
-       xattr? ( sys-apps/attr )
-       xz? ( app-arch/xz-utils )
-"
-DEPEND="${RDEPEND}"
+LIB_DEPEND="sys-libs/zlib[static-libs(+)]
+       !xz? ( !lzo? ( sys-libs/zlib[static-libs(+)] ) )
+       lz4? ( app-arch/lz4[static-libs(+)] )
+       lzma? ( app-arch/xz-utils[static-libs(+)] )
+       lzo? ( dev-libs/lzo[static-libs(+)] )
+       xattr? ( sys-apps/attr[static-libs(+)] )
+       xz? ( app-arch/xz-utils[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+       static? ( ${LIB_DEPEND} )"
 
 S="${WORKDIR}/squashfs${PV}/${PN}"
 
@@ -53,6 +53,7 @@ src_configure() {
        )
 
        tc-export CC
+       use static && append-ldflags -static
 }
 
 src_compile() {

diff --git a/sys-fs/squashfs-tools/squashfs-tools-9999.ebuild 
b/sys-fs/squashfs-tools/squashfs-tools-9999.ebuild
index 85558e8..7815a95 100644
--- a/sys-fs/squashfs-tools/squashfs-tools-9999.ebuild
+++ b/sys-fs/squashfs-tools/squashfs-tools-9999.ebuild
@@ -2,7 +2,8 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
-inherit eutils git-r3 toolchain-funcs
+
+inherit eutils git-r3 toolchain-funcs flag-o-matic
 
 DEB_VER="3"
 
@@ -15,18 +16,18 @@ EGIT_REPO_URI="
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS=""
-IUSE="lz4 lzma lzo xattr +xz"
+IUSE="lz4 lzma lzo static xattr +xz"
 
-RDEPEND="
-       sys-libs/zlib
-       !xz? ( !lzo? ( sys-libs/zlib ) )
-       lz4? ( app-arch/lz4 )
-       lzma? ( app-arch/xz-utils )
-       lzo? ( dev-libs/lzo )
-       xattr? ( sys-apps/attr )
-       xz? ( app-arch/xz-utils )
-"
-DEPEND="${RDEPEND}"
+LIB_DEPEND="sys-libs/zlib[static-libs(+)]
+       !xz? ( !lzo? ( sys-libs/zlib[static-libs(+)] ) )
+       lz4? ( app-arch/lz4[static-libs(+)] )
+       lzma? ( app-arch/xz-utils[static-libs(+)] )
+       lzo? ( dev-libs/lzo[static-libs(+)] )
+       xattr? ( sys-apps/attr[static-libs(+)] )
+       xz? ( app-arch/xz-utils[static-libs(+)] )"
+RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
+DEPEND="${RDEPEND}
+       static? ( ${LIB_DEPEND} )"
 
 PATCHES=(
        "${FILESDIR}"/${PN}-4.3-sysmacros.patch
@@ -49,6 +50,7 @@ src_configure() {
        )
 
        tc-export CC
+       use static && append-ldflags -static
 }
 
 src_compile() {

Reply via email to