From 3f09b38dcf4b61306479497d540f73979391e011 Mon Sep 17 00:00:00 2001 From: yszhou2019 <59953951+yszhou2019@users.noreply.github.com> Date: Tue, 21 Jun 2022 10:57:17 +0800 Subject: [PATCH] Xtensor io (#1281) * add package: zycore-c * zycore add v1.1.0 * add package xtensor-io * complement format --- packages/x/xtensor-io/xmake.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/x/xtensor-io/xmake.lua diff --git a/packages/x/xtensor-io/xmake.lua b/packages/x/xtensor-io/xmake.lua new file mode 100644 index 000000000..4945243dc --- /dev/null +++ b/packages/x/xtensor-io/xmake.lua @@ -0,0 +1,32 @@ +package("xtensor-io") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/xtensor-stack/xtensor-io") + set_description("xtensor plugin to read and write images, audio files, numpy (compressed) npz and HDF5") + set_license("BSD-3-Clause") + + add_urls("https://github.com/xtensor-stack/xtensor-io/archive/refs/tags/$(version).tar.gz", + "https://github.com/xtensor-stack/xtensor-io.git") + add_versions("0.13.0", "470bedee082adb0ef25ef7b54f9cfd3684e27b8489c42cf7980e0d90c14d04da") + + add_deps("cmake") + add_deps("xtensor") + + on_install("windows", "macosx", "linux", "mingw@windows", function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + int freq = 2000; + int sampling_freq = 44100; + double duration = 1.0; + xt::xarray a1 = {0, 1, 2, 3}; + auto t = xt::arange(0.0, duration, 1.0 / sampling_freq); + auto y = xt::sin(2.0 * xt::numeric_constants::PI * freq * t); + } + ]]}, {configs = {languages = "c++14"}})) + end)