From 0a74adfbf72960c2a792d19c860ba190e281c314 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 5 May 2019 09:48:44 +0800 Subject: [PATCH] add meson --- packages/m/meson/xmake.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/m/meson/xmake.lua diff --git a/packages/m/meson/xmake.lua b/packages/m/meson/xmake.lua new file mode 100644 index 000000000..994a0e627 --- /dev/null +++ b/packages/m/meson/xmake.lua @@ -0,0 +1,23 @@ +package("meson") + + set_kind("binary") + set_homepage("https://mesonbuild.com/") + set_description("Fast and user friendly build system.") + + add_urls("https://github.com/mesonbuild/meson/releases/download/$(version)/meson-$(version).tar.gz", + "https://github.com/mesonbuild/meson.git") + add_versions("0.50.1", "f68f56d60c80a77df8fc08fa1016bc5831605d4717b622c96212573271e14ecc") + + add_deps("ninja", "python 3.x") + + on_install("macosx", "linux", "windows", function (package) + import("core.base.semver") + local version = semver.new(package:dep("python"):version_str()) + local envs = {PYTHONPATH = package:installdir("lib", "python" .. version:major() .. "." .. version:minor(), "site-packages")} + os.vrunv("python3", {"./setup.py", "install", "--prefix=" .. package:installdir()}, {envs = envs}) + package:addenv("PYTHONPATH", envs.PYTHONPATH) + end) + + on_test(function (package) + os.vrun("meson --version") + end)