NAME
Alien::Xrepo::MM - ExtUtils::MakeMaker integration for Alien::Xrepo
SYNOPSIS
# Makefile.PL
use v5.40;
use strict;
use warnings;
use Alien::Xrepo::MM;
Alien::Xrepo::MM->new(
module_name => 'Exotic::Raylib6',
dist_abstract => 'Build & install raylib 6 via xrepo',
dist_author => 'Sanko Robinson',
dist_version => 'v1.0.0',
license => 'zlib',
requires => { 'perl' => 'v5.40.0', 'Alien::Xrepo::Runtime' => 0 },
configure_requires => { 'Alien::Xrepo::MM' => 0 }
)->Write;
And the Exotic::Raylib6 class declares its recipe() once:
class Exotic::Raylib6 : isa(Alien::Xrepo::Runtime) {
method recipe {
return { name => 'Exotic-Raylib6', packages => [ { name => 'raylib' } ] };
}
}
DESCRIPTION
Alien::Xrepo::MM is the ExtUtils::MakeMaker sibling of Alien::Xrepo::MB. Dist authors who build with make instead of ./Build can swap out the build tool and change nothing else. The recipe is still declared once in the dist's module, the hermetic xrepo-snapshot.json still lands in blib/lib/auto/share/dist/, and make install safely relocates it because ExtUtils::MakeMaker copies the entirety of blib/lib.
Write() performs the same actions as "WriteMakefile" in ExtUtils::MakeMaker (arguments are translated the same way Alien::Xrepo::MB maps its properties), and then adds a pure_all dependency. Consequently, every make execution runs a tiny Perl freshness check; the xrepo pipeline only (re)runs when the snapshot is missing or older than the recipe inputs (Makefile.PL, lib/module.pm, the loaded engine modules, and any local recipes/ tree).
METHODS
new
my $mm = Alien::Xrepo::MM->new(
module_name => 'Alien::Foo',
# all of these are optional
dist_abstract => '...',
dist_author => 'Your Name',
dist_version => 'v1.0.0',
license => 'artistic_2',
requires => { ... },
configure_requires => { ... },
build_requires => { ... },
test_requires => { ... },
xrepo_snapshot => '...', # override the derived snapshot path
xrepo_share_dir => '...', # override the shallow-install root
xrepo_cache => 0, # bypass the engine's on-disk cache
xrepo_update_repo => 1 # refresh xrepo's repository index once
# and retry a failing install
);
Properties carry the exact same meanings as they do in Alien::Xrepo::MB: xrepo_snapshot defaults to blib/lib/auto/share/dist/<Dist/xrepo-snapshot.json>, xrepo_share_dir defaults to the snapshot's directory, xrepo_cache defaults to 0, and xrepo_update_repo defaults to 0.
Write
Writes the Makefile (and xrepo-mm.json, read by make) in the current directory. Called from Makefile.PL.
CONFIG FILE
Write() serializes xrepo-mm.json directly next to Makefile.PL. This file is how the make hook knows the module name, snapshot path, share dir, cache flag, and the update_repo toggle without risking shell-quoting issues. Running make realclean removes it (it is included in the clean FILES). It should never ship in the distribution: make sure to add it to MANIFEST.SKIP.
ALIEN::XREPO::MM::RUN
# invoked by the injected pure_all hook
perl -Ilib -MAlien::Xrepo::MM -e "Alien::Xrepo::MM::run('xrepo-mm.json')"
Re-reads the config file, rebuilds the snapshot when stale, and silently exits if everything is current. If the config file is absent, it skips quietly so a build that merely loaded the module remains unharmed.
SEE ALSO
Alien::Xrepo, Alien::Xrepo::MB, Alien::Xrepo::Build, ExtUtils::MakeMaker
LICENSE
Copyright (C) Sanko Robinson.
This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.
AUTHOR
Sanko Robinson https://github.com/sanko