Unverified Commit 486911d0 authored by Fabián Heredia Montiel's avatar Fabián Heredia Montiel Committed by GitHub
Browse files

Merge pull request #265641 from vifino/opensmtpd-7.4.0p0

opensmtpd: 6.8.0p2 -> 7.4.0p0
parents 3e9437c1 c47c50fd
Loading
Loading
Loading
Loading
+21 −14
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, autoconf, automake, libtool, bison
, libasr, libevent, zlib, libressl, db, pam, libxcrypt, nixosTests
{ lib
, stdenv
, fetchurl
, autoreconfHook
, autoconf-archive
, pkgconf
, libtool
, bison
, libasr
, libevent
, zlib
, libressl
, db
, pam
, libxcrypt
, nixosTests
}:

stdenv.mkDerivation rec {
  pname = "opensmtpd";
  version = "6.8.0p2";
  version = "7.4.0p0";

  nativeBuildInputs = [ autoconf automake libtool bison ];
  buildInputs = [ libasr libevent zlib libressl db pam libxcrypt ];
  nativeBuildInputs = [ autoreconfHook autoconf-archive pkgconf libtool bison ];
  buildInputs = [ libevent zlib libressl db pam libxcrypt ];

  src = fetchurl {
    url = "https://www.opensmtpd.org/archives/${pname}-${version}.tar.gz";
    sha256 = "05sd7bmq29ibnqbl2z53hiyprfxzf0qydfdaixs68rz55wqhbgsi";
    hash = "sha256-wYHMw0NKEeWDYZ4AAoUg1Ff+Bi403AO+6jWAeCIM43Q=";
  };

  patches = [
    ./proc_path.diff # TODO: upstream to OpenSMTPD, see https://github.com/NixOS/nixpkgs/issues/54045
    ./cross_fix.diff # TODO: remove when https://github.com/OpenSMTPD/OpenSMTPD/pull/1177 will have made it into a release
  ];

  # See https://github.com/OpenSMTPD/OpenSMTPD/issues/885 for the `sh bootstrap`
  # requirement
  postPatch = ''
    substituteInPlace mk/smtpctl/Makefile.am --replace "chgrp" "true"
    substituteInPlace mk/smtpctl/Makefile.am --replace "chmod 2555" "chmod 0555"
    sh bootstrap
  '';

  configureFlags = [
@@ -43,9 +53,6 @@ stdenv.mkDerivation rec {
    "--with-table-db"
  ];

  # See https://github.com/OpenSMTPD/OpenSMTPD/pull/884
  makeFlags = [ "CFLAGS=-ffunction-sections" "LDFLAGS=-Wl,--gc-sections" ];

  installFlags = [
    "sysconfdir=\${out}/etc"
    "localstatedir=\${TMPDIR}"
@@ -59,7 +66,7 @@ stdenv.mkDerivation rec {
    '';
    license = licenses.isc;
    platforms = platforms.linux;
    maintainers = with maintainers; [ obadz ekleog ];
    maintainers = with maintainers; [ obadz ekleog vifino ];
  };
  passthru.tests = {
    basic-functionality-and-dovecot-interaction = nixosTests.opensmtpd;