diff --git a/pkgs/servers/mail/postfix/default.nix b/pkgs/servers/mail/postfix/default.nix index 1093e8a8d1ce..56380ed4b6ee 100644 --- a/pkgs/servers/mail/postfix/default.nix +++ b/pkgs/servers/mail/postfix/default.nix @@ -25,11 +25,11 @@ let in stdenv.mkDerivation rec { pname = "postfix"; - version = "3.7.3"; + version = "3.7.4"; src = fetchurl { url = "http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/${pname}-${version}.tar.gz"; - hash = "sha256-0i89N+91YT1dVztW/FHvCX8sDQsOQHkjcR9xwftykRs="; + hash = "sha256-TBN6IwNEjyWZODaDfe6uh/rF1NA68Rrejpvq2AYyhkU="; }; nativeBuildInputs = [ makeWrapper m4 ]; @@ -53,9 +53,6 @@ in stdenv.mkDerivation rec { url = "https://src.fedoraproject.org/rpms/postfix/raw/2f9d42453e67ebc43f786d98262a249037f80a77/f/postfix-3.6.2-glibc-234-build-fix.patch"; sha256 = "sha256-xRUL5gaoIt6HagGlhsGwvwrAfYvzMgydsltYMWvl9BI="; }) - - # linux-6 compatibility - ./linux-6.patch ]; postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' @@ -104,7 +101,11 @@ in stdenv.mkDerivation rec { --prefix PATH ":" ${lib.makeBinPath [ coreutils findutils gnugrep gawk gnused ]} ''; - passthru.tests = { inherit (nixosTests) postfix postfix-raise-smtpd-tls-security-level; }; + passthru = { + tests = { inherit (nixosTests) postfix postfix-raise-smtpd-tls-security-level; }; + + updateScript = ./update.sh; + }; meta = with lib; { homepage = "http://www.postfix.org/"; diff --git a/pkgs/servers/mail/postfix/linux-6.patch b/pkgs/servers/mail/postfix/linux-6.patch deleted file mode 100644 index ee9a3be740a7..000000000000 --- a/pkgs/servers/mail/postfix/linux-6.patch +++ /dev/null @@ -1,26 +0,0 @@ -Extracted fix from postfix-3.8-20221006 snapshot: - https://github.com/vdukhovni/postfix/commit/b65530350fa4a7eee40946160fd80c3e1e0b63e5 ---- a/makedefs -+++ b/makedefs -@@ -627,7 +627,8 @@ EOF - : ${SHLIB_ENV="LD_LIBRARY_PATH=`pwd`/lib"} - : ${PLUGIN_LD="${CC-gcc} -shared"} - ;; -- Linux.[345].*) SYSTYPE=LINUX$RELEASE_MAJOR -+ Linux.[3456].*) -+ SYSTYPE=LINUX$RELEASE_MAJOR - case "$CCARGS" in - *-DNO_DB*) ;; - *-DHAS_DB*) ;; ---- a/src/util/sys_defs.h -+++ b/src/util/sys_defs.h -@@ -751,7 +751,8 @@ extern int initgroups(const char *, int); - /* - * LINUX. - */ --#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4) || defined(LINUX5) -+#if defined(LINUX2) || defined(LINUX3) || defined(LINUX4) || defined(LINUX5) \ -+ || defined(LINUX6) - #define SUPPORTED - #define UINT32_TYPE unsigned int - #define UINT16_TYPE unsigned short diff --git a/pkgs/servers/mail/postfix/update.sh b/pkgs/servers/mail/postfix/update.sh new file mode 100755 index 000000000000..eacb548bc002 --- /dev/null +++ b/pkgs/servers/mail/postfix/update.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl pcre common-updater-scripts + +set -eu -o pipefail + +# Expect the text in format of 'Source code |' +# Stable release goes first. +new_version="$(curl -s http://cdn.postfix.johnriley.me/mirrors/postfix-release/index.html | + pcregrep -o1 '"official/postfix-([0-9.]+)[.]tar[.]gz">' | head -n1)" +update-source-version postfix "$new_version"