소스 검색

add opencolorio (#710)

* add opencolorio

* update cjson
Hoildkv 3 년 전
부모
커밋
f3784d3f46
2개의 변경된 파일46개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      packages/c/cjson/xmake.lua
  2. 44 0
      packages/o/opencolorio/xmake.lua

+ 2 - 0
packages/c/cjson/xmake.lua

@@ -2,11 +2,13 @@ package("cjson")
 
     set_homepage("https://github.com/DaveGamble/cJSON")
     set_description("Ultralightweight JSON parser in ANSI C.")
+    set_license("MIT")
 
     set_urls("https://github.com/DaveGamble/cJSON/archive/v$(version).zip",
              "https://github.com/DaveGamble/cJSON.git")
     add_versions("1.7.10", "80a0584410656c8d8da2ba703744f44d7535fc4f0778d8bf4f980ce77c6a9f65")
     add_versions("1.7.14", "d797b4440c91a19fa9c721d1f8bab21078624aa9555fc64c5c82e24aa2a08221")
+    add_versions("1.7.15", "c55519316d940757ef93a779f1db1ca809dbf979c551861f339d35aaea1c907c")
 
     add_deps("cmake")
 

+ 44 - 0
packages/o/opencolorio/xmake.lua

@@ -0,0 +1,44 @@
+package("opencolorio")
+
+    set_homepage("https://opencolorio.org/")
+    set_description("A complete color management solution geared towards motion picture production with an emphasis on visual effects and computer animation.")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/AcademySoftwareFoundation/OpenColorIO/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/AcademySoftwareFoundation/OpenColorIO.git")
+    add_versions("v2.1.0", "81fc7853a490031632a69c73716bc6ac271b395e2ba0e2587af9995c2b0efb5f")
+
+    add_deps("cmake", "expat", "yaml-cpp", "imath", "pystring")
+    if is_plat("windows") then
+        add_syslinks("user32", "gdi32")
+    elseif is_plat("macosx") then
+        add_frameworks("CoreFoundation", "CoreGraphics", "ColorSync", "IOKit")
+    end
+    on_load("windows", function (package)
+        if not package:config("shared") then
+            package:add("defines", "OpenColorIO_SKIP_IMPORTS")
+        end
+    end)
+
+    on_install("windows", "macosx", "linux", function (package)
+        if package:is_plat("windows") and package:config("shared") and package:config("vs_runtime"):startswith("MT") then
+            raise("Can not build this shared library against static runtime.")
+        end
+        local configs = {"-DOCIO_BUILD_APPS=OFF", "-DOCIO_BUILD_OPENFX=OFF", "-DOCIO_BUILD_PYTHON=OFF", "-DOCIO_BUILD_DOCS=OFF", "-DOCIO_BUILD_TESTS=OFF", "-DOCIO_BUILD_GPU_TESTS=OFF"}
+        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)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <OpenColorIO/OpenColorIO.h>
+            namespace OCIO = OCIO_NAMESPACE;
+            void test() {
+                OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig();
+                OCIO::ConstProcessorRcPtr processor =
+                    config->getProcessor(OCIO::ROLE_COMPOSITING_LOG, OCIO::ROLE_SCENE_LINEAR);
+                OCIO::ConstCPUProcessorRcPtr cpu = processor->getDefaultCPUProcessor();
+            }
+        ]]}, {configs = {languages = "c++17"}}))
+    end)