depot/third_party/nixpkgs/pkgs/tools/networking/davix/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

78 lines
2.3 KiB
Nix

{ lib
, stdenv
, fetchurl
, cmake
, pkg-config
, openssl
, libxml2
, boost
, python3
, libuuid
, curl
, gsoap
, Security
, enableTools ? 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.3";
pname = "davix" + lib.optionalString enableThirdPartyCopy "-copy";
nativeBuildInputs = [ cmake pkg-config python3 ];
buildInputs = [
openssl
libxml2
boost
curl
]
++ lib.optional stdenv.isDarwin Security
++ lib.optional (!stdenv.isDarwin) libuuid
++ lib.optional (enableThirdPartyCopy) gsoap;
# using the url below since the github release page states
# "please ignore the GitHub-generated tarballs, as they are incomplete"
# https://github.com/cern-fts/davix/releases/tag/R_0_8_0
src = fetchurl {
url = "https://github.com/cern-fts/davix/releases/download/R_${lib.replaceStrings ["."] ["_"] version}/davix-${version}.tar.gz";
sha256 = "sha256-fjC1VB4I0y2/WuA8a8q+rsBjrsEKZkd4eCIie0VBrj4=";
};
preConfigure = ''
find . -mindepth 1 -maxdepth 1 -type f -name "patch*.sh" -print0 | while IFS= read -r -d ''' file; do
patchShebangs "$file"
done
'';
cmakeFlags = [
"-DENABLE_TOOLS=${boolToUpper enableTools}"
"-DEMBEDDED_LIBCURL=OFF"
"-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";
longDescription = "Davix is a toolkit designed for file
operations with Http based protocols (WebDav, Amazon S3, ...).
Davix provides an API and a set of command line tools";
license = licenses.lgpl2Plus;
homepage = "https://github.com/cern-fts/davix";
changelog = "https://github.com/cern-fts/davix/blob/R_${lib.replaceStrings ["."] ["_"] version}/RELEASE-NOTES.md";
maintainers = with maintainers; [ adev ];
platforms = platforms.all;
};
}