xmake.lua 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. package("tclsh")
  2. set_kind("binary")
  3. set_homepage("https://core.tcl-lang.org/tcl/")
  4. set_description("The Tcl Core. (Mirror of core.tcl-lang.org) ")
  5. add_urls("https://github.com/tcltk/tcl.git")
  6. add_versions("2024.06.07", "6accaa2544857f45554541a83fb4ef4cefa263d0")
  7. on_install("linux", "macosx", function (package)
  8. local configs = {}
  9. os.cd("unix")
  10. import("package.tools.autoconf").install(package, configs)
  11. os.cp(path.join(package:installdir("bin"), "tclsh9.0"), path.join(package:installdir("bin"), "tclsh"))
  12. end)
  13. on_install("windows", function (package)
  14. os.cd("win")
  15. -- TODO
  16. io.replace("makefile.vc", "libtclzip: core dlls $(TCLSCRIPTZIP)", "libtclzip: core dlls", {plain = true})
  17. import("package.tools.nmake").build(package, {"-f", "makefile.vc", "release"})
  18. os.cp("Release_*/*.exe", package:installdir("bin"))
  19. os.cp("Release_*/*.dll", package:installdir("bin"))
  20. os.cp(path.join(package:installdir("bin"), "tclsh90.exe"), path.join(package:installdir("bin"), "tclsh.exe"))
  21. end)
  22. on_test(function (package)
  23. local infile = os.tmpfile()
  24. local outfile = os.tmpfile()
  25. io.writefile(infile, "puts hello\n")
  26. local outdata = os.iorunv("tclsh", {infile})
  27. assert(outdata == "hello\n")
  28. os.rm(infile)
  29. os.rm(outfile)
  30. end)