Pārlūkot izejas kodu

add ptex and lodepng (#332)

* update cgal

* add ptex

* fix1

* add lodepng

* update openblas

* update c-ares
Hoildkv 4 gadi atpakaļ
vecāks
revīzija
e945d5b4a3

+ 1 - 0
.github/workflows/fedora.yml

@@ -20,6 +20,7 @@ jobs:
       - name: Installation
         run: |
           uname -a
+          dnf -y install gfortran
           dnf -y install mesa-libGL-devel mesa-libGLU-devel
           dnf -y install @development-tools @rpm-development-tools
           dnf -y install copr-cli make gcc-c++

+ 6 - 7
packages/c/c-ares/xmake.lua

@@ -4,8 +4,8 @@ package("c-ares")
     set_description("A C library for asynchronous DNS requests")
 
     add_urls("https://c-ares.haxx.se/download/c-ares-$(version).tar.gz")
-
     add_versions("1.16.1", "d08312d0ecc3bd48eee0a4cc0d2137c9f194e0a28de2028928c0f6cae85f86ce")
+    add_versions("1.17.1", "d73dd0f6de824afd407ce10750ea081af47eba52b8a6cb307d220131ad93fc40")
 
     on_install("windows", function (package)
         local configs = {"-f", "Makefile.msvc"}
@@ -14,12 +14,11 @@ package("c-ares")
         if package:config("vs_runtime"):startswith("MT") then
             table.insert(configs, "RTLIBCFG=static")
         end
-        import("package.tools.nmake").install(package, configs)
-        os.cp("include", package:installdir())
-        os.cp("lib", package:installdir())
-        if package:config("shared") then
-            package:addenv("PATH", "lib")
-        else
+        import("package.tools.nmake").build(package, configs)
+        os.cp(path.join("include", "*.h"), package:installdir("include"))
+        os.cp(path.join("msvc", "cares", cfg, "*.lib"), package:installdir("lib"))
+        os.trycp(path.join("msvc", "cares", cfg, "*.dll"), package:installdir("bin"))
+        if not package:config("shared") then
             package:add("defines", "CARES_STATICLIB")
         end
     end)

+ 1 - 0
packages/c/cgal/xmake.lua

@@ -6,6 +6,7 @@ package("cgal")
 
     add_urls("https://github.com/CGAL/cgal/releases/download/v$(version)/CGAL-$(version)-library.zip")
     add_versions("5.1.1", "ceca7ea896505941878f6c1fb7a7ae86653fdd9b3d87b276da72227f173a9cd2")
+    add_versions("5.2.1", "ccdea67db79153417504f50c534cea3bb6b0e9754e7f32fb753fc19005114db0")
 
     add_configs("header_only", {description = "Use header only version.", default = true, type = "boolean"})
 

+ 28 - 0
packages/l/lodepng/xmake.lua

@@ -0,0 +1,28 @@
+package("lodepng")
+
+    set_homepage("https://lodev.org/lodepng/")
+    set_description("PNG encoder and decoder in C and C++.")
+    set_license("zlib")
+
+    add_urls("https://github.com/lvandeve/lodepng.git")
+
+    on_install(function (package)
+        io.writefile("xmake.lua", [[
+            add_rules("mode.debug", "mode.release")
+            target("lodepng")
+                set_kind("$(kind)")
+                add_files("lodepng.cpp")
+                add_headerfiles("lodepng.h")
+        ]])
+        local configs = {}
+        if package:config("shared") then
+            configs.kind = "shared"
+        elseif not package:is_plat("windows", "mingw") and package:config("pic") ~= false then
+            configs.cxflags = "-fPIC"
+        end
+        import("package.tools.xmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:has_cxxfuncs("lodepng_decode_memory", {includes = "lodepng.h"}))
+    end)

+ 7 - 4
packages/n/ninja/xmake.lua

@@ -8,20 +8,23 @@ package("ninja")
         set_urls("https://github.com/ninja-build/ninja/releases/download/v$(version)/ninja-win.zip")
         add_versions("1.9.0", "2d70010633ddaacc3af4ffbd21e22fae90d158674a09e132e06424ba3ab036e9")
         add_versions("1.10.1", "5d1211ea003ec9760ad7f5d313ebf0b659d4ffafa221187d2b4444bc03714a33")
+        add_versions("1.10.2", "bbde850d247d2737c5764c927d1071cbb1f1957dcabda4a130fa8547c12c695f")
     elseif is_host("macosx") then
         set_urls("https://github.com/ninja-build/ninja/releases/download/v$(version)/ninja-mac.zip")
         add_versions("1.9.0", "26d32a79f786cca1004750f59e545199bf110e21e300d3c2424c1fddd78f28ab")
         add_versions("1.10.1", "0bd650190d4405c15894055e349d9b59d5690b0389551d757c5ed2d3841972d1")
+        add_versions("1.10.2", "6fa359f491fac7e5185273c6421a000eea6a2f0febf0ac03ac900bd4d80ed2a5")
     elseif is_host("linux") then
         add_urls("https://github.com/ninja-build/ninja/archive/v$(version).tar.gz",
                  "https://github.com/ninja-build/ninja.git")
         add_versions("1.9.0", "5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9")
         add_versions("1.10.1", "a6b6f7ac360d4aabd54e299cc1d8fa7b234cd81b9401693da21221c62569a23e")
+        add_versions("1.10.2", "ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed")
     end
 
-    if is_host("linux") then
-        add_deps("python2", {kind = "binary"})
-    end
+    on_load("linux", function (package)
+        package:add("deps", package:version():ge("1.10.0") and "python" or "python2", {kind = "binary"})
+    end)
 
     on_install("@windows", "@msys", "@cygwin", function (package)
         os.cp("./ninja.exe", package:installdir("bin"))
@@ -32,7 +35,7 @@ package("ninja")
     end)
 
     on_install("@linux", function (package)
-        os.vrun("python2 configure.py --bootstrap")
+        os.vrun("python configure.py --bootstrap")
         os.cp("./ninja", package:installdir("bin"))
     end)
 

+ 2 - 0
packages/o/openblas/xmake.lua

@@ -19,6 +19,8 @@ package("openblas")
 
     if is_plat("linux") then
         add_syslinks("pthread")
+    elseif is_plat("windows") then
+        add_links("libopenblas")
     end
 
     on_install("windows|x64", function (package)

+ 69 - 0
packages/p/ptex/xmake.lua

@@ -0,0 +1,69 @@
+package("ptex")
+
+    set_homepage("http://ptex.us/")
+    set_description("Per-Face Texture Mapping for Production Rendering")
+    set_license("BSD-3-Clause")
+
+    add_urls("https://github.com/wdas/ptex/archive/$(version).tar.gz",
+             "https://github.com/wdas/ptex.git")
+    add_versions("v2.3.2", "30aeb85b965ca542a8945b75285cd67d8e207d23dbb57fcfeaab587bb443402b")
+
+    add_deps("zlib")
+    if is_plat("linux") then
+        add_syslinks("pthread")
+    end
+
+    on_load("windows", "mingw@windows", function (package)
+        if not package:config("shared") then
+            package:add("defines", "PTEX_STATIC")
+        end
+    end)
+
+    on_install("windows", "linux", "macosx", function (package)
+        io.replace("src/ptex/PtexPlatform.h", "sys/types.h", "unistd.h", {plain = true})
+        io.writefile("xmake.lua", format([[
+            add_rules("mode.debug", "mode.release")
+            set_configvar("PTEX_MAJOR_VERSION", "%s")
+            set_configvar("PTEX_MINOR_VERSION", "%s")
+            add_requires("zlib")
+            target("ptex")
+                set_kind("$(kind)")
+                add_packages("zlib")
+                add_files("src/ptex/*.cpp")
+                add_includedirs("src/ptex", {public = true})
+                add_headerfiles("src/ptex/(*.h)")
+                set_configdir("src/ptex")
+                add_configfiles("src/ptex/PtexVersion.h.in", {pattern = "@(.-)@"})
+                if is_plat("macosx") or is_plat("linux") then
+                    add_syslinks("pthread")
+                    add_cxxflags("-fvisibility=default")
+                end
+                if get_config("kind") == "static" then
+                    add_defines("PTEX_STATIC", {public = true})
+                else
+                    add_defines("PTEX_EXPORTS")
+                end
+            target("ptxinfo")
+                set_kind("binary")
+                add_deps("ptex")
+                add_packages("zlib")
+                add_files("src/utils/ptxinfo.cpp")
+        ]], package:version():major(), package:version():minor()))
+        local configs = {}
+        configs.mode = package:debug() and "debug" or "release"
+        if package:config("shared") then
+            configs.kind = "shared"
+        elseif package:is_plat("linux") and package:config("pic") ~= false then
+            configs.cxflags = "-fPIC"
+        end
+        import("package.tools.xmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            void test() {
+                Ptex::String error;
+                PtexPtr<PtexCache> c(PtexCache::create(0,0));
+            }
+        ]]}, {includes = "Ptexture.h"}))
+    end)