From 133a0bbf5f00031622c02bc4621f5a8449f99677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= Date: Sun, 9 Feb 2025 15:39:17 +0100 Subject: [PATCH] module_build: add support for HAIKU_USE_VENDOR_DIRECTORIES So that recipes using Module::Build don't need to specify that in their recipes. Ironically, Module::Build itself doesn't profit from that, because its build script overrides the default, so we have to set it on the command line still (or alternatively patch the build file). Also, unset the variable for tests, otherwise a test would have to be patched too. --- .../module_build/module_build-0.4234.recipe | 7 ++++- .../patches/module_build-0.4234.patchset | 27 +++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/dev-perl/module_build/module_build-0.4234.recipe b/dev-perl/module_build/module_build-0.4234.recipe index f186144e4..bc1b8d524 100644 --- a/dev-perl/module_build/module_build-0.4234.recipe +++ b/dev-perl/module_build/module_build-0.4234.recipe @@ -8,7 +8,7 @@ very cross-platform way." HOMEPAGE="https://metacpan.org/pod/distribution/Module-Build/lib/Module/Build.pm" COPYRIGHT="2001-2006 Ken Williams" LICENSE="Artistic" -REVISION="3" +REVISION="4" SOURCE_URI="https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-$portVersion.tar.gz" CHECKSUM_SHA256="66aeac6127418be5e471ead3744648c766bd01482825c5b66652675f2bc86a8f" SOURCE_DIR="Module-Build-$portVersion" @@ -34,6 +34,8 @@ BUILD_PREREQUIRES=" BUILD() { + # We do patch Module::Build to install into vendor directories by default in HaikuPorter, but + # this Build.PL script overrides it for historical reasons, so specify it manually still. perl Build.PL --installdirs vendor --prefix $prefix ./Build } @@ -50,5 +52,8 @@ INSTALL() TEST() { + unset HAIKU_USE_VENDOR_DIRECTORIES + # tests assume installation in site directories by default + ./Build test } diff --git a/dev-perl/module_build/patches/module_build-0.4234.patchset b/dev-perl/module_build/patches/module_build-0.4234.patchset index 6b687ad18..3c8f3ca74 100644 --- a/dev-perl/module_build/patches/module_build-0.4234.patchset +++ b/dev-perl/module_build/patches/module_build-0.4234.patchset @@ -1,4 +1,4 @@ -From b397d50d5f0b67cf25d555a9407963ee04173322 Mon Sep 17 00:00:00 2001 +From 18db2ea3c12b6fa184a6f21a2cd41fff85ff07cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= Date: Sun, 4 Aug 2024 21:07:10 +0200 Subject: hack to support naked 'perl' as the perl interpreter path @@ -34,7 +34,7 @@ index 10b653f..0ee2515 100644 2.45.2 -From 0b4e07616333ae4643d1a93606c2b201687a0845 Mon Sep 17 00:00:00 2001 +From a5bd63049b78b8f596b4a35825b5a92846c0c583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= Date: Sun, 5 Jan 2025 14:45:19 +0100 Subject: fix tests @@ -57,3 +57,26 @@ index 2aeda20..3620523 100644 -- 2.45.2 + +From 8cc76665e751cdc799b6be2d67f264e3fda9b391 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Joachim=20Mairb=C3=B6ck?= +Date: Sun, 9 Feb 2025 15:35:30 +0100 +Subject: Add support for HAIKU_USE_VENDOR_DIRECTORIES + + +diff --git a/lib/Module/Build/Base.pm b/lib/Module/Build/Base.pm +index 0ee2515..170137d 100644 +--- a/lib/Module/Build/Base.pm ++++ b/lib/Module/Build/Base.pm +@@ -917,7 +917,7 @@ __PACKAGE__->add_property(pureperl_only => 0); + __PACKAGE__->add_property(allow_pureperl => 0); + __PACKAGE__->add_property( + 'installdirs', +- default => 'site', ++ default => $ENV{'HAIKU_USE_VENDOR_DIRECTORIES'} ? 'vendor' : 'site', + check => sub { + return 1 if /^(core|site|vendor)$/; + return shift->property_error( +-- +2.45.2 +