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

Re: install does not obey DESTDIR or --prefix for perl modules

From
BCBrandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Date
Sep 22, 2009, 14:52 UTC
Message-ID
<Hfm4AdtlXpMutgmdj0vm7yb0ucfu_cijUloasBDWh6NfRCwLhP4OCA@cipher.nrlssc.navy.mil>
In-Reply-To
<20090922113151.GO8173@gryning.com>
Craig Taylor wrote:
Show 55 quoted lines
> On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
>> Craig Taylor <c@gryning.com> writes:
>>
>>> Exactly as you describe here, different paths but same goal.
>>> All binaries follow the DESTDIR path except the perl modules.
>>>
>>> To register this as a bug do I need to do more than send this email?
>> Do you use NO_PERL_MAKEMAKER in your build?
>>
>> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
>> this issue, but if you do, perhaps you can try this patch and report how
>> well it works for you.
>>
>> ---
>>  perl/Makefile |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/perl/Makefile b/perl/Makefile
>> index e3dd1a5..4ab21d6 100644
>> --- a/perl/Makefile
>> +++ b/perl/Makefile
>> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>>  	echo install: >> $@
>> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	echo instlibdir: >> $@
>>  	echo '	echo $(instdir_SQ)' >> $@
>>  else
> 
> 
> Further to my last email, modifying the perl.mak file as below resolves
> the problem for me to a satisfactory level.
> I will have to leave a more permanent solution to someone more familar with
> make/makemaker.
> 
> --- git-1.6.4.4/perl/perl.mak_to20090922        2009-09-22 12:07:18.000000000 +0100
> +++ git-1.6.4.4/perl/perl.mak   2009-09-22 12:21:17.791887000 +0100
> @@ -57,7 +57,7 @@
>  INST_LIB = blib/lib
>  INST_ARCHLIB = blib/arch
>  INST_SCRIPT = blib/script
> -PREFIX = /usr/local/git-1.6.4.4
> +PREFIX = $(DESTDIR)/usr/local/git-1.6.4.4
>  INSTALLDIRS = site
>  INSTALLPRIVLIB = $(PREFIX)/lib/5.6.1
>  INSTALLARCHLIB = $(PREFIX)/lib/5.6.1/sun4-solaris

I have not been able to reproduce your problem on Solaris. The DESTDIR feature is working for me.

Possibly it is related to the version of MakeMaker? I am using version 6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86. The MakeMaker version should be in the header at the top of the perl.mak file.

The perl.mak snippet that you provided above looks different than mine. In mine, in the vicinity of the 'PREFIX = ' line I also have a 'DESTDIR = ' line. The right hand side of 'DESTDIR = ' is empty even when I specify a DESTDIR on the make command line.

Here's a snippet from my perl.mak file:
   DESTDIR =
   PREFIX = /usr/local/git-1.6.4.4
   PERLPREFIX = $(PREFIX)
   SITEPREFIX = $(PREFIX)
   VENDORPREFIX = $(PREFIX)
   INSTALLPRIVLIB = $(PERLPREFIX)/lib
   DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
   INSTALLSITELIB = $(SITEPREFIX)/lib/site_perl
   DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
   INSTALLVENDORLIB = $(VENDORPREFIX)/lib
   DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
   INSTALLARCHLIB = $(PERLPREFIX)/lib/i86pc-solaris-64int
   DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)

Notice the variable assignments that begin with 'DEST'. Does your perl.mak file have those? If not, then it seems MakeMaker is not producing them for some reason.

Did you try Junio's patch? If the version of MakeMaker is the problem, then perhaps setting NO_PERL_MAKER=1 on the make command line along with Junio's patch is the best way forward for you.

-brandon
Previous: Craig TaylorNext: Brandon Casey
Message 12 of 22 in “install does not obey DESTDIR or --prefix for perl modules”
  1. Craig TaylorSep 21, 2009
  2. Brandon CaseySep 21, 2009
  3. Junio C HamanoSep 21, 2009
  4. Brandon CaseySep 21, 2009
  5. Craig TaylorSep 21, 2009
  6. Ben WaltonSep 21, 2009
  7. Craig TaylorSep 21, 2009
  8. Junio C HamanoSep 21, 2009
  9. Craig TaylorSep 21, 2009
  10. Craig TaylorSep 22, 2009
  11. Craig TaylorSep 22, 2009
  12. Brandon CaseySep 22, 2009
  13. Brandon CaseySep 22, 2009
  14. Junio C HamanoSep 22, 2009
  15. perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIRBrandon Casey, Sep 24, 2009
  16. perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIRBrandon Casey, Sep 24, 2009
  17. Johannes SixtOct 8, 2009
  18. Brandon CaseyOct 8, 2009
  19. Brandon CaseyOct 8, 2009
  20. Junio C HamanoOct 9, 2009
  21. c^Sep 22, 2009
  22. Brandon CaseySep 22, 2009

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.