Skip to content

Commit

Permalink
app-crypt/efitools: support "static" USE flag
Browse files Browse the repository at this point in the history
If "static" USE flag is set, it makes sense to do static link for
user-space executables.
  • Loading branch information
edjee authored and FuzzyGophers committed Jun 8, 2018
1 parent feb7b92 commit ed1d845
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions app-crypt/efitools/efitools-1.8.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ SRC_URI="https://git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git/snaps
LICENSE="GPL-2 LGPL-2.1"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="libressl"
IUSE="libressl static"

RDEPEND="!libressl? ( dev-libs/openssl:0= )
libressl? ( dev-libs/libressl:0= )
LIB_DEPEND="!libressl? ( dev-libs/openssl:0=[static-libs(+)] )
libressl? ( dev-libs/libressl:0=[static-libs(+)] )"

RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )
sys-apps/util-linux"

DEPEND="${RDEPEND}
app-crypt/sbsigntool
dev-perl/File-Slurp
static? (
${LIB_DEPEND}
dev-util/pkgconfig
)
sys-apps/help2man
sys-boot/gnu-efi
virtual/pkgconfig"
Expand All @@ -31,6 +37,11 @@ PATCHES=(
)

src_prepare() {
if use static; then
append-ldflags -static
sed -i 's/-lcrypto/`pkg-config --static --libs libcrypto`/g' Makefile || die
fi

# Respect users CFLAGS
sed -i -e 's/CFLAGS.*= -O2 -g/CFLAGS += /' Make.rules || die

Expand Down

0 comments on commit ed1d845

Please sign in to comment.