Commit f61fe051 authored by Sergei Trofimovich's avatar Sergei Trofimovich
Browse files

procmail: fix `clang-16` build

Without the change `procmail` build fails as:

    cc -O _autotst.c -o _autotst -lm
    _autotst.c:1:1: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
    main()
    ^
    int
    1 error generated.
parent 2ca3e867
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl }:
{ lib, stdenv, fetchurl, fetchpatch }:

stdenv.mkDerivation rec {
  pname = "procmail";
@@ -9,6 +9,16 @@ stdenv.mkDerivation rec {
    sha256 = "UU6kMzOXg+ld+TIeeUdx5Ih7mCOsVf2yRpcCz2m9OYk=";
  };

  patches = [
    # Fix clang-16 and gcc-14 build failures:
    #   https://github.com/BuGlessRB/procmail/pull/7
    (fetchpatch {
      name = "clang-16.patch";
      url = "https://github.com/BuGlessRB/procmail/commit/8cfd570fd14c8fb9983859767ab1851bfd064b64.patch";
      hash = "sha256-CaQeDKwF0hNOrxioBj7EzkCdJdsq44KwkfA9s8xK88g=";
    })
  ];

  # getline is defined differently in glibc now. So rename it.
  # Without the .PHONY target "make install" won't install anything on Darwin.
  postPatch = ''