forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
47 lines
1.3 KiB
Nix
47 lines
1.3 KiB
Nix
{lib, stdenv, fetchurl, tlsSupport ? true, openssl ? null}:
|
|
|
|
assert tlsSupport -> openssl != null;
|
|
|
|
stdenv.mkDerivation {
|
|
name = "ssmtp-2.64";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://debian/pool/main/s/ssmtp/ssmtp_2.64.orig.tar.bz2";
|
|
sha256 = "0dps8s87ag4g3jr6dk88hs9zl46h3790marc5c2qw7l71k4pvhr2";
|
|
};
|
|
|
|
# A request has been made to merge this patch into ssmtp.
|
|
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858781
|
|
patches = [ ./ssmtp_support_AuthPassFile_parameter.patch ];
|
|
|
|
configureFlags = [
|
|
"--sysconfdir=/etc"
|
|
(stdenv.lib.enableFeature tlsSupport "ssl")
|
|
];
|
|
|
|
postConfigure =
|
|
''
|
|
# Don't run the script that interactively generates a config file.
|
|
# Also don't install the broken, cyclic symlink /lib/sendmail.
|
|
sed -e '/INSTALLED_CONFIGURATION_FILE/d' \
|
|
-e 's|/lib/sendmail|$(TMPDIR)/sendmail|' \
|
|
-i Makefile
|
|
substituteInPlace Makefile \
|
|
--replace '$(INSTALL) -s' '$(INSTALL) -s --strip-program $(STRIP)'
|
|
'';
|
|
|
|
installFlags = [ "etcdir=$(out)/etc" ];
|
|
|
|
installTargets = [ "install" "install-sendmail" ];
|
|
|
|
buildInputs = stdenv.lib.optional tlsSupport openssl;
|
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString tlsSupport "-lcrypto";
|
|
|
|
meta = with lib; {
|
|
platforms = platforms.linux;
|
|
license = licenses.gpl2;
|
|
maintainers = with maintainers; [ basvandijk ];
|
|
};
|
|
}
|