* Add scons package

* Remove on_load from windows and add bsd support

* Fix find version of python in scons

* Don't use gsub to get version from pyton in scons

* Add msys support to scons

* Explicitly look for python3 in scons

* Remove bsd support and add mingw to on_load. scons

* Add on_load for windows in scons

* Add msys to on_load in scons

* Move Scripts folder to bin on windows in scons

* Move on_load to on_install and add PYTHONPATH on windows in scons

* Small fixes to scons

* Remove comments from scons

* Fix PYTHONPATH for msys in scons

* Add both PYTHONPATHs to scons

* Fix set_kind spaces in scons
pull/337/head
PucklaMotzer09 4 years ago committed by GitHub
parent 37103a5232
commit dc15d086ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 40
      packages/s/scons/xmake.lua

@ -0,0 +1,40 @@
package("scons")
set_kind("binary")
set_homepage("https://scons.org")
set_description("A software construction tool")
add_urls("https://github.com/SCons/scons/archive/refs/tags/$(version).zip",
"https://github.com/SCons/scons.git")
add_versions("4.1.0", "106259e92ba001feae5b50175bcec92306d0420bb08229fb037440cf303fcfc3")
add_deps("python >=3.0")
on_install("@windows", "@linux", "@macosx", "@msys", function (package)
local python_version = package:dep("python"):version()
local scons_version = package:version()
local scons_egg = "SCons-" .. scons_version:major() .. "." .. scons_version:minor() .. "." .. scons_version:patch() .. "-py" .. python_version:major() .. "." .. python_version:minor() .. ".egg"
local PYTHONPATH = package:installdir("lib")
local pyver = ("python%d.%d"):format(python_version:major(), python_version:minor())
local PYTHONPATH1 = path.join(PYTHONPATH, pyver)
PYTHONPATH = path.join(PYTHONPATH, "site-packages", scons_egg)
PYTHONPATH1 = path.join(PYTHONPATH1, "site-packages", scons_egg)
package:addenv("PYTHONPATH", PYTHONPATH, PYTHONPATH1)
-- setup.py install needs these
io.writefile("build/doc/man/scons.1", "")
io.writefile("build/doc/man/scons-time.1", "")
io.writefile("build/doc/man/sconsign.1", "")
os.vrunv("python", {"setup.py", "install", "--prefix", package:installdir()})
if package:is_plat("windows") then
os.mv(package:installdir("Scripts", "*"), package:installdir("bin"))
os.rmdir(package:installdir("Scripts"))
end
end)
on_test(function (package)
os.vrun("scons --version")
end)
Loading…
Cancel
Save