about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ucommon
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/ucommon')
-rw-r--r--nixpkgs/pkgs/development/libraries/ucommon/default.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/ucommon/default.nix b/nixpkgs/pkgs/development/libraries/ucommon/default.nix
new file mode 100644
index 000000000000..2ecf7729f4bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ucommon/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, pkg-config
+, 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 {
+  pname = "ucommon";
+  version = "7.0.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/commoncpp/${pname}-${version}.tar.gz";
+    sha256 = "6ac9f76c2af010f97e916e4bae1cece341dc64ca28e3881ff4ddc3bc334060d7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  # use C++14 Standard until error handling code gets updated upstream
+  CXXFLAGS = [ "-std=c++14" ];
+
+  # 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 = lib.licenses.lgpl3Plus;
+
+    maintainers = with lib.maintainers; [ ];
+    platforms = lib.platforms.linux;
+  };
+}