From 0572fb0b7207f0e2096c94769b1153794aefd457 Mon Sep 17 00:00:00 2001 From: star9029 Date: Fri, 27 Sep 2024 13:14:30 +0800 Subject: [PATCH] libfixmatrix: add package (#5347) --- packages/l/libfixmath/xmake.lua | 27 ++++++++++++++++++++++++ packages/l/libfixmatrix/xmake.lua | 35 +++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 packages/l/libfixmath/xmake.lua create mode 100644 packages/l/libfixmatrix/xmake.lua diff --git a/packages/l/libfixmath/xmake.lua b/packages/l/libfixmath/xmake.lua new file mode 100644 index 000000000..e381670e8 --- /dev/null +++ b/packages/l/libfixmath/xmake.lua @@ -0,0 +1,27 @@ +package("libfixmath") + set_homepage("https://code.google.com/p/libfixmath/") + set_description("Cross Platform Fixed Point Maths Library") + set_license("MIT") + + add_urls("https://github.com/PetteriAimonen/libfixmath.git") + + add_versions("2023.08.06", "d308e466e1a09118d03f677c52e5fbf402f6fdd0") + + on_install(function (package) + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + set_languages("c++11") + target("fixmath") + set_kind("$(kind)") + add_files("libfixmath/*.c") + add_headerfiles("(libfixmath/*.h)", "(libfixmath/*.hpp)") + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("uint32_log2", {includes = "libfixmath/uint32.h"})) + end) diff --git a/packages/l/libfixmatrix/xmake.lua b/packages/l/libfixmatrix/xmake.lua new file mode 100644 index 000000000..c07af43a0 --- /dev/null +++ b/packages/l/libfixmatrix/xmake.lua @@ -0,0 +1,35 @@ +package("libfixmatrix") + set_homepage("https://github.com/PetteriAimonen/libfixmatrix") + set_description("C library for fixed point matrix, quaternion and vector calculations") + set_license("MIT") + + add_urls("https://github.com/PetteriAimonen/libfixmatrix.git") + + add_versions("2014.01.17", "a8d583e4fe1fa27ba2e0ec55970f73a1b1e6928b") + + add_deps("libfixmath") + + on_install(function (package) + for _, file in ipairs(os.files("*.h")) do + io.replace(file, "fix16.h", "libfixmath/fix16.h", {plain = true}) + end + + io.writefile("xmake.lua", [[ + add_rules("mode.debug", "mode.release") + add_requires("libfixmath") + set_languages("c++11") + target("fixmatrix") + set_kind("$(kind)") + add_files("*.c|*_unittests.c") + add_headerfiles("*.h|unittests.h", {prefixdir = "libfixmatrix"}) + if is_plat("windows") and is_kind("shared") then + add_rules("utils.symbols.export_all") + end + add_packages("libfixmath") + ]]) + import("package.tools.xmake").install(package) + end) + + on_test(function (package) + assert(package:has_cfuncs("mf16_fill", {includes = "libfixmatrix/fixmatrix.h"})) + end)