Browse Source

frugally-deep: add package (#3007)

* frugally-deep: add package

* update functionalplus version

* fix test
star9029 1 year ago
parent
commit
06fd8ae941
2 changed files with 38 additions and 5 deletions
  1. 35 0
      packages/f/frugally-deep/xmake.lua
  2. 3 5
      packages/f/functionalplus/xmake.lua

+ 35 - 0
packages/f/frugally-deep/xmake.lua

@@ -0,0 +1,35 @@
+package("frugally-deep")
+    set_kind("library", {headeronly = true})
+    set_homepage("https://github.com/Dobiasd/frugally-deep")
+    set_description("Header-only library for using Keras (TensorFlow) models in C++.")
+    set_license("MIT")
+
+    add_urls("https://github.com/Dobiasd/frugally-deep/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/Dobiasd/frugally-deep.git")
+
+    add_versions("v0.15.29", "032cd525d4a7b9b3ebe28fd5e3984ac3e569da496f65d52c81030aabd9d0c52e")
+
+    if is_plat("linux", "bsd") then
+        add_syslinks("pthread")
+    end
+
+    add_deps("cmake")
+    add_deps("functionalplus", "eigen")
+    add_deps("nlohmann_json", {configs = {cmake = true}})
+
+    on_install("windows", "macosx", "linux", "mingw", "cross", function (package)
+        import("package.tools.cmake").install(package)
+    end)
+
+    on_test(function (package)
+        local cxflags
+        if package:is_plat("mingw") then
+            cxflags = "-Wa,-mbig-obj"
+        end
+        assert(package:check_cxxsnippets({test = [[
+            #include <fdeep/fdeep.hpp>
+            void test() {
+                const auto model = fdeep::load_model("fdeep_model.json");
+            }
+        ]]}, {configs = {languages = "c++14", cxflags = cxflags}}))
+    end)

+ 3 - 5
packages/f/functionalplus/xmake.lua

@@ -5,15 +5,13 @@ package("functionalplus")
 
 
     add_urls("https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/$(version).tar.gz",
     add_urls("https://github.com/Dobiasd/FunctionalPlus/archive/refs/tags/$(version).tar.gz",
              "https://github.com/Dobiasd/FunctionalPlus.git")
              "https://github.com/Dobiasd/FunctionalPlus.git")
-    add_versions("v0.2.18-p0", "ffc63fc86f89a205accafa85c35790eda307adf5f1d6d51bb7ceb5c5e21e013b")
+
+    add_versions("v0.2.22", "79378668dff6ffa8abc1abde2c2fe37dc6fe1ac040c55d5ee7886924fa6a1376")
 
 
     add_deps("cmake")
     add_deps("cmake")
 
 
     on_install(function (package)
     on_install(function (package)
-        local configs = {}
-        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
-        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
-        import("package.tools.cmake").install(package, configs)
+        import("package.tools.cmake").install(package)
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)