I'm working on a CPAN distribution that can work on Win32 and *nix. However, in order for it to work on Win32, it requires another CPAN distribution (module) that can only be installed on Win32.
The problem with this is that, by declaring that module as a dependency, it fails to install on *nix machines. But it will not be really used/required on *nix machines, only when running on Win32.
My distribution uses ExtUtils::MakeMaker
and configures dependencies in the auto-generated hash %WriteMakefileArgs
.
I've tried editing Makefile.PL
to add or remove dependencies based on the OS running it. However, this doesn't really work for the generation of META.json
and META.yml
, which are generated based on the OS where I eventually execute make dist
. If I run it on Windows, then the Win32-only dependencies are added to those files and break the *nix install. If I run it on *nix, then the dependencies are not added and it may break the install on Win32 when the time to test the distribution comes.
Is there a way to define different dependencies for a specific OS, in a way that applications like CPAN
or CPANminus
can successfully work on each OS when installing the distribution?