git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Makefile: add PERLLIB_EXTRA variable that adds to default perl path

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 15, 2013, 21:10 UTC
Message-ID
<20131115211028.GE27781@google.com>
In-Reply-To
<20131115210604.GC27781@google.com>

Some platforms ship Perl modules used by git scripts outside the default perl path (e.g., on Mac OS X, Subversion's perl bindings live in a separate xcode perl path). Add an PERLLIB_EXTRA variable to hold a colon-separated list of extra directories to add to the perl path in git's scripts, as a convenience for packagers.

Requested-by: Dave Borowitz <dborowitz@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
Thanks for reading.
 Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e5e7868..67f1754 100644
--- a/Makefile
+++ b/Makefile
@@ -1588,6 +1588,7 @@ PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
 PYTHON_PATH_SQ = $(subst ','\'',$(PYTHON_PATH))
 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
 DIFF_SQ = $(subst ','\'',$(DIFF))
+PERLLIB_EXTRA_SQ = $(subst ','\'',$(PERLLIB_EXTRA))
 
 LIBS = $(GITLIBS) $(EXTLIBS)
 
@@ -1792,10 +1793,12 @@ perl/PM.stamp: FORCE
 perl/perl.mak: GIT-CFLAGS GIT-PREFIX perl/Makefile perl/Makefile.PL
 	$(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
 
-PERL_DEFINES = $(PERL_PATH_SQ)
+PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ)
 $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
 	$(QUIET_GEN)$(RM) $@ $@+ && \
 	INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
+	INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
+	INSTLIBDIR="$$INSTLIBDIR$${INSTLIBDIR_EXTRA:+:$$INSTLIBDIR_EXTRA}" && \
 	sed -e '1{' \
 	    -e '	s|#!.*perl|#!$(PERL_PATH_SQ)|' \
 	    -e '	h' \
-- 
1.8.4.1
Previous: Jonathan Nieder
Message 4 of 4 in “add PERLLIB_EXTRA to add to default perl path”
  1. 0/2 add PERLLIB_EXTRA to add to default perl pathJonathan Nieder, Nov 15, 2013
  2. 1/2 Makefile: rebuild perl scripts when perl paths changeJonathan Nieder, Nov 15, 2013
  3. 1/2 Makefile: rebuild perl scripts when perl paths changeJonathan Nieder, Nov 18, 2013
  4. 2/2 Makefile: add PERLLIB_EXTRA variable that adds to default perl pathJonathan Nieder, Nov 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.