Przeglądaj źródła

Merge pull request #93 from xq114/master

Add package openexr
ruki 4 lat temu
rodzic
commit
8a5e840b15
2 zmienionych plików z 38 dodań i 1 usunięć
  1. 31 0
      packages/o/openexr/xmake.lua
  2. 7 1
      packages/z/zlib/xmake.lua

+ 31 - 0
packages/o/openexr/xmake.lua

@@ -0,0 +1,31 @@
+package("openexr")
+
+    set_homepage("https://www.openexr.com/")
+    set_description("OpenEXR provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.")
+
+    add_urls("https://github.com/AcademySoftwareFoundation/openexr/archive/v$(version).tar.gz",
+             "https://github.com/AcademySoftwareFoundation/openexr.git")
+
+    add_versions("2.5.3", "6a6525e6e3907715c6a55887716d7e42d09b54d2457323fcee35a0376960bebf")
+
+    add_deps("cmake")
+    add_deps("zlib")
+
+    on_install("macosx", "linux", "windows", "mingw", function (package)
+        local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_OPENEXR_EXAMPLES=OFF"}
+        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        table.insert(configs, "-DPYILMBASE_ENABLE=" .. "OFF")
+        import("package.tools.cmake").install(package, configs)
+        package:addenv("PATH", "bin")
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <stdio.h>
+            void test() {
+                printf( OPENEXR_PACKAGE_STRING );
+            }
+        ]]}, {configs = {defines = "c++14"},
+              includes = {"OpenEXR/OpenEXRConfig.h"}}))
+    end)

+ 7 - 1
packages/z/zlib/xmake.lua

@@ -26,10 +26,16 @@ package("zlib")
         end
     end)
 
-    on_install("linux", "macosx", function (package)
+    on_install("macosx", function (package)
         import("package.tools.autoconf").install(package, {"--static"})
     end)
 
+    on_install("linux", function (package)
+        import("package.tools.autoconf").configure(package, {"--static"})
+        io.gsub("Makefile", "\nCFLAGS=(.-)\n", "\nCFLAGS=%1 -fPIC\n")
+        os.vrun("make install -j4")
+    end)
+
     on_install("iphoneos", "android@linux,macosx", "mingw@linux,macosx", "cross", function (package)
         import("package.tools.autoconf").configure(package, {host = "", "--static"})
         io.gsub("Makefile", "\nAR=.-\n",      "\nAR=" .. (package:build_getenv("ar") or "") .. "\n")