commit:     d46416cf0096fe3ff8ec3939234363ed51380ed6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 17 21:26:05 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 17 21:26:10 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d46416cf

net-misc/dropbear: fix static case (use bundled)

We don't really want to expose static libs for libtomcrypt, so
let's use the bundled sources instead.

Closes: https://bugs.gentoo.org/765808
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/dropbear/dropbear-2020.81-r1.ebuild | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/net-misc/dropbear/dropbear-2020.81-r1.ebuild 
b/net-misc/dropbear/dropbear-2020.81-r1.ebuild
index fc989e06172..b52672266a0 100644
--- a/net-misc/dropbear/dropbear-2020.81-r1.ebuild
+++ b/net-misc/dropbear/dropbear-2020.81-r1.ebuild
@@ -17,12 +17,15 @@ IUSE="bsdpty minimal multicall pam +shadow static +syslog 
zlib"
 
 LIB_DEPEND="
        zlib? ( sys-libs/zlib[static-libs(+)] )
-       >=dev-libs/libtommath-1.2.0[static-libs(+)]
 "
 RDEPEND="
        acct-group/sshd
        acct-user/sshd
-       !static? ( ${LIB_DEPEND//\[static-libs(+)]} )
+       !static? (
+               >=dev-libs/libtomcrypt-1.18.2-r2
+               >=dev-libs/libtommath-1.2.0
+               ${LIB_DEPEND//\[static-libs(+)]}
+       )
        pam? ( sys-libs/pam )
 "
 DEPEND="
@@ -47,6 +50,12 @@ set_options() {
        )
 }
 
+pkg_setup() {
+       if use static ; then
+               ewarn "Using bundled copies of libtommath and libtomcrypt"
+       fi
+}
+
 src_prepare() {
        default
        sed \
@@ -59,13 +68,14 @@ src_prepare() {
 }
 
 src_configure() {
-       # XXX: Need to add libtomcrypt to the tree and re-enable this.
-       #       --disable-bundled-libtom
-       # We disable the hardening flags as our compiler already enables them
-       # by default as is appropriate for the target.
+       # Notes:
+       # 1) We use bundled libtom* when static build is enabled because
+       #    libtomcrypt lacks it and we don't particularly want to add it.
+       # 2) We disable the hardening flags as our compiler already enables them
+       #    by default as is appropriate for the target.
        local myeconfargs=(
                --disable-harden
-               --disable-bundled-libtom
+               $(use_enable static bundled-libtom)
                $(use_enable zlib)
                $(use_enable pam)
                $(use_enable !bsdpty openpty)
@@ -73,6 +83,7 @@ src_configure() {
                $(use_enable static)
                $(use_enable syslog)
        )
+
        econf "${myeconfargs[@]}"
 }
 

Reply via email to