From 1f39c5f8ca5be2860f597fa701117704fe0a565d Mon Sep 17 00:00:00 2001 From: Christof Meerwald Date: Sat, 16 Dec 2023 02:48:15 +0100 Subject: [PATCH] xmake, new recipe (#9893) --- dev-util/xmake/patches/xmake-2.8.5.patchset | 55 +++++++++++++++++++++ dev-util/xmake/xmake-2.8.5.recipe | 53 ++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 dev-util/xmake/patches/xmake-2.8.5.patchset create mode 100644 dev-util/xmake/xmake-2.8.5.recipe diff --git a/dev-util/xmake/patches/xmake-2.8.5.patchset b/dev-util/xmake/patches/xmake-2.8.5.patchset new file mode 100644 index 000000000..030429ba4 --- /dev/null +++ b/dev-util/xmake/patches/xmake-2.8.5.patchset @@ -0,0 +1,55 @@ +From 5ce1f116e81b981daac2e58d5c3c07557b574214 Mon Sep 17 00:00:00 2001 +From: Christof Meerwald +Date: Fri, 15 Dec 2023 14:56:01 +0000 +Subject: [PATCH] adjust fallback for Haiku OS + +--- + core/src/xmake/engine.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/core/src/xmake/engine.c b/core/src/xmake/engine.c +index f1b0b381b..7469e7878 100644 +--- a/core/src/xmake/engine.c ++++ b/core/src/xmake/engine.c +@@ -682,8 +682,13 @@ static tb_size_t xm_engine_get_program_file(xm_engine_t* engine, tb_char_t* path + static tb_char_t const* s_paths[] = + { + "~/.local/bin/xmake", ++#if defined(TB_CONFIG_OS_HAIKU) ++ "~/config/bin/xmake", ++ "/boot/system/bin/xmake" ++#else + "/usr/local/bin/xmake", + "/usr/bin/xmake" ++#endif + }; + for (tb_size_t i = 0; i < tb_arrayn(s_paths); i++) + { +-- +2.42.0 + +From 6666b40bd8952d198b510dad0c24a912ce66350e Mon Sep 17 00:00:00 2001 +From: Christof Meerwald +Date: Fri, 15 Dec 2023 21:32:27 +0000 +Subject: [PATCH] disable root user check for Haiku + +--- + xmake/core/main.lua | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/xmake/core/main.lua b/xmake/core/main.lua +index db284c431..f3412d1d1 100644 +--- a/xmake/core/main.lua ++++ b/xmake/core/main.lua +@@ -266,7 +266,7 @@ function main.entry() + end + + -- check run command as root +- if not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' then ++ if not option.get("root") and os.getenv("XMAKE_ROOT") ~= 'y' and os.host() ~= 'haiku' then + if os.isroot() then + errors = [[Running xmake as root is extremely dangerous and no longer supported. + As xmake does not drop privileges on installation you would be giving all +-- +2.42.0 + diff --git a/dev-util/xmake/xmake-2.8.5.recipe b/dev-util/xmake/xmake-2.8.5.recipe new file mode 100644 index 000000000..4ce360969 --- /dev/null +++ b/dev-util/xmake/xmake-2.8.5.recipe @@ -0,0 +1,53 @@ +SUMMARY="A cross-platform build utility based on Lua" +DESCRIPTION="What is Xmake? +1. Xmake is a cross-platform build utility based on the Lua scripting language. +2. Xmake is very lightweight and has no dependencies outside of the standard library. +3. Uses the \`xmake.lua\` file to maintain project builds with a simple and readable syntax. +Xmake can be used to directly build source code (like with Make or Ninja), or it can generate \ +project source files like CMake or Meson. It also has a built-in package management system to help \ +users integrate C/C++ dependencies." +HOMEPAGE="https://xmake.io/" +COPYRIGHT="2015-2023 TBOOX Open Source Group" +LICENSE="Apache v2" +REVISION="1" +SOURCE_URI="https://github.com/xmake-io/xmake/releases/download/v$portVersion/xmake-v$portVersion.tar.gz" +CHECKSUM_SHA256="19c67be3bcfcbda96ca87a18effac39bfccc443fbb3754c7bbc01511decd24af" +PATCHES="xmake-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" + +PROVIDES=" + xmake = $portVersion + cmd:xmake = $portVersion + cmd:xrepo = $portVersion + " +REQUIRES=" + haiku + lib:libatomic + lib:libncurses >= 6 + " + +BUILD_REQUIRES=" + haiku_devel + devel:libatomic + devel:libncurses >= 6 + " +BUILD_PREREQUIRES=" + cmd:awk + cmd:find + cmd:gcc + cmd:ld + cmd:make + cmd:pkg_config + " + +BUILD() +{ + runConfigure ./configure + make $jobArgs +} + +INSTALL() +{ + make install +}