2021-10-08 15:17:17 +00:00
|
|
|
{ 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
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
let
|
|
|
|
boolToUpper = b: lib.toUpper (lib.boolToString b);
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-10-08 15:17:17 +00:00
|
|
|
version = "0.8.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "davix";
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config python3 ];
|
2021-10-08 15:17:17 +00:00
|
|
|
buildInputs = [
|
|
|
|
openssl
|
|
|
|
libxml2
|
|
|
|
boost
|
|
|
|
libuuid
|
|
|
|
] ++ lib.optional (defaultToLibcurl && !useEmbeddedLibcurl) curl
|
|
|
|
++ lib.optional (enableThirdPartyCopy) gsoap;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-24 20:58:05 +00:00
|
|
|
# using the url below since the github release page states
|
|
|
|
# "please ignore the GitHub-generated tarballs, as they are incomplete"
|
2021-10-08 15:17:17 +00:00
|
|
|
# https://github.com/cern-fts/davix/releases/tag/R_0_8_0
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-01-15 22:18:51 +00:00
|
|
|
url = "https://github.com/cern-fts/${pname}/releases/download/R_${lib.replaceStrings ["."] ["_"] version}/${pname}-${version}.tar.gz";
|
2021-10-08 15:17:17 +00:00
|
|
|
sha256 = "LxCNoECKg/tbnwxoFQ02C6cz5LOg/imNRbDTLSircSQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
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=${boolToUpper useEmbeddedLibcurl}"
|
|
|
|
"-DLIBCURL_BACKEND_BY_DEFAULT=${boolToUpper defaultToLibcurl}"
|
|
|
|
"-DENABLE_IPV6=${boolToUpper enableIpv6}"
|
|
|
|
"-DENABLE_TCP_NODELAY=${boolToUpper enableTcpNodelay}"
|
|
|
|
"-DENABLE_THIRD_PARTY_COPY=${boolToUpper enableThirdPartyCopy}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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";
|
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
homepage = "http://dmc.web.cern.ch/projects/davix/home";
|
|
|
|
changelog = "https://github.com/cern-fts/davix/blob/devel/RELEASE-NOTES.md";
|
|
|
|
maintainers = with maintainers; [ adev ];
|
|
|
|
platforms = platforms.all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|