{"thread":{"id":"29474","subject":"[PATCH] use 'installsitelib' even with NO_PERL_MAKEMAKER","startedAt":"2012-01-30T10:51:44Z","lastAt":"2012-02-06T20:34:29Z","messageCount":5,"participants":["Nicholas Harteau","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"183302","messageId":"24482D02-B773-4FE3-8FC7-92B8B4D8C0FA@spotify.com","threadId":"29474","inReplyTo":null,"subject":"[PATCH] use 'installsitelib' even with NO_PERL_MAKEMAKER","fromName":"Nicholas Harteau","fromEmail":"nrh@spotify.com","sentAt":"2012-01-30T10:51:44Z","receivedAt":"2012-01-30T10:51:44Z","isPatch":true,"sender":{"key":"nrh@spotify.com","avatar":null},"body":"perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker\nis not present.  perl can't \"use Git;\" in that scenario, as $prefix/lib\nisn't in perl's include path.\n\nThis patch installs Git.pm into perl's 'installsitelib', generally\n$prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't\npresent, Git.pm gets installed in a location where 'use Git;' just\nworks.\n\nfor some additional discussion, see:\nhttps://github.com/mxcl/homebrew/pull/8643\nhttps://github.com/mxcl/homebrew/issues/8620\n---\n perl/Makefile |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/perl/Makefile b/perl/Makefile\nindex b2977cd..2199eb1 100644\n--- a/perl/Makefile\n+++ b/perl/Makefile\n@@ -21,7 +21,7 @@ clean:\n \t$(RM) $(makfile).old\n \n ifdef NO_PERL_MAKEMAKER\n-instdir_SQ = $(subst ','\\'',$(prefix)/lib)\n+instdir_SQ = $(subst ','\\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))\n $(makfile): ../GIT-CFLAGS Makefile\n \techo all: private-Error.pm Git.pm > $@\n \techo '\tmkdir -p blib/lib' >> $@\n-- \n1.7.8.3\n\n--\nnicholas harteau\nnrh@spotify.com\n"},{"id":"184044","messageId":"7328033C-8A11-452D-A927-E81E2DC4ABD6@spotify.com","threadId":"29474","inReplyTo":"24482D02-B773-4FE3-8FC7-92B8B4D8C0FA@spotify.com","subject":"Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER","fromName":"Nicholas Harteau","fromEmail":"nrh@ikami.com","sentAt":"2012-02-06T19:38:20Z","receivedAt":"2012-02-06T19:38:20Z","isPatch":true,"sender":{"key":"nrh@ikami.com","avatar":null},"body":"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;'\n\nAny takers?\n\nOn Jan 30, 2012, at 11:51 AM, Nicholas Harteau wrote:\n\n> perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker\n> is not present.  perl can't \"use Git;\" in that scenario, as $prefix/lib\n> isn't in perl's include path.\n> \n> This patch installs Git.pm into perl's 'installsitelib', generally\n> $prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't\n> present, Git.pm gets installed in a location where 'use Git;' just\n> works.\n> \n> for some additional discussion, see:\n> https://github.com/mxcl/homebrew/pull/8643\n> https://github.com/mxcl/homebrew/issues/8620\n> ---\n> perl/Makefile |    2 +-\n> 1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/perl/Makefile b/perl/Makefile\n> index b2977cd..2199eb1 100644\n> --- a/perl/Makefile\n> +++ b/perl/Makefile\n> @@ -21,7 +21,7 @@ clean:\n> \t$(RM) $(makfile).old\n> \n> ifdef NO_PERL_MAKEMAKER\n> -instdir_SQ = $(subst ','\\'',$(prefix)/lib)\n> +instdir_SQ = $(subst ','\\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))\n> $(makfile): ../GIT-CFLAGS Makefile\n> \techo all: private-Error.pm Git.pm > $@\n> \techo '\tmkdir -p blib/lib' >> $@\n> -- \n> 1.7.8.3\n> \n> --\n> nicholas harteau\n> nrh@spotify.com\n> \n> \n> \n> \n\n--\nnicholas harteau\nnrh@spotify.com\n"},{"id":"184052","messageId":"20120206202610.GC30776@sigill.intra.peff.net","threadId":"29474","inReplyTo":"7328033C-8A11-452D-A927-E81E2DC4ABD6@spotify.com","subject":"Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-06T20:26:10Z","receivedAt":"2012-02-06T20:26:10Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 06, 2012 at 02:38:20PM -0500, Nicholas Harteau wrote:\n\n> > perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker\n> > is not present.  perl can't \"use Git;\" in that scenario, as $prefix/lib\n> > isn't in perl's include path.\n> > \n> > This patch installs Git.pm into perl's 'installsitelib', generally\n> > $prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't\n> > present, Git.pm gets installed in a location where 'use Git;' just\n> > works.\n> [...]\n> > ifdef NO_PERL_MAKEMAKER\n> > -instdir_SQ = $(subst ','\\'',$(prefix)/lib)\n> > +instdir_SQ = $(subst ','\\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))\n\nIsn't this a regression if I am a non-root user installing into\n$HOME/local or similar? With MakeMaker, I end up with this in my\nperl.mak:\n\n  PREFIX = /home/peff/local\n  ...\n  SITEPREFIX = $(PREFIX)\n  ...\n  INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.14.2\n\nwhich works great.  Before your patch, without MakeMaker, git would\ninstall into /home/peff/local/lib, which is also OK. But with your\npatch, it will try:\n\n  $ perl -V:installsitelib\n  installsitelib='/usr/local/share/perl/5.14.2';\n\nwhich is not writable by me, and the install will fail.\n\nI know it's more convenient for some uses, because we know that\ninstallsitelib will be in perl's @INC. But git has always installed out\nof the box for non-root users, and I don't think we want to change that.\n\n-Peff\n"},{"id":"184053","messageId":"9D199309-85A6-42EE-9417-8C4E61534670@spotify.com","threadId":"29474","inReplyTo":"20120206202610.GC30776@sigill.intra.peff.net","subject":"Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER","fromName":"Nicholas Harteau","fromEmail":"nrh@ikami.com","sentAt":"2012-02-06T20:30:54Z","receivedAt":"2012-02-06T20:30:54Z","isPatch":true,"sender":{"key":"nrh@ikami.com","avatar":null},"body":"On Feb 6, 2012, at 3:26 PM, Jeff King wrote:\n\n> On Mon, Feb 06, 2012 at 02:38:20PM -0500, Nicholas Harteau wrote:\n> \n>>> perl/Makefile installs Git.pm into $prefix/lib when ExtUtils::MakeMaker\n>>> is not present.  perl can't \"use Git;\" in that scenario, as $prefix/lib\n>>> isn't in perl's include path.\n>>> \n>>> This patch installs Git.pm into perl's 'installsitelib', generally\n>>> $prefix/lib/perl5/site_perl, so that even when ExtUtils::MakeMaker isn't\n>>> present, Git.pm gets installed in a location where 'use Git;' just\n>>> works.\n>> [...]\n>>> ifdef NO_PERL_MAKEMAKER\n>>> -instdir_SQ = $(subst ','\\'',$(prefix)/lib)\n>>> +instdir_SQ = $(subst ','\\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))\n> \n> Isn't this a regression if I am a non-root user installing into\n> $HOME/local or similar? With MakeMaker, I end up with this in my\n> perl.mak:\n> \n>  PREFIX = /home/peff/local\n>  ...\n>  SITEPREFIX = $(PREFIX)\n>  ...\n>  INSTALLSITELIB = $(SITEPREFIX)/share/perl/5.14.2\n> \n> which works great.  Before your patch, without MakeMaker, git would\n> install into /home/peff/local/lib, which is also OK. But with your\n> patch, it will try:\n> \n>  $ perl -V:installsitelib\n>  installsitelib='/usr/local/share/perl/5.14.2';\n> \n> which is not writable by me, and the install will fail.\n> \n> I know it's more convenient for some uses, because we know that\n> installsitelib will be in perl's @INC. But git has always installed out\n> of the box for non-root users, and I don't think we want to change that.\n\n\nTotally correct - let me re-think the non-root case.  Thanks.\n\n\n\n--\nNicholas Harteau\nnrh@spotify.com\n"},{"id":"184054","messageId":"20120206203429.GA31404@sigill.intra.peff.net","threadId":"29474","inReplyTo":"9D199309-85A6-42EE-9417-8C4E61534670@spotify.com","subject":"Re: [PATCH] perl/Makefile: use 'installsitelib' even with NO_PERL_MAKEMAKER","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-06T20:34:29Z","receivedAt":"2012-02-06T20:34:29Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Feb 06, 2012 at 03:30:54PM -0500, Nicholas Harteau wrote:\n\n> >>> ifdef NO_PERL_MAKEMAKER\n> >>> -instdir_SQ = $(subst ','\\'',$(prefix)/lib)\n> >>> +instdir_SQ = $(subst ','\\'',$(subst installsitelib=,'',$(shell $(PERL_PATH_SQ) -V:installsitelib)))\n> > \n> > Isn't this a regression if I am a non-root user installing into\n> > $HOME/local or similar? With MakeMaker, I end up with this in my\n> > perl.mak:\n> [...]\n> \n> Totally correct - let me re-think the non-root case.  Thanks.\n\nI just read the github PR you linked to. It sounds like it might work to\njust add a knob that the homebrew recipe could tweak to enable this\nbehavior (with the knob off by default).\n\n-Peff\n"}]}