From 5732f56133b95392d6dd6dc22a3e694b9587117f Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 16 Mar 2023 12:46:35 +0800 Subject: [PATCH] add tclsh (#1920) * add tclsh * add tclsh for windows * fix move * fix move * fix move * test * test * fix install --- packages/t/tclsh/xmake.lua | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 packages/t/tclsh/xmake.lua diff --git a/packages/t/tclsh/xmake.lua b/packages/t/tclsh/xmake.lua new file mode 100644 index 000000000..7daac2971 --- /dev/null +++ b/packages/t/tclsh/xmake.lua @@ -0,0 +1,34 @@ +package("tclsh") + set_kind("binary") + set_homepage("https://core.tcl-lang.org/tcl/") + set_description("The Tcl Core. (Mirror of core.tcl-lang.org) ") + + add_urls("https://github.com/tcltk/tcl.git") + add_versions("2023.03.14", "69fe4c9e803e72ef654111cbbf3ce184e63989d4") + + on_install("linux", "macosx", function (package) + local configs = {} + os.cd("unix") + import("package.tools.autoconf").install(package, configs) + os.cp(path.join(package:installdir("bin"), "tclsh9.0"), path.join(package:installdir("bin"), "tclsh")) + end) + + on_install("windows", function (package) + os.cd("win") + -- TODO + io.replace("makefile.vc", "libtclzip: core dlls $(TCLSCRIPTZIP)", "libtclzip: core dlls", {plain = true}) + import("package.tools.nmake").build(package, {"-f", "makefile.vc", "release"}) + os.cp("Release_*/*.exe", package:installdir("bin")) + os.cp("Release_*/*.dll", package:installdir("bin")) + os.cp(path.join(package:installdir("bin"), "tclsh90.exe"), path.join(package:installdir("bin"), "tclsh.exe")) + end) + + on_test(function (package) + local infile = os.tmpfile() + local outfile = os.tmpfile() + io.writefile(infile, "puts hello\n") + local outdata = os.iorunv("tclsh", {infile}) + assert(outdata == "hello\n") + os.rm(infile) + os.rm(outfile) + end)