xmake.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package("gpm")
  2. set_homepage("https://www.nico.schottelius.org/software/gpm/")
  3. set_description("general purpose mouse")
  4. set_license("GPL-2.0-or-later")
  5. add_urls("https://github.com/telmich/gpm.git")
  6. add_versions("2020.06.17", "e82d1a653ca94aa4ed12441424da6ce780b1e530")
  7. add_deps("autotools", "bison", "texinfo")
  8. add_deps("ncurses")
  9. on_install("linux", "cross", function (package)
  10. local configs = {}
  11. table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
  12. table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
  13. -- fix gcc15
  14. local opt = {cxflags = "-std=c11"}
  15. import("package.tools.autoconf").install(package, configs, opt)
  16. os.cd(package:installdir("lib"))
  17. if package:config("shared") then
  18. local files = os.files("libgpm.so.*")
  19. if #files > 0 then
  20. os.ln(path.filename(files[1]), "libgpm.so")
  21. end
  22. else
  23. os.tryrm("libgpm.so*")
  24. end
  25. end)
  26. on_test(function (package)
  27. assert(package:check_csnippets({test = [[
  28. #include <gpm.h>
  29. void test() {
  30. Gpm_Connect conn = {
  31. .eventMask = GPM_DOWN | GPM_UP | GPM_DRAG | GPM_MOVE,
  32. .defaultMask = 0,
  33. .minMod = 0,
  34. .maxMod = (unsigned short) ~(1 << 0)
  35. };
  36. Gpm_Open(&conn, 0);
  37. }
  38. ]]}, {configs = {languages = "c11"}}))
  39. end)