]> Sergey Matveev's repositories - public-inbox.git/commitdiff
Makefile.PL: drop generated lib/PublicInbox.pm in blib/
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 19 Oct 2021 11:13:52 +0000 (13:13 +0200)
committerEric Wong <e@80x24.org>
Tue, 19 Oct 2021 11:46:14 +0000 (11:46 +0000)
Running "make test" on this project doesn't pass unless you've got an
existing PublicInbox.pm in your @INC, presumably nobody's set this up
on a fresh machine in a while.

This Makefile.PL trickery seems to do it, I've validated this with
this ad-hoc test of committing blib/ and Makefile to the repository:

    git clean -dxf; perl Makefile.PL && make -j8 all && git add -f blib Makefile.PL Makefile && git commit -m"now"

Running that in interactive rebase before/after shows that only the
PublicInbox.pm file was added to blib/lib/. We use $(INST_LIB) instead
of a hardcoded 'blib/lib' now, but it's what ExtUtils::MakeMaker
recommends, so it's probably for the better.

As far as I can tell this broke with 1fae720d (build: generate
PublicInbox.pm with $VERSION, 2021-04-01), but I have not tested
that. See also 1fae720d (build: generate PublicInbox.pm with $VERSION,
2021-04-01) which made the PublicInbox.pm a generated file.

Makefile.PL

index 348a343d7fa7a22dbc364d63976947035879b554..b3ac59be32eed944cca46c0d9e6f40c5e17a2d2f 100644 (file)
@@ -190,6 +190,16 @@ WriteMakefile(
                FILES => 't/home*/setup* t/home*/t* t/home*/.public-inbox '.
                        't/data-gen/*'
        },
+       PM => {
+               map {
+                       s[^lib/][]s;
+                       +('lib/' . $_ => '$(INST_LIB)/' . $_);
+               } grep {
+                       # Will include *.pod and an *.h file, but so
+                       # would ExtUtils::MakeMaker.
+                       m[^lib/];
+               } @manifest
+       },
 );
 
 sub MY::postamble {