Skip to content

Commit

Permalink
dev-libs/libsecp256k1-0.2.0: enable multilib build
Browse files Browse the repository at this point in the history
  • Loading branch information
whitslack committed Jan 7, 2023
1 parent 798a0aa commit 59e4e53
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 31105e8836ec45f87f3ae3c522a7e1587785a1cc Mon Sep 17 00:00:00 2001
From: Matt Whitlock <[email protected]>
Date: Mon, 21 Nov 2022 22:13:04 -0500
Subject: [PATCH] Makefile: add -I$(top_srcdir)/src to CPPFLAGS for precomputed

When performing an out-of-source-tree build, regenerating the source
files for the precomputed ecmult tables places them outside the source
tree. Then, when they are to be compiled, they cannot find the headers
they need because the source tree is absent from their include search
path. This appears to have been an oversight, as the relevant -I options
are present in libsecp256k1_la_CPPFLAGS but were missing from
libsecp256k1_precomputed_la_CPPFLAGS. This commit adds them.
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index ad50504..727e51f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,7 +73,7 @@ noinst_HEADERS += examples/random.h
PRECOMPUTED_LIB = libsecp256k1_precomputed.la
noinst_LTLIBRARIES = $(PRECOMPUTED_LIB)
libsecp256k1_precomputed_la_SOURCES = src/precomputed_ecmult.c src/precomputed_ecmult_gen.c
-libsecp256k1_precomputed_la_CPPFLAGS = $(SECP_INCLUDES)
+libsecp256k1_precomputed_la_CPPFLAGS = -I$(top_srcdir)/src $(SECP_INCLUDES)

if USE_EXTERNAL_ASM
COMMON_LIB = libsecp256k1_common.la
--
2.39.0

9 changes: 5 additions & 4 deletions dev-libs/libsecp256k1/libsecp256k1-0.2.0-r2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

EAPI=8

inherit autotools
inherit autotools multilib-minimal

MyPN=secp256k1
DESCRIPTION="Optimized C library for EC operations on curve secp256k1"
Expand All @@ -28,6 +28,7 @@ BDEPEND="

PATCHES=(
"${FILESDIR}/0.2.0-fix-cross-compile.patch"
"${FILESDIR}/0.2.0-fix-out-of-source-tree-build.patch"
)

S="${WORKDIR}/${MyPN}-${PV}"
Expand All @@ -40,7 +41,7 @@ src_prepare() {
rm -f src/precomputed_ecmult.c src/precomputed_ecmult_gen.c || die
}

src_configure() {
multilib_src_configure() {
local myeconfargs=(
--disable-benchmark
$(use_enable experimental)
Expand All @@ -63,10 +64,10 @@ src_configure() {
myeconfargs+=( --with-asm=no )
fi

econf "${myeconfargs[@]}"
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}

src_install() {
multilib_src_install_all() {
default
find "${ED}" -name '*.la' -delete || die
}

0 comments on commit 59e4e53

Please sign in to comment.