Skip to content

Commit

Permalink
munkres-algorithm: add package (#5239)
Browse files Browse the repository at this point in the history
* munkres-algorithm: add package

* munkres-algorithm: add patch
  • Loading branch information
Chi-EEE authored Sep 16, 2024
1 parent df40c08 commit 05b6592
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/m/munkres-algorithm/patches/2021.04.05/cstdint.patch
Original file line number Diff line number Diff line change
@@ -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 <limits>
#include <vector>
#include <algorithm>
+#include <cstdint>

namespace detail
{
26 changes: 26 additions & 0 deletions packages/m/munkres-algorithm/xmake.lua
Original file line number Diff line number Diff line change
@@ -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<double>(3, 3,
[&](unsigned l, unsigned r) -> float {
return 0;
}
);
}
]]}, {configs = {languages = "c++14"}, includes = "munkres.hpp"}))
end)

0 comments on commit 05b6592

Please sign in to comment.