diff --git a/packages/n/nsis/xmake.lua b/packages/n/nsis/xmake.lua index 460ff829a..f3e8c41ee 100644 --- a/packages/n/nsis/xmake.lua +++ b/packages/n/nsis/xmake.lua @@ -3,38 +3,18 @@ package("nsis") set_homepage("https://nsis.sourceforge.io/") set_description("NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers.") - add_urls("https://github.com/kichik/nsis/archive/refs/tags/$(version).tar.gz", {version = function (version) - return version:gsub("%.", "") + add_urls("https://github.com/xmake-mirror/nsis/releases/download/$(version).zip", {version = function (version) + return "v" .. (version:gsub("%.", "")) .. "/nsis-" .. version end}) - add_urls("https://github.com/kichik/nsis.git") - add_versions("v3.09", "4d2ce0d2fecc28bd2d8a0108152339f091e9d1f35342dac0eb4594157435292b") + add_versions("3.09", "b6f9960f6956b40a05809f1edad5761d6ed7af1548806836bc2381689b11442a") - add_resources("3.x", "uac", "https://nsis.sourceforge.io/mediawiki/images/8/8f/UAC.zip", "20e3192af5598568887c16d88de59a52c2ce4a26e42c5fb8bee8105dcbbd1760") - - on_load(function (package) - if not package:is_precompiled() then - package:add("deps", "scons") - package:add("deps", "zlib", {system = false, host = true, configs = {shared = true}}) - end - end) + add_resources("3.09", "uac", "https://github.com/xmake-mirror/nsis/releases/download/v309/UAC.zip", "20e3192af5598568887c16d88de59a52c2ce4a26e42c5fb8bee8105dcbbd1760") + add_resources("3.09", "strlen_8192", "https://github.com/xmake-mirror/nsis/releases/download/v309/nsis-3.09-strlen_8192.zip", "9e3b8e77c97a46747201f95f89eba26714dd9c6dc06830c3934b3f5fbdb1beca") on_install("@windows|x64", "@windows|x86", function (package) - local zlib_installdir = package:dep("zlib"):installdir() - os.cp(path.join(zlib_installdir, "lib", "zlib.lib"), path.join(package:installdir("lib"), "zdll.lib")) - os.cp(path.join(zlib_installdir, "bin", "zlib.dll"), path.join(package:installdir("bin"), "zlib.dll")) - os.cp(path.join(zlib_installdir, "include", "*.h"), package:installdir("include")) - local arch = package:arch() - if arch == "x64" then - arch = "amd64" - end - local configs = { - "NSIS_MAX_STRLEN=8192", - "TARGET_ARCH=" .. arch, - "PREFIX=" .. package:installdir(), - "ZLIB_W32=" .. package:installdir(), - "install-compiler", "install-stubs"} - import("package.tools.scons").build(package, configs) + os.cp("*", package:installdir()) + os.cp(path.join(package:resourcedir("strlen_8192"), "*"), package:installdir()) os.cp(path.join(package:resourcedir("uac"), "UAC.nsh"), path.join(package:installdir(), "Include")) end) diff --git a/packages/s/scons/xmake.lua b/packages/s/scons/xmake.lua index 18f9b3a36..30bf8989e 100644 --- a/packages/s/scons/xmake.lua +++ b/packages/s/scons/xmake.lua @@ -33,6 +33,9 @@ package("scons") io.writefile("build/doc/man/sconsign.1", "") end + -- fix ml64 support for x64 + -- @see https://stackoverflow.com/questions/58919970/building-x64-nsis-using-vs2012 + io.replace("SCons/Tool/masm.py", "'ml'", "'ml64' if env.get('TARGET_ARCH')=='amd64' else 'ml'", {plain = true}) os.vrunv("python", {"setup.py", "install", "--prefix", package:installdir()}) if is_host("windows", "msys") then os.mv(package:installdir("Scripts", "*"), package:installdir("bin"))