Skip to content

build: replace Perl ExtUtils::MakeMaker with native CMake install#4617

Open
nabbi wants to merge 3 commits intoZoneMinder:masterfrom
nabbi:remove-makemaker-perl-install
Open

build: replace Perl ExtUtils::MakeMaker with native CMake install#4617
nabbi wants to merge 3 commits intoZoneMinder:masterfrom
nabbi:remove-makemaker-perl-install

Conversation

@nabbi
Copy link
Contributor

@nabbi nabbi commented Feb 11, 2026

This continues the journey of PR #4507

Inadvertently, ZM builds are ~40 seconds faster.
Please test your build pipelines.

Was debating about the quality of those man3 pages, ZoneMinder Man Page Audit for how I selected the ones included.

Curious to hear the teams thoughts about this approach.


Replace Perl ExtUtils::MakeMaker with native CMake install() directives for all ZoneMinder Perl module installation. MakeMaker was only copying .pm files — no XS compilation, no binary linking — and its hardcoded "Makefile" output name conflicts with cmake's generated
Makefile, causing thousands of "uninitialized value" warnings when worked around with FIRST_MAKEFILE.

  • Auto-detect Perl install path at configure time via perl -MConfig (vendorlib on Linux, sitelib on FreeBSD), overridable with
    -DZM_PERL_INSTALL_PATH=
  • Remove 3 perl+make subprocesses from the build, drop ExtUtils::MakeMaker as a build dependency
  • Delete MakeMaker scaffolding (Makefile.PL, MANIFEST, META.yml, Changes, README, test stub)
  • Replace ~6,000 auto-generated man3 pages (mostly WSDL stubs) with selective generation for 7 modules whose POD was audited and confirmed accurate
  • No change to installed file paths, DESTDIR support, configure_file() template processing, or ZM_PERL_SEARCH_PATH

Test plan

  • cmake .. output shows Perl module install path: with correct host path
  • cmake --build . --verbose — no perl Makefile.PL or make -f MakefilePerl invocations
  • DESTDIR=/tmp/zm-test cmake --install . installs ~3,102 .pm files, 0 .pm.in, 7 .3pm.gz man pages
  • grep '@Version@' on installed Base.pm — no unsubstituted markers
  • -DZM_PERL_INSTALL_PATH=/tmp/custom overrides the auto-detected path
  • -DBUILD_MAN=OFF skips man3 generation

nabbi and others added 3 commits February 15, 2026 14:47
MakeMaker was only used to copy .pm files — no XS compilation, no binary
linking, no dependency resolution. Its hardcoded "Makefile" output name
conflicts with cmake's generated Makefile for in-source builds, and using
FIRST_MAKEFILE=MakefilePerl causes thousands of "uninitialized value"
warnings because MM.pm stats the wrong file.

Replace with native CMake install(DIRECTORY ... FILES_MATCHING PATTERN
"*.pm") directives. Perl module install path is auto-detected at configure
time via `perl -MConfig` (vendorlib on Linux, sitelib on FreeBSD),
overridable with -DZM_PERL_INSTALL_PATH=<path>.

What's removed:
- ExtUtils::MakeMaker as build dependency
- Three perl+make subprocesses at build time (zmperlmodules,
  zmonvifmodules, zmonvifproxy build targets)
- ~6000 auto-generated man3 pages from WSDL stubs
- MakeMaker scaffolding: Makefile.PL, MANIFEST, META.yml, Changes,
  README, and t/ZoneMinder.t test stub

What's preserved:
- configure_file() for .pm.in templates (same behavior)
- ZM_PERL_SEARCH_PATH (independent mechanism, unchanged)
- Section 8 man pages for .pl scripts (Pod2Man.cmake, unaffected)
- DESTDIR support (CMake install() handles natively)
- Installed file paths (perl -MConfig returns same paths MakeMaker used)

Verified: 3102 .pm files installed, 0 .pm.in files, 0 .3pm man pages,
no @Version@ markers in generated files, DESTDIR and user override work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Generate man3 pages only for the 7 ZoneMinder Perl modules whose POD
documentation was audited and confirmed accurate:

  Verified accurate API docs:
  - ZoneMinder::Memory (shared memory API, 18 methods)
  - ZoneMinder::Logger (logging API, all levels/methods/options)
  - ZoneMinder::Control::Dahua (full PTZ method reference)

  Useful prose documentation:
  - ZoneMinder::Control::Reolink_HTTP (auth flow, config, features)
  - ZoneMinder::Control::Amcrest_HTTP (security warning, timing docs)
  - ZoneMinder::Control::Trendnet (setup guide, capability settings)
  - ZoneMinder::Control::Instar720p (CGI parameter reference)

The remaining ~3,100 modules (66 boilerplate skeletons, 3,005 WSDL
stubs, 14 with no POD) are excluded.

Build-time filenames use "/" separators to avoid GNU make's "::"
double-colon rule syntax conflict. Installed filenames use the
standard Perl "::" convention (e.g., ZoneMinder::Memory.3pm.gz).

Gated behind BUILD_MAN (default ON, same as section 8 script pages).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MakeMaker was only used to copy .pm files — no XS compilation, no binary
linking, no dependency resolution. Its hardcoded "Makefile" output name
conflicts with cmake's generated Makefile for in-source builds, and using
FIRST_MAKEFILE=MakefilePerl causes thousands of "uninitialized value"
warnings because MM.pm stats the wrong file.

Replace with native CMake install(DIRECTORY ... FILES_MATCHING PATTERN
"*.pm") directives. Perl module install path is auto-detected at configure
time via `perl -MConfig` (vendorlib on Linux, sitelib on FreeBSD),
overridable with -DZM_PERL_INSTALL_PATH=<path>.

What's removed:
- ExtUtils::MakeMaker as build dependency
- Three perl+make subprocesses at build time (zmperlmodules,
  zmonvifmodules, zmonvifproxy build targets)
- ~6000 auto-generated man3 pages from WSDL stubs
- MakeMaker scaffolding: Makefile.PL, MANIFEST, META.yml, Changes,
  README, and t/ZoneMinder.t test stub

What's preserved:
- configure_file() for .pm.in templates (same behavior)
- ZM_PERL_SEARCH_PATH (independent mechanism, unchanged)
- Section 8 man pages for .pl scripts (Pod2Man.cmake, unaffected)
- DESTDIR support (CMake install() handles natively)
- Installed file paths (perl -MConfig returns same paths MakeMaker used)

Verified: 3102 .pm files installed, 0 .pm.in files, 0 .3pm man pages,
no @Version@ markers in generated files, DESTDIR and user override work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nabbi nabbi force-pushed the remove-makemaker-perl-install branch from 69c409b to 90d81cf Compare February 15, 2026 20:48
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