Browse Source

update nana

ruki 6 years ago
parent
commit
611325404d
3 changed files with 63 additions and 28 deletions
  1. 28 16
      packages/c/cmake/xmake.lua
  2. 24 8
      packages/l/libjpeg/xmake.lua
  3. 11 4
      packages/n/nana/xmake.lua

+ 28 - 16
packages/c/cmake/xmake.lua

@@ -5,30 +5,42 @@ package("cmake")
     set_description("A cross-platform family of tool designed to build, test and package software")
     set_description("A cross-platform family of tool designed to build, test and package software")
 
 
     if is_host("macosx") then
     if is_host("macosx") then
-        add_urls("https://cmake.org/files/v3.11/cmake-3.11.4-Darwin-x86_64.tar.gz")
-        add_urls("https://github.com/Kitware/CMake/releases/download/v3.11.4/cmake-3.11.4-Darwin-x86_64.tar.gz")
-        add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-3.11.4-Darwin-x86_64.tar.gz")
-        add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-3.11.4-Darwin-x86_64.tar.gz")
+        add_urls("https://cmake.org/files/v$(version)-Darwin-x86_64.tar.gz", {version = function (version)
+                return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version 
+            end})
+        add_urls("https://github.com/Kitware/CMake/releases/download/v$(version)/cmake-$(version)-Darwin-x86_64.tar.gz")
+        add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-$(version)-Darwin-x86_64.tar.gz")
+        add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-$(version)-Darwin-x86_64.tar.gz")
         add_versions("3.11.4", "2b5eb705f036b1906a5e0bce996e9cd56d43d73bdee8318ece3e5ce31657b812")
         add_versions("3.11.4", "2b5eb705f036b1906a5e0bce996e9cd56d43d73bdee8318ece3e5ce31657b812")
+        add_versions("3.15.4", "adfbf611d21daa83b9bf6d85ab06a455e481b63a38d6e1270d563b03d4e5f829")
     elseif is_host("linux") and is_arch("x86_64") then
     elseif is_host("linux") and is_arch("x86_64") then
-        add_urls("https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.tar.gz")
-        add_urls("https://github.com/Kitware/CMake/releases/download/v3.11.4/cmake-3.11.4-Linux-x86_64.tar.gz")
-        add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-3.11.4-Linux-x86_64.tar.gz")
-        add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-3.11.4-Linux-x86_64.tar.gz")
+        add_urls("https://cmake.org/files/v$(version)-Linux-x86_64.tar.gz", {version = function (version)
+                return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version 
+            end})
+        add_urls("https://github.com/Kitware/CMake/releases/download/v$(version)/cmake-$(version)-Linux-x86_64.tar.gz")
+        add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-$(version)-Linux-x86_64.tar.gz")
+        add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-$(version)-Linux-x86_64.tar.gz")
         add_versions("3.11.4", "6dab016a6b82082b8bcd0f4d1e53418d6372015dd983d29367b9153f1a376435")
         add_versions("3.11.4", "6dab016a6b82082b8bcd0f4d1e53418d6372015dd983d29367b9153f1a376435")
+        add_versions("3.15.4", "7c2b17a9be605f523d71b99cc2e5b55b009d82cf9577efb50d4b23056dee1109")
     elseif is_host("windows") then
     elseif is_host("windows") then
         if os.arch() == "x64" then
         if os.arch() == "x64" then
-            add_urls("https://cmake.org/files/v3.11/cmake-3.11.4-win64-x64.zip", {excludes = "*/doc/*"})
-            add_urls("https://github.com/Kitware/CMake/releases/download/v3.11.4/cmake-3.11.4-win64-x64.zip", {excludes = "*/doc/*"})
-            add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-3.11.4-win64-x64.zip", {excludes = "*/doc/*"})
-            add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-3.11.4-win64-x64.zip", {excludes = "*/doc/*"})
+            add_urls("https://cmake.org/files/v$(version)-win64-x64.zip", {excludes = "*/doc/*", version = function (version)
+                    return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version 
+                end})
+            add_urls("https://github.com/Kitware/CMake/releases/download/v$(version)/cmake-$(version)-win64-x64.zip", {excludes = "*/doc/*"})
+            add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-$(version)-win64-x64.zip", {excludes = "*/doc/*"})
+            add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-$(version)-win64-x64.zip", {excludes = "*/doc/*"})
             add_versions("3.11.4", "d3102abd0ded446c898252b58857871ee170312d8e7fd5cbff01fbcb1068a6e5")
             add_versions("3.11.4", "d3102abd0ded446c898252b58857871ee170312d8e7fd5cbff01fbcb1068a6e5")
+            add_versions("3.15.4", "5bb49c0274800c38833e515a01af75a7341db68ea82c71856bb3cf171d2068be")
         else
         else
-            add_urls("https://cmake.org/files/v3.11/cmake-3.11.4-win32-x86.zip", {excludes = "*/doc/*"})
-            add_urls("https://github.com/Kitware/CMake/releases/download/v3.11.4/cmake-3.11.4-win32-x86.zip", {excludes = "*/doc/*"})
-            add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-3.11.4-win32-x86.zip", {excludes = "*/doc/*"})
-            add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-3.11.4-win32-x86.zip", {excludes = "*/doc/*"})
+            add_urls("https://cmake.org/files/v$(version)-win32-x86.zip", {excludes = "*/doc/*", version = function (version)
+                    return table.concat(table.slice((version):split('%.'), 1, 2), '.') .. "/cmake-" .. version 
+                end})
+            add_urls("https://github.com/Kitware/CMake/releases/download/v$(version)/cmake-$(version)-win32-x86.zip", {excludes = "*/doc/*"})
+            add_urls("https://gitlab.com/xmake-mirror/cmake-releases/raw/master/cmake-$(version)-win32-x86.zip", {excludes = "*/doc/*"})
+            add_urls("https://dev.tencent.com/u/waruqi/p/cmake-releases/git/raw/master/cmake-$(version)-win32-x86.zip", {excludes = "*/doc/*"})
             add_versions("3.11.4", "b068001ff879f86e704977c50a8c5917e4b4406c66242366dba2674abe316579")
             add_versions("3.11.4", "b068001ff879f86e704977c50a8c5917e4b4406c66242366dba2674abe316579")
+            add_versions("3.15.4", "19c2bfd26c4de4d8046dd5ad6de95b57a2556559ec81b13b94e63ea4ae49b3f2")
         end
         end
     end
     end
 
 

+ 24 - 8
packages/l/libjpeg/xmake.lua

@@ -8,15 +8,31 @@ package("libjpeg")
     add_versions("v9c", "650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122")
     add_versions("v9c", "650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122")
     add_versions("v9b", "240fd398da741669bf3c90366f58452ea59041cacc741a489b99f2f6a0bad052")
     add_versions("v9b", "240fd398da741669bf3c90366f58452ea59041cacc741a489b99f2f6a0bad052")
 
 
-    on_install("windows", function (package)
-        os.mv("jconfig.vc", "jconfig.h")
-        os.vrun("nmake -f makefile.vc")
-        os.cp("*.h", package:installdir("include"))
-        os.cp("libjpeg.lib", package:installdir("lib"))
-    end)
+    on_install(function (package)
+        io.writefile("xmake.lua", [[
+            add_rules("mode.debug", "mode.release")
+
+            target("jpeg")
+                set_kind("static")
+
+                add_files("jaricom.c", "jcapimin.c", "jcapistd.c", "jcarith.c", "jccoefct.c", "jccolor.c")
+                add_files("jcdctmgr.c", "jchuff.c", "jcinit.c", "jcmainct.c", "jcmarker.c", "jcmaster.c")
+                add_files("jcomapi.c", "jcparam.c", "jcprepct.c", "jcsample.c", "jctrans.c", "jdapimin.c")
+                add_files("jdapistd.c", "jdarith.c", "jdatadst.c", "jdatasrc.c", "jdcoefct.c", "jdcolor.c")
+                add_files("jddctmgr.c", "jdhuff.c", "jdinput.c", "jdmainct.c", "jdmarker.c", "jdmaster.c")
+                add_files("jdmerge.c", "jdpostct.c", "jdsample.c", "jdtrans.c", "jerror.c", "jfdctflt.c")
+                add_files("jfdctfst.c", "jfdctint.c", "jidctflt.c", "jidctfst.c", "jidctint.c", "jquant1.c")
+                add_files("jquant2.c", "jutils.c", "jmemmgr.c", "jmemansi.c")
 
 
-    on_install("linux", "macosx", "iphoneos", "android@linux,macosx", function (package)
-        import("package.tools.autoconf").install(package, {"--enable-shared=no"})
+                if is_plat("windows") then
+                    add_configfiles("jconfig.txt", {filename = "jconfig.h"})
+                else
+                    add_configfiles("jconfig.vc", {filename = "jconfig.h"})
+                end
+                add_includedirs("$(buildir)", {public = true})
+                add_headerfiles("jerror.h", "jmorecfg.h", "jpeglib.h", "$(buildir)/jconfig.h")
+        ]])
+        import("package.tools.xmake").install(package)
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)

+ 11 - 4
packages/n/nana/xmake.lua

@@ -8,16 +8,23 @@ package("nana")
     add_versions("1.6.2", "5f5cb791dff292e27bfa29d850b93f809a0d91d6044ea7e22ce7ae76a5d8b24e")
     add_versions("1.6.2", "5f5cb791dff292e27bfa29d850b93f809a0d91d6044ea7e22ce7ae76a5d8b24e")
     add_versions("1.7.2", "e2efb3b7619e4ef3b6de93f8afc70ff477ec6cabf4f9740f0d786904c790613f")
     add_versions("1.7.2", "e2efb3b7619e4ef3b6de93f8afc70ff477ec6cabf4f9740f0d786904c790613f")
 
 
-    if is_plat("linux") then
-        add_deps("cmake")
+    if is_plat("linux", "windows") then
+        add_deps("cmake >=3.12")
     end
     end
 
 
-    on_install("linux", function (package)
+    if is_plat("windows") then
+        add_syslinks("ole32", "shell32", "user32", "kernel32", "user32", "gdi32", "winspool", "comdlg32", "advapi32")
+    end
+
+    on_install("linux", "windows", function (package)
         import("package.tools.cmake").install(package)
         import("package.tools.cmake").install(package)
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)
         assert(package:check_cxxsnippets({test = [[
         assert(package:check_cxxsnippets({test = [[
+            #include <nana/gui.hpp>
+            #include <nana/gui/widgets/form.hpp>
+            #include <nana/gui/widgets/label.hpp>
             using namespace nana;
             using namespace nana;
             void test() {
             void test() {
                 form    fm;
                 form    fm;
@@ -26,5 +33,5 @@ package("nana")
                 fm.show();
                 fm.show();
                 exec();
                 exec();
             }
             }
-        ]]}, {configs = {languages = "c++11"}, includes = {"nana/gui/wvl.hpp", "nana/gui/widgets/label.hpp"}}))
+        ]]}, {configs = {languages = "c++11"}}))
     end)
     end)