xmake.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package("e2fsprogs")
  2. set_homepage("http://e2fsprogs.sourceforge.net")
  3. set_description("Filesystem utilities for the ext2/3/4 filesystems")
  4. add_urls("https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/snapshot/e2fsprogs-$(version).tar.gz")
  5. add_versions("1.46.4", "c011bf3bf4ae5efe9fa2b0e9b0da0c14ef4b79c6143c1ae6d9f027931ec7abe1")
  6. if is_plat("linux") then
  7. add_extsources("apt::e2fsprogs", "pacman::e2fsprogs")
  8. elseif is_plat("macosx") then
  9. add_extsources("brew::e2fsprogs")
  10. end
  11. if is_plat("linux") then
  12. add_syslinks("pthread", "com_err")
  13. end
  14. on_install("linux", "macosx", function (package)
  15. import("package.tools.autoconf")
  16. os.rm("scrub")
  17. local configs = {"MKDIR_P=mkdir -p", "--disable-e2initrd-helper"}
  18. table.insert(configs, "--exec-prefix=" .. package:installdir())
  19. table.insert(configs, "--enable-libuuid")
  20. if package:config("shared") then
  21. if package:is_plat("linux") then
  22. table.insert(configs, "--enable-elf-shlibs")
  23. elseif package:is_plat("macosx") then
  24. table.insert(configs, "--enable-bsd-shlibs")
  25. end
  26. end
  27. -- Enforce MKDIR_P to work around a configure bug
  28. -- see https://github.com/Homebrew/homebrew-core/pull/35339
  29. autoconf.build(package, configs)
  30. -- make V=1 will fail for e2fsprogs, for reasons unknown
  31. -- So call make manually to ensure V=1 is not specified
  32. autoconf.make(package, {"install"})
  33. end)
  34. on_test(function (package)
  35. assert(package:has_cfuncs("ext2fs_open", {includes = "ext2fs/ext2fs.h"}))
  36. assert(package:has_cfuncs("uuid_parse", {includes = "uuid/uuid.h"}))
  37. end)