Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 87 lines 2.4 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 cmake, 6 pkg-config, 7 openssl, 8 libxml2, 9 boost, 10 python3, 11 libuuid, 12 curl, 13 gsoap, 14 rapidjson, 15 enableTools ? true, 16 # Use libcurl instead of libneon 17 # Note that the libneon used is bundled in the project 18 # See https://github.com/cern-fts/davix/issues/23 19 defaultToLibcurl ? false, 20 enableIpv6 ? true, 21 enableTcpNodelay ? true, 22 # Build davix_copy.so 23 enableThirdPartyCopy ? false, 24}: 25 26let 27 boolToUpper = b: lib.toUpper (lib.boolToString b); 28in 29stdenv.mkDerivation rec { 30 version = "0.8.7"; 31 pname = "davix" + lib.optionalString enableThirdPartyCopy "-copy"; 32 nativeBuildInputs = [ 33 cmake 34 pkg-config 35 python3 36 ]; 37 buildInputs = [ 38 boost 39 curl 40 libxml2 41 openssl 42 rapidjson 43 ] 44 ++ lib.optional (!stdenv.hostPlatform.isDarwin) libuuid 45 ++ lib.optional (enableThirdPartyCopy) gsoap; 46 47 # using the url below since the github release page states 48 # "please ignore the GitHub-generated tarballs, as they are incomplete" 49 # https://github.com/cern-fts/davix/releases/tag/R_0_8_0 50 src = fetchurl { 51 url = "https://github.com/cern-fts/davix/releases/download/R_${ 52 lib.replaceStrings [ "." ] [ "_" ] version 53 }/davix-${version}.tar.gz"; 54 sha256 = "sha256-eMJOFO3X5OVgOS1nFH7IZYwqoNNkBBW99rxROvz2leY="; 55 }; 56 57 preConfigure = '' 58 find . -mindepth 1 -maxdepth 1 -type f -name "patch*.sh" -print0 | while IFS= read -r -d ''' file; do 59 patchShebangs "$file" 60 done 61 ''; 62 63 cmakeFlags = [ 64 "-DENABLE_TOOLS=${boolToUpper enableTools}" 65 "-DEMBEDDED_LIBCURL=OFF" 66 "-DLIBCURL_BACKEND_BY_DEFAULT=${boolToUpper defaultToLibcurl}" 67 "-DENABLE_IPV6=${boolToUpper enableIpv6}" 68 "-DENABLE_TCP_NODELAY=${boolToUpper enableTcpNodelay}" 69 "-DENABLE_THIRD_PARTY_COPY=${boolToUpper enableThirdPartyCopy}" 70 ]; 71 72 meta = with lib; { 73 description = "Toolkit for Http-based file management"; 74 75 longDescription = "Davix is a toolkit designed for file 76 operations with Http based protocols (WebDav, Amazon S3, ...). 77 Davix provides an API and a set of command line tools"; 78 79 license = licenses.lgpl2Plus; 80 homepage = "https://github.com/cern-fts/davix"; 81 changelog = "https://github.com/cern-fts/davix/blob/R_${ 82 lib.replaceStrings [ "." ] [ "_" ] version 83 }/RELEASE-NOTES.md"; 84 maintainers = with maintainers; [ adev ]; 85 platforms = platforms.all; 86 }; 87}