-
Notifications
You must be signed in to change notification settings - Fork 38
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
[nix] Add nix derivation for static builds #21
Conversation
Utilize nix's `.pkgsStatic` for musl based statically linked binary. Replacing gnutls with openssl for better musl support. `msmtp --version` with following result: ``` msmtp version 1.8.10 Platform: x86_64-unknown-linux-musl TLS/SSL library: OpenSSL Authentication library: built-in Supported authentication methods: plain external cram-md5 login oauthbearer IDN support: disabled NLS: enabled, LOCALEDIR is /usr/share/locale Keyring support: none System configuration file name: /etc/msmtprc User configuration file name: /home/hswong3i/.msmtprc Copyright (C) 2020 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. ``` Signed-off-by: Wong Hoi Sing Edison <[email protected]>
Hi, this pull request is probably not for msmtp, but for the nix project, right? |
@marlam the nixpkgs have a version of msmtp: https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/msmtp/default.nix But the target is for dynamically linked binary with nix independent folder structure; this PR is target to “use nix to compile msmtp as statically linked binary” so they are different. As a msmtp and msmtpd user for more then year, with repackaging it into Ansible Role (https://github.com/alvistack/ansible-role-msmtp) and Docker image (https://github.com/alvistack/docker-msmtp) for Kubernetes use cases, current msmtp coming with some limitation:
Other detail reasons could be reference from here: containers/buildah#2380 (comment); providing a statically linked binary solution inside msmtp repo shouldn’t with negative drawbacks. Moreover @marlam this PR also trigger some else improvements potential:
Therefore if we could improve about points and include those tricks inside msmtp repo, that could be a good reference for people who looking for similar solution, e.g. https://marlam.de/msmtp/old-mailinglist/msg00637.html |
We generally don't have package build rules as part of msmtp; it's source code only. It does not make sense to start including package build rules for the infinte number of systems, configurations, and use cases that exist. I would suggest to set up a repository and/or web site dedicated to your goals and host these packaging scripts there. |
Yes for sure: https://github.com/alvistack/msmtp/releases/tag/msmtp-1.8.10; I need it to simplify my daily life by simply download the statically linked binary; it may also useful as part of msmtp official release since now a day most project provide it as baseline failsafe alternative installation method ;-) BTW, could I request for some help to compile msmtp + gnutls + gsasl + libidn + glibc here? As a repackager it is not simple for handle it... |
I can help with msmtp, but not with the rest. Note that you typically do not need gsasl anymore (only for GSSAPI authentication) and with recent glibc and gnutls versions you also do not need libidn anymore. |
Utilize nix's
.pkgsStatic
for musl based statically linked binary.Replacing gnutls with openssl for better musl support.
msmtp --version
with following result:Signed-off-by: Wong Hoi Sing Edison [email protected]