summary refs log tree commit diff
path: root/pkgs/development/libraries/ucommon/default.nix
blob: 53e10b468ba629d2c9bb3fd36f7b60e552245d2d (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-7.0.0";

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

  nativeBuildInputs = [ 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 = https://www.gnu.org/software/commoncpp/;
    license = stdenv.lib.licenses.lgpl3Plus;

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