From 05b659201cf5b27ece048b4c2c4f02e2f1c5c795 Mon Sep 17 00:00:00 2001 From: Chi Huu Huynh <73843190+Chi-EEE@users.noreply.github.com> Date: Mon, 16 Sep 2024 02:41:54 +0100 Subject: [PATCH] munkres-algorithm: add package (#5239) * munkres-algorithm: add package * munkres-algorithm: add patch --- .../patches/2021.04.05/cstdint.patch | 12 +++++++++ packages/m/munkres-algorithm/xmake.lua | 26 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 packages/m/munkres-algorithm/patches/2021.04.05/cstdint.patch create mode 100644 packages/m/munkres-algorithm/xmake.lua diff --git a/packages/m/munkres-algorithm/patches/2021.04.05/cstdint.patch b/packages/m/munkres-algorithm/patches/2021.04.05/cstdint.patch new file mode 100644 index 00000000000..f844aff8bd6 --- /dev/null +++ b/packages/m/munkres-algorithm/patches/2021.04.05/cstdint.patch @@ -0,0 +1,12 @@ +diff --git a/munkres.hpp b/munkres.hpp +index 694aff1..ac2ecca 100644 +--- a/munkres.hpp ++++ b/munkres.hpp +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + + namespace detail + { diff --git a/packages/m/munkres-algorithm/xmake.lua b/packages/m/munkres-algorithm/xmake.lua new file mode 100644 index 00000000000..198da3e3dd5 --- /dev/null +++ b/packages/m/munkres-algorithm/xmake.lua @@ -0,0 +1,26 @@ +package("munkres-algorithm") + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/aaron-michaux/munkres-algorithm") + set_description("Modern C++ implementation of Munkres (Hungarian) algorithm") + set_license("MIT") + + add_urls("https://github.com/aaron-michaux/munkres-algorithm.git") + add_versions("2021.04.05", "30c5fbdde1e5a9fb44fcac55b7c0e8676baaccfd") + + add_patches("2021.04.05", "patches/2021.04.05/cstdint.patch", "ceca3960e7fbed9578517c1e5830e5e056d4c0bdcc250871d3277364729c78fe") + + on_install(function (package) + os.cp("munkres.hpp", package:installdir("include")) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + auto result = munkres_algorithm(3, 3, + [&](unsigned l, unsigned r) -> float { + return 0; + } + ); + } + ]]}, {configs = {languages = "c++14"}, includes = "munkres.hpp"})) + end)