xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. package("libtasn1")
  2. set_homepage("https://www.gnu.org/software/libtasn1/")
  3. set_description("Libtasn1 is the ASN.1 library used by GnuTLS, p11-kit and some other packages.")
  4. set_license("LGPL-2.1")
  5. add_urls("https://ftpmirror.gnu.org/gnu/libtasn1/libtasn1-$(version).tar.gz",
  6. "https://ftp.gnu.org/gnu/libtasn1/libtasn1-$(version).tar.gz")
  7. add_versions("4.15.0", "dd77509fe8f5304deafbca654dc7f0ea57f5841f41ba530cff9a5bf71382739e")
  8. add_versions("4.19.0", "1613f0ac1cf484d6ec0ce3b8c06d56263cc7242f1c23b30d82d23de345a63f7a")
  9. add_versions("4.20.0", "92e0e3bd4c02d4aeee76036b2ddd83f0c732ba4cda5cb71d583272b23587a76c")
  10. on_install("!windows and !wasm", function (package)
  11. if not package:is_cross() then
  12. package:addenv("PATH", "bin")
  13. end
  14. local configs = {"--disable-doc", "--disable-dependency-tracking"}
  15. if package:config("shared") then
  16. table.insert(configs, "--enable-shared")
  17. table.insert(configs, "--disable-static")
  18. else
  19. table.insert(configs, "--disable-shared")
  20. table.insert(configs, "--enable-static")
  21. end
  22. if is_host("windows") then
  23. io.replace("configure", "LIBTOOL='$(SHELL) $(top_builddir)/libtool'", "LIBTOOL='\"$(SHELL)\" $(top_builddir)/libtool'", {plain = true})
  24. end
  25. import("package.tools.autoconf").install(package, configs)
  26. end)
  27. on_test(function (package)
  28. assert(package:has_cfuncs("asn1_create_element", {includes = "libtasn1.h"}))
  29. end)