cmake/build: cryptopp-modern support + packager-friendly flags - #169
Conversation
|
Follow-up commit 2846e7d4 — keeping Both manifests updated: the Flathub submission yaml gets a clean one-line removal; the local |
2846e7d to
11c66d7
Compare
- Added to CMAKE_OFF: DEFAULT_VERSION_CHECK ENABLE_CCACHE and deleting corresponding old patches - Added ccache BUILD_DEPENDS to check that ccache is really OFF - pkg-plist was forced created to match default options (testing proposes) - a tarball was created from pull 169 for testing - there's a log in files dir for checking See also: amule-org/amule#169
- Using cryptopp-modern as build dep - Added to CMAKE_OFF: DEFAULT_VERSION_CHECK ENABLE_CCACHE and deleting corresponding old patches - Added ccache BUILD_DEPENDS to check that ccache is really OFF - pkg-plist was forced created to match default options (testing proposes) - a tarball was created from pull 169 for testing - there's a log in files dir for checking See also: amule-org/amule#169
11c66d7 to
807686d
Compare
- Using cryptopp-modern as build dep - Added to CMAKE_OFF: DEFAULT_VERSION_CHECK ENABLE_CCACHE and deleting corresponding old patches - Added ccache BUILD_DEPENDS to check that ccache is really OFF - pkg-plist was forced created to match default options (testing proposes) - a tarball was created from pull 169 for testing - there's a log in files dir for checking See also: amule-org/amule#169
nunotexbsd
left a comment
There was a problem hiding this comment.
Hi!
I tested your PR #169 in a clean FreeBSD Poudriere environment (packager).
I removed our 4 local patches, and everything works perfectly.
- The Cryptopp-modern version check works great and is very clean.
- The new flags (-DENABLE_CCACHE=OFF and -DDEFAULT_VERSION_CHECK=OFF) are perfect for package maintainers.
(I've used ccache as a build depend to force is presence on env.) - The build and the run-test stage were both OK.
Thank you for the fast response and for this great cleanup.
Approve!
- Using cryptopp-modern as build dep - Added to CMAKE_OFF: DEFAULT_VERSION_CHECK ENABLE_CCACHE and deleting corresponding old patches - Added ccache BUILD_DEPENDS to check that ccache is really OFF - pkg-plist was forced created to match default options (testing proposes) - there's a log in files dir for checking See also: amule-org/amule#169
Two CRYPTOPP_VERSION encodings exist in the wild:
- Classic Crypto++ (weidai11/cryptopp/config_ver.h:53):
MAJOR*100 + MINOR*10 + REVISION
so 8.9.0 -> 890, max for v1.x..v9.x is 999.
- cryptopp-modern (https://github.com/cryptopp-modern/cryptopp-modern,
calendar versioning per config_ver.h:50):
YEAR*10000 + MONTH*100 + INCREMENT
so the 2026.6 build is 20260600. Always >= 20,240,000 for any
release from 2024 onwards.
The previous regex pass parsed 20260600 as "2.0.26.0.600" and tripped
MIN_CRYPTOPP_VERSION ("5.6"), making cryptopp-modern unbuildable
against aMule -- the symptom reported in issue amule-project#167.
The gap between 9,999 and 20,000,000 makes a single magnitude check
enough to disambiguate the two encodings without collision risk now
or in any realistic future, and would also gracefully accept a
hypothetical classic Crypto++ 10.x.y in the 1000-9999 range as
"clearly newer than MIN_CRYPTOPP_VERSION".
Refs: amule-project#167
Four small changes packagers asked for (FreeBSD ports has carried
local patches for these for years; rolling them upstream so the port
can drop them):
1. Move LICENSE.md from CMAKE_INSTALL_DATADIR to CMAKE_INSTALL_DOCDIR.
GNUInstallDirs convention puts copyright/licence files under
share/doc/<pkg>/ rather than share/<pkg>/, matching every distro's
FHS expectation.
2. Make the file-preview fallback platform-aware. The legacy command
was 'xterm -T "aMule Preview" -iconic -e mplayer "$file"' which
assumed both xterm and mplayer were installed; on macOS, modern
Linux desktops, and Windows that's no longer a reasonable
assumption. Replace with:
- macOS : 'open "$file"' -- LaunchServices opens
the user's registered
application for the
file type
- Windows: 'cmd /c start "" "$file"' -- same via shell
associations
- else : 'xdg-open "$file"' -- XDG MIME handler
The warning text now interpolates the per-platform helper name via
CFormat / "%s" so a new translatable string lands in the catalog.
The Windows helper-name string is itself translatable (it's English
prose); the macOS / xdg-open names stay as literal command names.
Preferences -> Misc -> Video player still takes precedence
regardless of platform.
3. Add -DENABLE_CCACHE=AUTO/ON/OFF. AUTO (default) preserves today's
behaviour: use ccache if find_program locates it, log "ccache not
found" otherwise. OFF skips the probe entirely -- distros that
already manage ccache via their own wrapper (FreeBSD ports,
Gentoo) don't want a second launcher chained in front. ON
hard-fails the configure if ccache isn't found, so CI that
*requires* ccache for cache-hit metrics fails fast instead of
silently building uncached.
4. Add -DDEFAULT_VERSION_CHECK=ON/OFF. Plumbs a #cmakedefine01 macro
into config.h that Preferences.cpp consumes for the initial state
of the "Check for new aMule version" toggle on fresh installs.
Default ON preserves today's behaviour for standalone / portable /
AppImage builds. OFF is what OS-package builds (apt, brew, ports)
typically want so the in-app updater doesn't compete with the
distro's package manager. Existing users' saved amule.conf is
unaffected -- the macro is only consulted at first-launch /
config-reset.
docs/INSTALL.md gains rows for both flags.
scripts/update-po.sh refresh. Two semantic changes:
1. The preview-warning msgid changed from
"...preferences (default is mplayer)."
to
"...preferences (default is %s)." (now c-format)
2. New msgid "the default Windows shell handler" -- the platform-
specific helper-name substituted into %s on Windows.
Everything else is location-comment churn from line shifts in
DownloadListCtrl.cpp and Preferences.cpp.
The previous commit refreshed po/*.po via scripts/update-po.sh after
the preview-warning msgid changed from "...default is mplayer)." to
"...default is %s).". msgmerge correctly carried each old translation
into the new (now c-format) entry but flagged the entries fuzzy --
which would force every translator who'd already done the work to
re-tap "approved" in Weblate for what is, semantically, the same
sentence.
For every language whose existing translation contained the literal
token "mplayer", substitute it for "%s" and drop the fuzzy flag. At
runtime CFormat fills %s with the per-platform default ("xdg-open" on
Linux/BSD, "open" on macOS, the translated "the default Windows shell
handler" string on Windows), so the visible sentence reads naturally
in each locale.
Languages whose translator never mentioned mplayer literally, or
whose msgstr was empty, stay fuzzy so a human reviews them.
27/40 updated: ast, ca, de, el, es, et_EE, eu, fi, fr, gl, hu, it,
it_CH, lt, nl, nn, pl, pt_BR, pt_PT, ro, ru, sl, sv, tr, uk, zh_CN,
zh_TW.
13/40 stay fuzzy (empty or non-literal msgstr): ar, bg, bn, cs, da,
en_GB, he, hr, ja, ko_KR, lv, sq, ta.
The earlier commit in this series moves LICENSE.md from share/ to
share/doc/amule/ (FHS / GNUInstallDirs convention). The flatpak
manifests' top-level 'cleanup: - /share/doc' rule would now strip
the licence file from the final bundle along with the third-party
README/licence files it was originally targeting (cryptopp, boost,
libupnp).
Drop /share/doc from the cleanup list in both manifests we ship:
- packaging/flathub/org.amule.aMule.yaml (Flathub submission)
- packaging/linux/flatpak/org.amule.aMule.yaml.in (local-build template;
the generated .yaml is
gitignored)
The bundle grows by a few KB of third-party doc files -- negligible
next to losing the licence. The .in template carries an inline
comment so a future reader doesn't re-add the rule; the Flathub
manifest stays comment-free per submission hygiene.
807686d to
5e0b786
Compare
Brings the developer compilation docs in line with what landed in amule-org/amule#169 (cryptopp-modern support + two packager-friendly cmake flags). * index.md: Crypto++ row in the Requirements table now notes "classic or cryptopp-modern", with a follow-up paragraph naming both upstreams and explaining the auto-detection. New rows in the Build Options table for `ENABLE_CCACHE` (AUTO/ON/OFF) and `DEFAULT_VERSION_CHECK` (ON/OFF). * linux.md / bsd.md: troubleshooting section for "Crypto++ version too old" now mentions cryptopp-modern as an alternative install path. Macos.md needs no change (its troubleshooting is about Homebrew path discovery, not version). Windows.md just links back to the central Build Options table and picks up the new rows automatically.
- now using main at 3.0.0-194-gb4be0deb4 Keeping some history here: - Using cryptopp-modern as build dep - Added to CMAKE_OFF: DEFAULT_VERSION_CHECK ENABLE_CCACHE and deleting corresponding old patches - Added ccache BUILD_DEPENDS to check that ccache is really OFF - pkg-plist was forced created to match default options (testing proposes) - there's a log in files dir for checking See also: amule-org/amule#169
- now using main at 3.0.0-194-gb4be0deb4 - main port is updated to use new build depends. Keeping some history here: - Using cryptopp-modern as build dep - Added to CMAKE_OFF: DEFAULT_VERSION_CHECK ENABLE_CCACHE and deleting corresponding old patches - pkg-plist was forced created to match default options (testing proposes) See also: amule-org/amule#169
- now using main at 3.0.0-194-gb4be0deb4 - main port is updated to use new build depends. Keeping some history here: - Using cryptopp-modern as build dep - Added to CMAKE_OFF: DEFAULT_VERSION_CHECK ENABLE_CCACHE and deleting corresponding old patches - pkg-plist was forced created to match default options (testing proposes) See also: amule-org/amule#169
|
@nunotexbsd a quick update, we renamed the flag DEFAULT_VERSION_CHECK to ENABLE_VERSION_CHECK. It now compiles the whole version-check feature out instead of just switching the default option to OFF. |

Summary
Five small, related changes. Four of these come from
freebsd/freebsd-ports/tree/main/net-p2p/amule/files— FreeBSD ports has been carrying them as local patches and asked them rolled upstream so the port can drop them. The fifth is the cryptopp-modern fix from #167.cmake/cryptopp.cmake— accept cryptopp-modern's calendarCRYPTOPP_VERSIONencoding. The previous regex parsed20260600as2.0.26.0.600and trippedMIN_CRYPTOPP_VERSION("5.6"). Threshold check disambiguates the two encodings without collision risk (classic max 999, calendar min ~20,240,000). Fixes cryptopp dependency alternative #167.CMakeLists.txt—install(LICENSE.md ...)destination moves fromCMAKE_INSTALL_DATADIRtoCMAKE_INSTALL_DOCDIR. Matches FHS / GNUInstallDirs convention.src/DownloadListCtrl.cpp— when no video player is configured, fall back to the platform's native opener:openon macOS,cmd /c start ""on Windows,xdg-openelsewhere. Replaces the legacyxterm -e mplayerfallback that assumed both xterm and mplayer were installed. The warning text gains a%splaceholder so the per-platform helper name is shown in the dialog. The Windows helper-name ("the default Windows shell handler") is itself translatable; the Unix command names (open/xdg-open) stay as literal tool names.-DENABLE_CCACHE=AUTO/ON/OFF(new flag, defaultAUTO).AUTOpreserves today's behaviour (use ccache if found).OFFskips thefind_program(ccache)probe entirely — useful for distros / build systems that already chain ccache via their own compiler wrapper and don't want a second launcher injected.ONhard-fails configure if ccache isn't found.-DDEFAULT_VERSION_CHECK=ON/OFF(new flag, defaultON). Plumbs a#cmakedefine01macro intoconfig.hthatPreferences.cppreads for the initial state of the "Check for new aMule version" toggle on fresh installs. OS-package builds typically wantOFFso the in-app updater doesn't compete with the distro's package manager. Existing users' savedamule.confis unaffected (only consulted at first-launch / config-reset).docs/INSTALL.mdgains rows for both flags.Catalogs
Two new msgids land in
po/amule.pot:"...preferences (default is %s)."(nowc-format, replaces"...preferences (default is mplayer).")"the default Windows shell handler"(the helper-name substituted into%son Windows)A third po commit substitutes
mplayer→%sin 27 languages whose existing translation contained the literal token and drops theirfuzzyflag — semantically the same sentence, so translators don't have to re-approve. The 11 languages with empty / non-literal msgstrs stayfuzzyfor a translator's eye. The new Windows handler msgid is empty / fuzzy in all locales (Weblate will pick it up).Test plan
crypto++ version 8.9.0 -- OKfrom the legacy branch.ENABLE_CCACHE=AUTOwith no ccache installed →-- ccache not foundwarn-only, configure succeeds.LICENSE.mdinstalls undershare/doc/amule/(DOCDIR) instead ofshare/amule/(DATADIR).aMule.app+amuled+amulecmd+ed2kclean.scripts/update-po.shround-trip confirms both new msgids carry through topo/amule.pot.-DENABLE_CCACHE=OFFskips thefind_program(ccache)probe entirely on a system that has ccache installed.-DDEFAULT_VERSION_CHECK=OFFproduces a build where a freshamule.confhasNewVersionCheck=0.Refs: #167