commit:     cfcfa11debdd8d5d41ef794798790d1e438087c5
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  6 13:25:25 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Wed Aug  7 14:14:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cfcfa11d

dev-vcs/git: Fix cross-compiling when build host lacks curl

The Makefile tries to run curl-config, which is practically always present on
the build host, but we shouldn't assume that, and it could return the wrong
values when cross-compiling.

It's just a shell script, so we can safely call the copy under ESYSROOT for the
version check. For the CFLAGS and LDFLAGS, leverage pkg-config instead, as it
will correctly adjust the paths.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 dev-vcs/git/git-2.45.2.ebuild  | 4 ++++
 dev-vcs/git/git-9999-r1.ebuild | 4 ++++
 dev-vcs/git/git-9999-r2.ebuild | 4 ++++
 dev-vcs/git/git-9999-r3.ebuild | 4 ++++
 dev-vcs/git/git-9999.ebuild    | 4 ++++
 5 files changed, 20 insertions(+)

diff --git a/dev-vcs/git/git-2.45.2.ebuild b/dev-vcs/git/git-2.45.2.ebuild
index 9bcb72d24650..762ee1d1c29c 100644
--- a/dev-vcs/git/git-2.45.2.ebuild
+++ b/dev-vcs/git/git-2.45.2.ebuild
@@ -306,6 +306,10 @@ git_emake() {
                OPTCFLAGS="${CFLAGS}"
                OPTLDFLAGS="${LDFLAGS}"
 
+               CURL_CONFIG="${ESYSROOT}/usr/bin/curl-config"
+               CURL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags libcurl)"
+               CURL_LDFLAGS="$($(tc-getPKG_CONFIG) --libs libcurl)"
+
                PERL_PATH="${EPREFIX}/usr/bin/perl"
                PERL_MM_OPT=""
 

diff --git a/dev-vcs/git/git-9999-r1.ebuild b/dev-vcs/git/git-9999-r1.ebuild
index 9bcb72d24650..762ee1d1c29c 100644
--- a/dev-vcs/git/git-9999-r1.ebuild
+++ b/dev-vcs/git/git-9999-r1.ebuild
@@ -306,6 +306,10 @@ git_emake() {
                OPTCFLAGS="${CFLAGS}"
                OPTLDFLAGS="${LDFLAGS}"
 
+               CURL_CONFIG="${ESYSROOT}/usr/bin/curl-config"
+               CURL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags libcurl)"
+               CURL_LDFLAGS="$($(tc-getPKG_CONFIG) --libs libcurl)"
+
                PERL_PATH="${EPREFIX}/usr/bin/perl"
                PERL_MM_OPT=""
 

diff --git a/dev-vcs/git/git-9999-r2.ebuild b/dev-vcs/git/git-9999-r2.ebuild
index 9bcb72d24650..762ee1d1c29c 100644
--- a/dev-vcs/git/git-9999-r2.ebuild
+++ b/dev-vcs/git/git-9999-r2.ebuild
@@ -306,6 +306,10 @@ git_emake() {
                OPTCFLAGS="${CFLAGS}"
                OPTLDFLAGS="${LDFLAGS}"
 
+               CURL_CONFIG="${ESYSROOT}/usr/bin/curl-config"
+               CURL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags libcurl)"
+               CURL_LDFLAGS="$($(tc-getPKG_CONFIG) --libs libcurl)"
+
                PERL_PATH="${EPREFIX}/usr/bin/perl"
                PERL_MM_OPT=""
 

diff --git a/dev-vcs/git/git-9999-r3.ebuild b/dev-vcs/git/git-9999-r3.ebuild
index 9bcb72d24650..762ee1d1c29c 100644
--- a/dev-vcs/git/git-9999-r3.ebuild
+++ b/dev-vcs/git/git-9999-r3.ebuild
@@ -306,6 +306,10 @@ git_emake() {
                OPTCFLAGS="${CFLAGS}"
                OPTLDFLAGS="${LDFLAGS}"
 
+               CURL_CONFIG="${ESYSROOT}/usr/bin/curl-config"
+               CURL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags libcurl)"
+               CURL_LDFLAGS="$($(tc-getPKG_CONFIG) --libs libcurl)"
+
                PERL_PATH="${EPREFIX}/usr/bin/perl"
                PERL_MM_OPT=""
 

diff --git a/dev-vcs/git/git-9999.ebuild b/dev-vcs/git/git-9999.ebuild
index 9bcb72d24650..762ee1d1c29c 100644
--- a/dev-vcs/git/git-9999.ebuild
+++ b/dev-vcs/git/git-9999.ebuild
@@ -306,6 +306,10 @@ git_emake() {
                OPTCFLAGS="${CFLAGS}"
                OPTLDFLAGS="${LDFLAGS}"
 
+               CURL_CONFIG="${ESYSROOT}/usr/bin/curl-config"
+               CURL_CFLAGS="$($(tc-getPKG_CONFIG) --cflags libcurl)"
+               CURL_LDFLAGS="$($(tc-getPKG_CONFIG) --libs libcurl)"
+
                PERL_PATH="${EPREFIX}/usr/bin/perl"
                PERL_MM_OPT=""
 

Reply via email to