user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: meta@public-inbox.org
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH] Makefile.PL: drop generated lib/PublicInbox.pm in blib/
Date: Tue, 19 Oct 2021 13:13:52 +0200	[thread overview]
Message-ID: <patch-1.1-dd7b7bae-20211019T111243Z-avarab@gmail.com> (raw)

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 | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Makefile.PL b/Makefile.PL
index 348a343d..b3ac59be 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -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 {
-- 
2.33.1.1338.g20da966911a


             reply	other threads:[~2021-10-19 11:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 11:13 Ævar Arnfjörð Bjarmason [this message]
2021-10-19 11:53 ` [PATCH] Makefile.PL: drop generated lib/PublicInbox.pm in blib/ Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=patch-1.1-dd7b7bae-20211019T111243Z-avarab@gmail.com \
    --to=avarab@gmail.com \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).