diff --git a/packages/i/imagemagick/xmake.lua b/packages/i/imagemagick/xmake.lua index d9926f9d6..5eb28f85f 100644 --- a/packages/i/imagemagick/xmake.lua +++ b/packages/i/imagemagick/xmake.lua @@ -1,8 +1,12 @@ package("imagemagick") + set_homepage("https://imagemagick.org/script/index.php") set_description("ImageMagick is a FOSS software suite for modifying images. This does NOT provide any of the utilities. It installs the C/C++ Libraries.") - add_urls("https://download.imagemagick.org/ImageMagick/download/ImageMagick-$(version).tar.gz") + set_license("Apache-2.0") + + add_urls("https://download.imagemagick.org/ImageMagick/download/releases/ImageMagick-$(version).tar.gz") add_versions("7.0.11-13", "6c162d7cbd7b80968a6d083d39eb18d9c9bbd49f500f7f49c9a5dcc0fc36a03b") + add_versions("7.1.0-4", "94a7a52f633891cc29eefc49da95408ed68c64c3690402dc401cd0478d2bd91f") add_configs("bzlib", {description = "Enable bzip2 support.", default = false, type = "boolean"}) add_configs("exr", {description = "Enable exr support.", default = false, type = "boolean"}) diff --git a/packages/l/libyaml/xmake.lua b/packages/l/libyaml/xmake.lua index 55a9ad83d..372014d66 100644 --- a/packages/l/libyaml/xmake.lua +++ b/packages/l/libyaml/xmake.lua @@ -2,16 +2,41 @@ package("libyaml") set_homepage("http://pyyaml.org/wiki/LibYAML") set_description("Canonical source repository for LibYAML.") + set_license("MIT") set_urls("https://github.com/yaml/libyaml/archive/$(version).tar.gz", "https://github.com/yaml/libyaml.git") add_versions("0.2.2", "46bca77dc8be954686cff21888d6ce10ca4016b360ae1f56962e6882a17aa1fe") + add_versions("0.2.5", "fa240dbf262be053f3898006d502d514936c818e422afdcf33921c63bed9bf2e") - on_install("macosx", "linux", function (package) - if not os.isfile("configure") then - os.vrun("./bootstrap") + on_load("windows", function (package) + if not package:config("shared") then + package:add("defines", "YAML_DECLARE_STATIC") end - import("package.tools.autoconf").install(package) + end) + + on_install("windows", "macosx", "linux", "mingw", function (package) + local ver = package:version() + io.writefile("xmake.lua", format([[ + add_rules("mode.debug", "mode.release") + target("yaml") + set_kind("$(kind)") + add_files("src/*.c") + add_headerfiles("include/yaml.h") + add_includedirs("include", "$(buildir)") + set_configvar("YAML_VERSION_MAJOR", %d) + set_configvar("YAML_VERSION_MINOR", %d) + set_configvar("YAML_VERSION_PATCH", %d) + set_configvar("YAML_VERSION_STRING", "%s") + add_configfiles("cmake/config.h.in", {pattern = "@(.-)@"}) + add_defines("HAVE_CONFIG_H") + if is_kind("static") then + add_defines("YAML_DECLARE_STATIC") + else + add_defines("YAML_DECLARE_EXPORT") + end + ]], ver:major(), ver:minor(), ver:patch(), ver)) + import("package.tools.xmake").install(package, {kind = package:config("shared") and "shared" or "static"}) end) on_test(function (package) diff --git a/packages/n/numcpp/xmake.lua b/packages/n/numcpp/xmake.lua new file mode 100644 index 000000000..f0434e2bb --- /dev/null +++ b/packages/n/numcpp/xmake.lua @@ -0,0 +1,27 @@ +package("numcpp") + + set_kind("library", {headeronly = true}) + set_homepage("https://github.com/dpilger26/NumCpp") + set_description("C++ implementation of the Python Numpy library") + set_license("MIT") + + add_urls("https://github.com/dpilger26/NumCpp/archive/refs/tags/Version_$(version).tar.gz", + "https://github.com/dpilger26/NumCpp.git") + add_versions("2.4.2", "8da0494552796b76e5e9ef691176fa7cb27bc52fec4019da20bfd8fb7ba00b91") + + add_deps("cmake") + add_deps("boost") + on_install("windows", "macosx", "linux", function (package) + import("package.tools.cmake").install(package) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + void test() { + nc::NdArray a0 = {{1, 2}, {3, 4}}; + nc::NdArray a1 = {{1, 2}, {3, 4}, {5, 6}}; + a1.reshape(2, 3); + auto a2 = a1.astype(); + } + ]]}, {configs = {languages = "c++17"}, includes = "NumCpp.hpp"})) + end)