summary refs log tree commit diff
path: root/pkgs/tools/networking/davix
diff options
context:
space:
mode:
authorShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2021-10-06 05:43:06 +0800
committerShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2021-10-06 06:16:16 +0800
commit9e972605a04b36faebab34a821ec90aab13990e0 (patch)
tree9676e79acfcff57e57be1a01d9d6dbf040118aa3 /pkgs/tools/networking/davix
parent362cdf2cc60c9a7a32c02ed785a8ba9aa2882a68 (diff)
downloadnixpkgs-9e972605a04b36faebab34a821ec90aab13990e0.tar
nixpkgs-9e972605a04b36faebab34a821ec90aab13990e0.tar.gz
nixpkgs-9e972605a04b36faebab34a821ec90aab13990e0.tar.bz2
nixpkgs-9e972605a04b36faebab34a821ec90aab13990e0.tar.lz
nixpkgs-9e972605a04b36faebab34a821ec90aab13990e0.tar.xz
nixpkgs-9e972605a04b36faebab34a821ec90aab13990e0.tar.zst
nixpkgs-9e972605a04b36faebab34a821ec90aab13990e0.zip
davix: add switches for optional features
Diffstat (limited to 'pkgs/tools/networking/davix')
-rw-r--r--pkgs/tools/networking/davix/default.nix47
1 files changed, 45 insertions, 2 deletions
diff --git a/pkgs/tools/networking/davix/default.nix b/pkgs/tools/networking/davix/default.nix
index 687e7aed727..1cdb5677eec 100644
--- a/pkgs/tools/networking/davix/default.nix
+++ b/pkgs/tools/networking/davix/default.nix
@@ -1,10 +1,44 @@
-{ lib, stdenv, fetchurl, cmake, pkg-config, openssl, libxml2, boost, python3, libuuid }:
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, pkg-config
+, openssl
+, libxml2
+, boost
+, python3
+, libuuid
+, curl
+, gsoap
+, enableTools ? true
+  # Build the bundled libcurl
+  # and, if defaultToLibCurl,
+  # use instead of an external one
+, useEmbeddedLibcurl ? true
+  # Use libcurl instead of libneon
+  # Note that the libneon used is bundled in the project
+  # See https://github.com/cern-fts/davix/issues/23
+, defaultToLibcurl ? false
+, enableIpv6 ? true
+, enableTcpNodelay ? true
+  # Build davix_copy.so
+, enableThirdPartyCopy ? false
+}:
 
+let
+  boolToUpper = b: lib.toUpper (lib.boolToString b);
+in
 stdenv.mkDerivation rec {
   version = "0.8.0";
   pname = "davix";
   nativeBuildInputs = [ cmake pkg-config python3 ];
-  buildInputs = [ openssl libxml2 boost libuuid ];
+  buildInputs = [
+    openssl
+    libxml2
+    boost
+    libuuid
+  ] ++ lib.optional (defaultToLibcurl && !useEmbeddedLibcurl) curl
+  ++ lib.optional (enableThirdPartyCopy) gsoap;
 
   # using the url below since the github release page states
   # "please ignore the GitHub-generated tarballs, as they are incomplete"
@@ -20,6 +54,15 @@ stdenv.mkDerivation rec {
     done
   '';
 
+  cmakeFlags = [
+    "-DENABLE_TOOLS=${boolToUpper enableTools}"
+    "-DEMBEDDED_LIBCURL=${boolToUpper useEmbeddedLibcurl}"
+    "-DLIBCURL_BACKEND_BY_DEFAULT=${boolToUpper defaultToLibcurl}"
+    "-DENABLE_IPV6=${boolToUpper enableIpv6}"
+    "-DENABLE_TCP_NODELAY=${boolToUpper enableTcpNodelay}"
+    "-DENABLE_THIRD_PARTY_COPY=${boolToUpper enableThirdPartyCopy}"
+  ];
+
   meta = with lib; {
     description = "Toolkit for Http-based file management";