Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[msmtp] Incorrect LOCALEDIR #22187

Open
2 of 6 tasks
mlt opened this issue Oct 14, 2024 · 3 comments
Open
2 of 6 tasks

[msmtp] Incorrect LOCALEDIR #22187

mlt opened this issue Oct 14, 2024 · 3 comments
Labels

Comments

@mlt
Copy link

mlt commented Oct 14, 2024

Description / Steps to reproduce the issue

As it is, LOCALEDIR points to D:/a/MSYS64. That part should be stripped. LOCALEDIR should be just /ucrt64/share/locale by using ./configure … CFLAGS=-DLOCALEDIR=/ucrt64/share/locale. I'm actually not sure where it is coming from... default ./configure yields localedir_c='"/ucrt64/share/locale"' in my config.log.

$ LANG=pt_BR msmtp --version
$ pacman -Ql mingw-w64-ucrt-x86_64-msmtp | grep pt_BR
mingw-w64-ucrt-x86_64-msmtp /ucrt64/share/locale/pt_BR/
mingw-w64-ucrt-x86_64-msmtp /ucrt64/share/locale/pt_BR/LC_MESSAGES/
mingw-w64-ucrt-x86_64-msmtp /ucrt64/share/locale/pt_BR/LC_MESSAGES/msmtp.mo

Expected behavior

One can remap things to get it work

$ subst.exe d: c:\\
$ cmd.exe //C "mklink /J C:\a C:\"
$ LANG=pt_BR msmtp --version
msmtp versao 1.8.23
Plataforma: x86_64-w64-mingw32
Biblioteca TLS/SSL: GnuTLS
Biblioteca de autenticaçao: interno
Métodos de autenticaçao suportados:
plain external cram-md5 login oauthbearer xoauth2
Suporte a IDN: habilitado
NLS: habilitado, LOCALEDIR é D:/a/msys64/ucrt64/share/locale
Suporte a chaveiro: GNOME
Nome do arquivo de configuraçao do sistema: C:\ProgramData\msmtprc.txt
Nome do arquivo de configuraçao do usuário: C:\Users\mlt\msmtprc.txt

Copyright (C) 2023 Martin Lambers and others.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Actual behavior

msmtp can't find its translations.

$ LANG=pt_BR msmtp --version
msmtp version 1.8.23
Platform: x86_64-w64-mingw32
TLS/SSL library: GnuTLS
Authentication library: built-in
Supported authentication methods:
plain external cram-md5 login oauthbearer xoauth2
IDN support: enabled
NLS: enabled, LOCALEDIR is D:/a/msys64/ucrt64/share/locale
Keyring support: Gnome
System configuration file name: C:\ProgramData\msmtprc.txt
User configuration file name: C:\Users\mlt\msmtprc.txt

Copyright (C) 2023 Martin Lambers and others.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Verification

Windows Version

MINGW64_NT-10.0-22000

MINGW environments affected

  • MINGW64
  • MINGW32
  • UCRT64
  • CLANG64
  • CLANGARM64

Are you willing to submit a PR?

No response

@mlt mlt added the bug label Oct 14, 2024
@Kreijstal
Copy link
Contributor

maybe try MSYS2_ARG_CONV_EXCL="*" ?

@mlt
Copy link
Author

mlt commented Oct 15, 2024

It is odd… If I build the package on my machine, everything works as expected without remapping. msmtp uses LOCALEDIR as supplied by autotools and I see correct value starting with /ucrt64 in Makefile and config.log.

config.log (I had to add CFLAGS=-Wno-incompatible-pointer-types)

  $ ../msmtp-1.8.23/configure --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --prefix=/ucrt64 CFLAGS=-Wno-incompatible-pointer-types

src/Makefile (only relevant lines)

prefix = /ucrt64
datarootdir = ${prefix}/share
localedir = ${datarootdir}/locale
DEFS = -DHAVE_CONFIG_H -DSYSCONFDIR=\"$(sysconfdir)\" \
	-DLOCALEDIR=\"$(localedir)\" -DBINDIR=\"$(bindir)\"

There is no logic in the code. https://github.com/marlam/msmtp/blob/master/src/msmtp.c#L2237 and https://github.com/marlam/msmtp/blob/master/src/msmtp.c#L3817

@mlt
Copy link
Author

mlt commented Oct 15, 2024

I almost feel like the following would fix it. But I'm not sure what gets there on a build farm… I mean if it is D:.

diff --git a/mingw-w64-msmtp/PKGBUILD b/mingw-w64-msmtp/PKGBUILD
index 98916b3f3..aae2e3636 100644
--- a/mingw-w64-msmtp/PKGBUILD
+++ b/mingw-w64-msmtp/PKGBUILD
@@ -42,6 +42,7 @@ build() {
     --host=${MINGW_CHOST} \
     --prefix=${MINGW_PREFIX}

+  sed -i 's/\/d\/a//' src/Makefile
   sed -i 's/-R\/mingw..\/lib//' src/Makefile
   touch ${srcdir}/${_realname}-${pkgver}/src/*.c
   make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants