summary refs log tree commit diff
path: root/pkgs/development/libraries/ucommon/default.nix
blob: 64afde3c53bdbcd24364c0698d5243210f4b6fc4 (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
{ stdenv, fetchurl, pkgconfig
, openssl ? null, zlib ? null, gnutls ? null
}:

let
  xor = a: b: (a || b) && (!(a && b));
in

assert xor (openssl != null) (gnutls != null);
assert !(xor (openssl != null) (zlib != null));

stdenv.mkDerivation rec {
  name = "ucommon-6.3.1";

  src = fetchurl {
    url = "mirror://gnu/commoncpp/${name}.tar.gz";
    sha256 = "1marbwbqnllhm9nh22lvyfjy802pgy1wx7j7kkpkasbm9r0sb6mm";
  };

  buildInputs = [ pkgconfig ];

  # disable flaky networking test
  postPatch = ''
    substituteInPlace test/stream.cpp \
      --replace 'ifndef UCOMMON_SYSRUNTIME' 'if 0'
  '';

  # ucommon.pc has link time depdendencies on -lssl, -lcrypto, -lz, -lgnutls
  propagatedBuildInputs = [ openssl zlib gnutls ];

  doCheck = true;

  meta = {
    description = "C++ library to facilitate using C++ design patterns";
    homepage = http://www.gnu.org/software/commoncpp/;
    license = stdenv.lib.licenses.lgpl3Plus;

    maintainers = with stdenv.lib.maintainers; [ viric ];
    platforms = stdenv.lib.platforms.linux;
  };
}