xmake.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package("davix")
  2. set_homepage("https://davix.web.cern.ch/")
  3. set_description("High-performance file management over WebDAV/HTTP")
  4. set_license("LGPL-2.1")
  5. add_urls("https://github.com/cern-fts/davix/releases/download/R_$(version).tar.gz", {version = function (version)
  6. return format("%s/davix-%s", version:gsub("%.", "_"), version)
  7. end})
  8. add_urls("https://github.com/cern-fts/davix.git")
  9. add_versions("0.8.5", "f9ce21bcc2ed248f7825059d17577876616258c35177d74fad8f854a818a87f9")
  10. add_deps("python 3.x", {kind = "binary"})
  11. add_deps("cmake", "openssl", "libcurl", "libxml2")
  12. add_deps("util-linux", {configs = {libuuid = true}})
  13. add_includedirs("include/davix")
  14. if is_plat("linux") then
  15. add_syslinks("pthread")
  16. end
  17. on_install("macosx", "linux", function (package)
  18. local configs = {"-DDAVIX_TESTS=OFF", "-DEMBEDDED_LIBCURL=OFF", "-DLIB_SUFFIX="}
  19. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
  20. table.insert(configs, "-DSHARED_LIBRARY=" .. (package:config("shared") and "ON" or "OFF"))
  21. table.insert(configs, "-DSTATIC_LIBRARY=" .. (package:config("shared") and "OFF" or "ON"))
  22. local utlinux = package:dep("util-linux"):fetch()
  23. if utlinux then
  24. for _, dir in ipairs(utlinux.includedirs or utlinux.sysincludedirs) do
  25. table.insert(configs, "-DUUID_INCLUDE_DIR=" .. dir)
  26. break
  27. end
  28. for _, dir in ipairs(utlinux.linkdirs) do
  29. table.insert(configs, "-DUUID_LIBRARY=" .. dir .. "/libuuid.a")
  30. break
  31. end
  32. end
  33. import("package.tools.cmake").install(package, configs, {packagedeps = "libcurl"})
  34. package:addenv("PATH", "bin")
  35. end)
  36. on_test(function (package)
  37. assert(package:check_cxxsnippets({test = [[
  38. #include <davix.hpp>
  39. void test() {
  40. Davix::Context context;
  41. context.loadModule("grid");
  42. }
  43. ]]}, {configs = {languages = "c++17"}}))
  44. end)