about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/mailreaders/sylpheed/default.nix
blob: 90b7dbd28d4c7f3627c528dc6671a43f78208377 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib, stdenv, fetchurl, pkg-config, gtk2, openssl ? null, gpgme ? null
, gpgSupport ? true, sslSupport ? true, fetchpatch, Foundation }:

assert gpgSupport -> gpgme != null;
assert sslSupport -> openssl != null;

stdenv.mkDerivation rec {
  pname = "sylpheed";
  version = "3.7.0";

  src = fetchurl {
    url = "https://sylpheed.sraoss.jp/sylpheed/v3.7/${pname}-${version}.tar.xz";
    sha256 = "0j9y5vdzch251s264diw9clrn88dn20bqqkwfmis9l7m8vmwasqd";
  };

  patches = [
    (fetchpatch {
      # patch upstream bug https://sylpheed.sraoss.jp/redmine/issues/306
      name = "patch-libsylph_ssl_c.patch";
      extraPrefix = "";
      url = "https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/mail/sylpheed/patches/patch-libsylph_ssl_c?rev=1.4&content-type=text/plain";
      sha256 = "sha256-+FetU5vrfvE78nYAjKK/QFZnFw+Zr2PvoUGRWCuZczs=";
    })
    (fetchpatch {
      name = "CVE-2021-37746.patch";
      url = "https://git.claws-mail.org/?p=claws.git;a=patch;h=ac286a71ed78429e16c612161251b9ea90ccd431";
      sha256 = "sha256-oLmUShtvO6io3jibKT67eO0O58vEDZEeaB51QTd3UkU=";
    })
  ];

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ gtk2 ]
    ++ lib.optionals gpgSupport [ gpgme ]
    ++ lib.optionals sslSupport [ openssl ]
    ++ lib.optionals stdenv.isDarwin [ Foundation ];

  configureFlags = lib.optional gpgSupport "--enable-gpgme"
    ++ lib.optional sslSupport "--enable-ssl";

  # Undefined symbols for architecture arm64: "_OBJC_CLASS_$_NSAutoreleasePool"
  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework Foundation";

  meta = with lib; {
    homepage = "https://sylpheed.sraoss.jp/en/";
    description = "Lightweight and user-friendly e-mail client";
    maintainers = with maintainers; [ eelco ];
    platforms = platforms.linux ++ platforms.darwin;
    license = licenses.gpl2;
  };
}