commit:     58774f4fbb1570837c6314c134ce5af38811c21c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 16 15:33:04 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Mar 18 09:21:13 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58774f4f

dev-vcs/git: don't search outside of prefix for gettext on Darwin

Conditionally patching so that non-prefix developers don't have
to rebase on new versions.

We can apply this unconditionally safely if desired though.

Closes: https://bugs.gentoo.org/757309
Signed-off-by: Sam James <sam <AT> gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/19954
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 .../files/git-2.31.0-darwin-prefix-gettext.patch   | 22 ++++++++++++++++++++++
 dev-vcs/git/git-2.31.0-r1.ebuild                   |  5 +++++
 dev-vcs/git/git-9999-r1.ebuild                     |  5 +++++
 dev-vcs/git/git-9999-r2.ebuild                     |  5 +++++
 dev-vcs/git/git-9999-r3.ebuild                     |  5 +++++
 dev-vcs/git/git-9999.ebuild                        |  5 +++++
 6 files changed, 47 insertions(+)

diff --git a/dev-vcs/git/files/git-2.31.0-darwin-prefix-gettext.patch 
b/dev-vcs/git/files/git-2.31.0-darwin-prefix-gettext.patch
new file mode 100644
index 00000000000..df87def6073
--- /dev/null
+++ b/dev-vcs/git/files/git-2.31.0-darwin-prefix-gettext.patch
@@ -0,0 +1,22 @@
+Don't examine outside of the prefix for gettext on macOS/Darwin.
+https://bugs.gentoo.org/757309
+--- a/config.mak.uname
++++ b/config.mak.uname
+@@ -136,17 +136,6 @@ ifeq ($(uname_S),Darwin)
+       HAVE_BSD_SYSCTL = YesPlease
+       FREAD_READS_DIRECTORIES = UnfortunatelyYes
+       HAVE_NS_GET_EXECUTABLE_PATH = YesPlease
+-
+-      # Workaround for `gettext` being keg-only and not even being linked via
+-      # `brew link --force gettext`, should be obsolete as of
+-      # https://github.com/Homebrew/homebrew-core/pull/53489
+-      ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y)
+-              BASIC_CFLAGS += -I/usr/local/include 
-I/usr/local/opt/gettext/include
+-              BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib
+-              ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo 
y),y)
+-                      MSGFMT = /usr/local/opt/gettext/bin/msgfmt
+-              endif
+-      endif
+ endif
+ ifeq ($(uname_S),SunOS)
+       NEEDS_SOCKET = YesPlease

diff --git a/dev-vcs/git/git-2.31.0-r1.ebuild b/dev-vcs/git/git-2.31.0-r1.ebuild
index 5aeda5d427f..bfb176d4710 100644
--- a/dev-vcs/git/git-2.31.0-r1.ebuild
+++ b/dev-vcs/git/git-2.31.0-r1.ebuild
@@ -260,6 +260,11 @@ src_prepare() {
 
        default
 
+       if use prefix ; then
+               # bug #757309
+               eapply "${FILESDIR}"/git-2.31.0-darwin-prefix-gettext.patch
+       fi
+
        sed -i \
                -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
                -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \

diff --git a/dev-vcs/git/git-9999-r1.ebuild b/dev-vcs/git/git-9999-r1.ebuild
index 62714c732f6..ff37be69674 100644
--- a/dev-vcs/git/git-9999-r1.ebuild
+++ b/dev-vcs/git/git-9999-r1.ebuild
@@ -260,6 +260,11 @@ src_prepare() {
 
        default
 
+       if use prefix ; then
+               # bug #757309
+               eapply "${FILESDIR}"/git-2.31.0-darwin-prefix-gettext.patch
+       fi
+
        sed -i \
                -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
                -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \

diff --git a/dev-vcs/git/git-9999-r2.ebuild b/dev-vcs/git/git-9999-r2.ebuild
index 62714c732f6..ff37be69674 100644
--- a/dev-vcs/git/git-9999-r2.ebuild
+++ b/dev-vcs/git/git-9999-r2.ebuild
@@ -260,6 +260,11 @@ src_prepare() {
 
        default
 
+       if use prefix ; then
+               # bug #757309
+               eapply "${FILESDIR}"/git-2.31.0-darwin-prefix-gettext.patch
+       fi
+
        sed -i \
                -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
                -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \

diff --git a/dev-vcs/git/git-9999-r3.ebuild b/dev-vcs/git/git-9999-r3.ebuild
index b23ee2eb4c2..c60eee31d41 100644
--- a/dev-vcs/git/git-9999-r3.ebuild
+++ b/dev-vcs/git/git-9999-r3.ebuild
@@ -260,6 +260,11 @@ src_prepare() {
 
        default
 
+       if use prefix ; then
+               # bug #757309
+               eapply "${FILESDIR}"/git-2.31.0-darwin-prefix-gettext.patch
+       fi
+
        sed -i \
                -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
                -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \

diff --git a/dev-vcs/git/git-9999.ebuild b/dev-vcs/git/git-9999.ebuild
index 44f31ec8aa9..ef8a11391cf 100644
--- a/dev-vcs/git/git-9999.ebuild
+++ b/dev-vcs/git/git-9999.ebuild
@@ -260,6 +260,11 @@ src_prepare() {
 
        default
 
+       if use prefix ; then
+               # bug #757309
+               eapply "${FILESDIR}"/git-2.31.0-darwin-prefix-gettext.patch
+       fi
+
        sed -i \
                -e 's:^\(CFLAGS[[:space:]]*=\).*$:\1 $(OPTCFLAGS) -Wall:' \
                -e 's:^\(LDFLAGS[[:space:]]*=\).*$:\1 $(OPTLDFLAGS):' \

Reply via email to