build: replace Perl ExtUtils::MakeMaker with native CMake install#4617
Open
nabbi wants to merge 3 commits intoZoneMinder:masterfrom
Open
build: replace Perl ExtUtils::MakeMaker with native CMake install#4617nabbi wants to merge 3 commits intoZoneMinder:masterfrom
nabbi wants to merge 3 commits intoZoneMinder:masterfrom
Conversation
ec8e7a0 to
11e4837
Compare
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>
69c409b to
90d81cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
-DZM_PERL_INSTALL_PATH=
Test plan