Bug 248341 - mail/phpmailer6: Fails to package with NLS=off: phpmailer.lang-af.php:No such file or directory
Summary: mail/phpmailer6: Fails to package with NLS=off: phpmailer.lang-af.php:No such...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jochen Neumeister
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2020-07-29 08:56 UTC by Andrej Ebert
Modified: 2025-11-11 08:27 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (joneum)
koobs: merge-quarterly?


Attachments
svn diff (4.47 KB, patch)
2020-07-29 08:56 UTC, Andrej Ebert
no flags Details | Diff
git diff (4.78 KB, patch)
2024-09-30 08:39 UTC, Andrej Ebert
andrej: maintainer-approval?
Details | Diff
Fix handling NLS option in pkg-plist (5.59 KB, patch)
2025-11-11 07:29 UTC, bsd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrej Ebert 2020-07-29 08:56:35 UTC
Created attachment 216852 [details]
svn diff

If the NLS option is unset, the pkg install throws errors like:

pkg-static: Unable to access file /usr/ports/mail/phpmailer6/work/stage/usr/local/share/phpmailer/language/phpmailer.lang-af.php:No such file or directory

for all the language files.

The attached patch fixes the pkg-plist, making the install of language files conditional on the NLS option.
Comment 1 Jochen Neumeister freebsd_committer freebsd_triage 2020-09-03 22:08:16 UTC
%%NLS%% cannot work because it is not defined in the Makefile. I can install it without problems with "pkg install".

if you think it is an mistake, open the pr again.
Comment 2 Andrej Ebert 2024-09-30 08:37:04 UTC
Reopening this, as it's bitten us again in our poudriere bulk builds.

As per https://docs.freebsd.org/en/books/porters-handbook/plist/#plist-sub:

For instance, if there are files that are only installed when the X11 option is enabled, and Makefile has:

OPTIONS_DEFINE=	X11
OPTIONS_SUB=	yes
In pkg-plist, put %%X11%% in front of the lines only being installed when the option is enabled, like this :

%%X11%%bin/foo-gui

So my patch with %%NLS%% (as it's defined as option in the Makefile) in front of the language files in the pkg-plist is valid.

I'll attach a new patch...
Comment 3 Andrej Ebert 2024-09-30 08:39:46 UTC
Created attachment 253903 [details]
git diff

With this patch phpmailer6 packages and installs right with "NLS=off"
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2025-05-06 04:03:28 UTC
^Triage: to maintainer: is there anything blocking this patch from being committed?
Comment 5 bsd 2025-11-11 07:28:29 UTC
This issue is still present today after latest version update. Actually I think the patch should be a bit different, adding %%NLS%% before %%DATADIR%%.
Comment 6 bsd 2025-11-11 07:29:17 UTC
Created attachment 265322 [details]
Fix handling NLS option in pkg-plist
Comment 7 bsd 2025-11-11 07:33:55 UTC
(In reply to Jochen Neumeister from comment #1)
Please try to build the port in clean environment and select option NLS off. Packages are created with all options default values, thus 'pkg install' is not sufficient test in my eyes...

Also, exactly the same patch should be used for mail/phpmailer7 port as it is bitten by the exactly same issue.
Comment 8 Paavo-Einari Kaipila 2025-11-11 08:27:51 UTC
I recommend using Composer to install any PHP libraries. Unlike with the ports tree, it is designed for that, you'll always get the latest version and bugs in ports won't bug you.