From 30b4ce1c4c096b403fa221e0402e1d50f8cc6fc4 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 24 Nov 2024 22:24:41 +0800 Subject: [PATCH] Add PortableBuildTools (#5819) * add portablebuildtools * fix test --- packages/p/portablebuildtools/xmake.lua | 17 +++++++++++++++++ scripts/new.lua | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 packages/p/portablebuildtools/xmake.lua diff --git a/packages/p/portablebuildtools/xmake.lua b/packages/p/portablebuildtools/xmake.lua new file mode 100644 index 000000000..f3d4bbae7 --- /dev/null +++ b/packages/p/portablebuildtools/xmake.lua @@ -0,0 +1,17 @@ +package("portablebuildtools") + set_kind("toolchain") + set_homepage("https://github.com/Data-Oriented-House/PortableBuildTools") + set_description("Portable VS Build Tools installer") + + add_urls("https://github.com/Data-Oriented-House/PortableBuildTools/releases/download/$(version)/PortableBuildTools.exe") + + add_versions("v2.8", "d3a419be62856ab8896004f91af58f5928ce7c536954398d02a8b99202c4808f") + + on_install("@windows", "@msys", function (package) + os.cp(package:originfile(), package:installdir("bin")) + end) + + on_test(function (package) + os.runv("PortableBuildTools.exe", {"list"}) + end) + diff --git a/scripts/new.lua b/scripts/new.lua index ad610da28..2d423b766 100644 --- a/scripts/new.lua +++ b/scripts/new.lua @@ -172,7 +172,7 @@ function generate_package(reponame, get_data) deps = {}, priority = 1, install = function(configs, package) - return [=[ + return ([=[ io.writefile("xmake.lua", [[ add_rules("mode.release", "mode.debug") target("%s") @@ -180,7 +180,7 @@ function generate_package(reponame, get_data) add_files("src/*.c") add_headerfiles("src/(*.h)") ]]) - import("package.tools.xmake").install(package)]=] + import("package.tools.xmake").install(package)]=]):format(packagename) end, }, ["CMakeLists.txt"] = {