xmake.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package("ls-qpack")
  2. set_homepage("https://github.com/litespeedtech/ls-qpack")
  3. set_description("QPACK compression library for use with HTTP/3")
  4. set_license("MIT")
  5. add_urls("https://github.com/litespeedtech/ls-qpack/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/litespeedtech/ls-qpack.git")
  7. add_versions("v2.6.0", "567a7a86f801eef5df28ce0cc89826d9008a57135027bdf63ba4a1d0639d0c58")
  8. add_versions("v2.5.5", "8770435b81d13616cf952bd361ec0e6e0fd79acff76dd9f6e75c18fd88b4c4f4")
  9. add_versions("v2.5.4", "56b96190a1943d75ef8d384b13cd4592a72e3e2d84284f78d7f8adabbc717f3e")
  10. add_versions("v2.5.3", "075a05efee27961eac5ac92a12a6e28a61bcd6c122a0276938ef993338577337")
  11. add_patches(">=2.5.5 <=2.6.0", "patches/2.5.5/cmake.patch", "23fd785c3db2e1b43ead464b0ee8d12e9f290fbfdf818c3238cba316df295f08")
  12. add_patches("2.5.3", "patches/2.5.3/fix-cmake-install.patch", "7d819b620b5e2bd34ef58a91bf20d882883c7525def9f9f80313b64cba5e5239")
  13. add_deps("cmake")
  14. add_deps("xxhash")
  15. on_load(function (package)
  16. if package:version() and package:version():ge("2.5.5") then
  17. if is_subhost("windows") then
  18. package:add("deps", "pkgconf")
  19. else
  20. package:add("deps", "pkg-config")
  21. end
  22. end
  23. end)
  24. on_install(function (package)
  25. local opt = {}
  26. if package:version() and package:version():lt("2.5.5") then
  27. opt.packagedeps = "xxhash"
  28. end
  29. local configs = {
  30. "-DLSQPACK_TESTS=OFF",
  31. "-DLSQPACK_BIN=OFF",
  32. "-DLSQPACK_XXH=OFF",
  33. "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW",
  34. }
  35. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  36. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  37. if package:is_plat("windows") and package:config("shared") then
  38. table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
  39. end
  40. import("package.tools.cmake").install(package, configs, opt)
  41. end)
  42. on_test(function (package)
  43. assert(package:has_cfuncs("lsqpack_enc_init", {includes = "lsqpack.h"}))
  44. end)