xmake.lua 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. package("libpaper")
  2. set_homepage("https://packages.debian.org/unstable/libs/libpaper1")
  3. set_description("library for handling paper characteristics")
  4. set_license("GPL-2.0")
  5. add_urls("http://deb.debian.org/debian/pool/main/libp/libpaper/libpaper_$(version).tar.gz")
  6. add_versions("1.1.28", "c8bb946ec93d3c2c72bbb1d7257e90172a22a44a07a07fb6b802a5bb2c95fddc")
  7. if is_plat("linux") then
  8. add_extsources("apt::libpaper-dev", "pacman::libpaper")
  9. end
  10. add_deps("automake", "autoconf", "libtool")
  11. on_install("macosx", "linux", function (package)
  12. local configs = {}
  13. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  14. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  15. if package:config("pic") ~= false then
  16. table.insert(configs, "--with-pic")
  17. end
  18. local libtool = package:dep("libtool")
  19. if libtool then
  20. os.vrunv("autoreconf", {"--install", "-I" .. libtool:installdir("share", "aclocal")})
  21. else
  22. os.vrunv("autoreconf", {"--install"})
  23. end
  24. import("package.tools.autoconf").install(package, configs)
  25. end)
  26. on_test(function (package)
  27. assert(package:has_cfuncs("paperinfo", {includes = "paper.h"}))
  28. end)