Skip to content

Implement ExtUtils::MakeMaker for PerlOnJava (CPAN Phase 5)#315

Merged
fglock merged 5 commits into
masterfrom
feature/extutils-makemaker
Mar 14, 2026
Merged

Implement ExtUtils::MakeMaker for PerlOnJava (CPAN Phase 5)#315
fglock merged 5 commits into
masterfrom
feature/extutils-makemaker

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented Mar 14, 2026

Summary

This PR implements a PerlOnJava-specific ExtUtils::MakeMaker that enables installation of pure Perl CPAN modules without requiring make or native compilation.

Features

  • Pure Perl modules: Directly copies .pm files to the install directory
  • XS detection: Identifies .xs/.c files and provides guidance on porting to Java
  • Dependency checking: Reports missing PREREQ_PM dependencies
  • User library path: ~/.perlonjava/lib as default install location

Files Changed

  • src/main/perl/lib/ExtUtils/MakeMaker.pm - Main implementation
  • src/main/perl/lib/ExtUtils/MM.pm - Compatibility stub
  • src/main/perl/lib/ExtUtils/MY.pm - Compatibility stub
  • src/main/perl/lib/ExtUtils/MakeMaker/Config.pm - Config wrapper
  • src/main/java/org/perlonjava/runtime/runtimetypes/GlobalContext.java - Added ~/.perlonjava/lib to @INC
  • dev/design/cpan_client.md - Updated with Phase 5 completion
  • dev/design/makemaker_perlonjava.md - Design document

Usage

# Download a pure Perl CPAN module
tar xzf Some-Module-1.00.tar.gz
cd Some-Module-1.00

# Install with jperl
jperl Makefile.PL
# → Installs to ~/.perlonjava/lib/

# Use the module
jperl -e 'use Some::Module; ...'

Test Plan

  • Unit tests pass (163 tests)
  • Pure Perl module installation works
  • XS module detection works
  • Installed modules are accessible via @inc

Generated with Devin

fglock and others added 5 commits March 14, 2026 07:54
Add PerlOnJava-specific ExtUtils::MakeMaker that:
- Pure Perl modules: directly copies .pm files to install directory
- XS modules: detects .xs/.c files and provides porting guidance
- PREREQ_PM: checks dependencies and reports missing modules

Key features:
- WriteMakefile() intercepts standard Makefile.PL flow
- Default install path: ~/.perlonjava/lib
- Configurable via PERLONJAVA_LIB environment variable
- Compatibility stubs: ExtUtils::MM, MY, MakeMaker::Config

Also adds ~/.perlonjava/lib to @inc when the directory exists,
enabling use of installed modules without manual PERL5LIB setup.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
- Add Quick Start section for installing modules via MakeMaker
- Document ExtUtils::MakeMaker as Method 1 (recommended)
- Add XS detection output example
- Update available modules list with recent additions:
  - IPC::Open2, IPC::Open3
  - Sys::Hostname, Symbol, DirHandle
  - Net::SMTP, Net::POP3, Net::NNTP
  - IO::Socket::UNIX
  - ExtUtils::MakeMaker

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
Add using-cpan-modules.md to:
- README.md (main documentation)
- docs/README.md (docs index)

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock merged commit 2bc2955 into master Mar 14, 2026
2 checks passed
@fglock fglock deleted the feature/extutils-makemaker branch March 14, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant