git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] use 'installsitelib' even with NO_PERL_MAKEMAKER
@ 2012-01-30 10:51 Nicholas Harteau
  2012-02-06 19:38 ` [PATCH] perl/Makefile: " Nicholas Harteau
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Harteau @ 2012-01-30 10:51 UTC (permalink / raw)
  To: git

perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker
is not present.  perl can't "use Git;" in that scenario, as $prefix/lib
isn't in perl's include path.

This patch installs Git.pm into perl's 'installsitelib', generally
$prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't
present, Git.pm gets installed in a location where 'use Git;' just
works.

for some additional discussion, see:
https://github.com/mxcl/homebrew/pull/8643
https://github.com/mxcl/homebrew/issues/8620
---
 perl/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/perl/Makefile b/perl/Makefile
index b2977cd..2199eb1 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -21,7 +21,7 @@ clean:
 	$(RM) $(makfile).old
 
 ifdef NO_PERL_MAKEMAKER
-instdir_SQ = $(subst ','\'',$(prefix)/lib)
+instdir_SQ = $(subst ','\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))
 $(makfile): ../GIT-CFLAGS Makefile
 	echo all: private-Error.pm Git.pm > $@
 	echo '	mkdir -p blib/lib' >> $@
-- 
1.7.8.3

--
nicholas harteau
nrh@spotify.com

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER
  2012-01-30 10:51 [PATCH] use 'installsitelib' even with NO_PERL_MAKEMAKER Nicholas Harteau
@ 2012-02-06 19:38 ` Nicholas Harteau
  2012-02-06 20:26   ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Harteau @ 2012-02-06 19:38 UTC (permalink / raw)
  To: git

This is a boring patch, I know, but it affects anyone doing a vanilla git installation on an os that bundles perl but not ExtUtils::MakeMaker, which is quite common.  Git's own utilities in perl can use Git.pm, but any other perl programs will fail to 'use Git;'

Any takers?

On Jan 30, 2012, at 11:51 AM, Nicholas Harteau wrote:

> perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker
> is not present.  perl can't "use Git;" in that scenario, as $prefix/lib
> isn't in perl's include path.
> 
> This patch installs Git.pm into perl's 'installsitelib', generally
> $prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't
> present, Git.pm gets installed in a location where 'use Git;' just
> works.
> 
> for some additional discussion, see:
> https://github.com/mxcl/homebrew/pull/8643
> https://github.com/mxcl/homebrew/issues/8620
> ---
> perl/Makefile |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index b2977cd..2199eb1 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -21,7 +21,7 @@ clean:
> 	$(RM) $(makfile).old
> 
> ifdef NO_PERL_MAKEMAKER
> -instdir_SQ = $(subst ','\'',$(prefix)/lib)
> +instdir_SQ = $(subst ','\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))
> $(makfile): ../GIT-CFLAGS Makefile
> 	echo all: private-Error.pm Git.pm > $@
> 	echo '	mkdir -p blib/lib' >> $@
> -- 
> 1.7.8.3
> 
> --
> nicholas harteau
> nrh@spotify.com
> 
> 
> 
> 

--
nicholas harteau
nrh@spotify.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER
  2012-02-06 19:38 ` [PATCH] perl/Makefile: " Nicholas Harteau
@ 2012-02-06 20:26   ` Jeff King
  2012-02-06 20:30     ` Nicholas Harteau
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff King @ 2012-02-06 20:26 UTC (permalink / raw)
  To: Nicholas Harteau; +Cc: git

On Mon, Feb 06, 2012 at 02:38:20PM -0500, Nicholas Harteau wrote:

> > perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker
> > is not present.  perl can't "use Git;" in that scenario, as $prefix/lib
> > isn't in perl's include path.
> > 
> > This patch installs Git.pm into perl's 'installsitelib', generally
> > $prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't
> > present, Git.pm gets installed in a location where 'use Git;' just
> > works.
> [...]
> > ifdef NO_PERL_MAKEMAKER
> > -instdir_SQ = $(subst ','\'',$(prefix)/lib)
> > +instdir_SQ = $(subst ','\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))

Isn't this a regression if I am a non-root user installing into
$HOME/local or similar? With MakeMaker, I end up with this in my
perl.mak:

  PREFIX = /home/peff/local
  ...
  SITEPREFIX = $(PREFIX)
  ...
  INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.14.2

which works great.  Before your patch, without MakeMaker, git would
install into /home/peff/local/lib, which is also OK. But with your
patch, it will try:

  $ perl -V:installsitelib
  installsitelib='/usr/local/share/perl/5.14.2';

which is not writable by me, and the install will fail.

I know it's more convenient for some uses, because we know that
installsitelib will be in perl's @INC. But git has always installed out
of the box for non-root users, and I don't think we want to change that.

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER
  2012-02-06 20:26   ` Jeff King
@ 2012-02-06 20:30     ` Nicholas Harteau
  2012-02-06 20:34       ` Jeff King
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Harteau @ 2012-02-06 20:30 UTC (permalink / raw)
  To: Jeff King; +Cc: git

On Feb 6, 2012, at 3:26 PM, Jeff King wrote:

> On Mon, Feb 06, 2012 at 02:38:20PM -0500, Nicholas Harteau wrote:
> 
>>> perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker
>>> is not present.  perl can't "use Git;" in that scenario, as $prefix/lib
>>> isn't in perl's include path.
>>> 
>>> This patch installs Git.pm into perl's 'installsitelib', generally
>>> $prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't
>>> present, Git.pm gets installed in a location where 'use Git;' just
>>> works.
>> [...]
>>> ifdef NO_PERL_MAKEMAKER
>>> -instdir_SQ = $(subst ','\'',$(prefix)/lib)
>>> +instdir_SQ = $(subst ','\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))
> 
> Isn't this a regression if I am a non-root user installing into
> $HOME/local or similar? With MakeMaker, I end up with this in my
> perl.mak:
> 
>  PREFIX = /home/peff/local
>  ...
>  SITEPREFIX = $(PREFIX)
>  ...
>  INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.14.2
> 
> which works great.  Before your patch, without MakeMaker, git would
> install into /home/peff/local/lib, which is also OK. But with your
> patch, it will try:
> 
>  $ perl -V:installsitelib
>  installsitelib='/usr/local/share/perl/5.14.2';
> 
> which is not writable by me, and the install will fail.
> 
> I know it's more convenient for some uses, because we know that
> installsitelib will be in perl's @INC. But git has always installed out
> of the box for non-root users, and I don't think we want to change that.


Totally correct - let me re-think the non-root case.  Thanks.



--
Nicholas Harteau
nrh@spotify.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER
  2012-02-06 20:30     ` Nicholas Harteau
@ 2012-02-06 20:34       ` Jeff King
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff King @ 2012-02-06 20:34 UTC (permalink / raw)
  To: Nicholas Harteau; +Cc: git

On Mon, Feb 06, 2012 at 03:30:54PM -0500, Nicholas Harteau wrote:

> >>> ifdef NO_PERL_MAKEMAKER
> >>> -instdir_SQ = $(subst ','\'',$(prefix)/lib)
> >>> +instdir_SQ = $(subst ','\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))
> > 
> > Isn't this a regression if I am a non-root user installing into
> > $HOME/local or similar? With MakeMaker, I end up with this in my
> > perl.mak:
> [...]
> 
> Totally correct - let me re-think the non-root case.  Thanks.

I just read the github PR you linked to. It sounds like it might work to
just add a knob that the homebrew recipe could tweak to enable this
behavior (with the knob off by default).

-Peff

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-02-06 20:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-30 10:51 [PATCH] use 'installsitelib' even with NO_PERL_MAKEMAKER Nicholas Harteau
2012-02-06 19:38 ` [PATCH] perl/Makefile: " Nicholas Harteau
2012-02-06 20:26   ` Jeff King
2012-02-06 20:30     ` Nicholas Harteau
2012-02-06 20:34       ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).