xmake.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132
  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. on_install("!windows and !wasm", function (package)
  10. if not package:is_cross() then
  11. package:addenv("PATH", "bin")
  12. end
  13. local configs = {"--disable-doc", "--disable-dependency-tracking"}
  14. if package:config("shared") then
  15. table.insert(configs, "--enable-shared")
  16. table.insert(configs, "--disable-static")
  17. else
  18. table.insert(configs, "--disable-shared")
  19. table.insert(configs, "--enable-static")
  20. end
  21. if is_host("windows") then
  22. io.replace("configure", "LIBTOOL='$(SHELL) $(top_builddir)/libtool'", "LIBTOOL='\"$(SHELL)\" $(top_builddir)/libtool'", {plain = true})
  23. end
  24. import("package.tools.autoconf").install(package, configs)
  25. end)
  26. on_test(function (package)
  27. assert(package:has_cfuncs("asn1_create_element", {includes = "libtasn1.h"}))
  28. end)