Procházet zdrojové kódy

add spot and mumps (#707)

* add spot

* add mumps

* update lief
Hoildkv před 3 roky
rodič
revize
d6067a4704

+ 9 - 7
packages/l/lief/xmake.lua

@@ -2,21 +2,23 @@ package("lief")
 
     set_homepage("https://lief.quarkslab.com")
     set_description("Library to Instrument Executable Formats.")
+    set_license("Apache-2.0")
 
     set_urls("https://github.com/lief-project/LIEF/archive/$(version).tar.gz",
              "https://github.com/lief-project/LIEF.git")
     add_versions("0.10.1", "6f30c98a559f137e08b25bcbb376c0259914b33c307b8b901e01ca952241d00a")
+    add_versions("0.11.5", "6d6d57304a56850958e4ce54f3da2ea2b9eb856ccbab61c6cde9cba15d7c9da5")
 
     add_deps("cmake")
 
-    add_configs("elf",    { description = "Enable ELF module.", default = true, type = "boolean"})
-    add_configs("pe",     { description = "Enable PE module.", default = true, type = "boolean"})
-    add_configs("macho",  { description = "Enable MachO module.", default = true, type = "boolean"})
+    add_configs("elf",    {description = "Enable ELF module.", default = true, type = "boolean"})
+    add_configs("pe",     {description = "Enable PE module.", default = true, type = "boolean"})
+    add_configs("macho",  {description = "Enable MachO module.", default = true, type = "boolean"})
 
-    add_configs("dex",    { description = "Enable Dex module.", default = false, type = "boolean"})
-    add_configs("vdex",   { description = "Enable Vdex module.", default = false, type = "boolean"})
-    add_configs("oat",    { description = "Enable Oat module.", default = false, type = "boolean"})
-    add_configs("art",    { description = "Enable Art module.", default = false, type = "boolean"})
+    add_configs("dex",    {description = "Enable Dex module.", default = false, type = "boolean"})
+    add_configs("vdex",   {description = "Enable Vdex module.", default = false, type = "boolean"})
+    add_configs("oat",    {description = "Enable Oat module.", default = false, type = "boolean"})
+    add_configs("art",    {description = "Enable Art module.", default = false, type = "boolean"})
 
     on_install("macosx", "linux", "windows", function (package)
         local configs = {"-DLIEF_PYTHON_API=OFF", "-DLIEF_DOC=OFF", "-DLIEF_TESTS=OFF", "-DLIEF_EXAMPLES=OFF", "-DLIEF_INSTALL_PYTHON=OFF"}

+ 53 - 0
packages/m/mumps/xmake.lua

@@ -0,0 +1,53 @@
+package("mumps")
+
+    set_homepage("http://mumps.enseeiht.fr/")
+    set_description("MUMPS: MUltifrontal Massively Parallel sparse direct Solver")
+
+    add_urls("http://mumps.enseeiht.fr/MUMPS_$(version).tar.gz")
+    add_versions("5.4.1", "93034a1a9fe0876307136dcde7e98e9086e199de76f1c47da822e7d4de987fa8")
+
+    add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
+
+    add_deps("scotch", "openblas")
+    if is_plat("linux") then
+        add_syslinks("pthread")
+    end
+    add_links("smumps", "dmumps", "cmumps", "zmumps", "mumps_common", "pord", "mpiseq")
+    on_install("linux", function (package)
+        import("lib.detect.find_tool")
+        local fortranc = find_tool("gfortran")
+        if not fortranc then
+            raise("gfortran not found!")
+        end
+
+        os.cp("Make.inc/Makefile.inc.generic.SEQ", "Makefile.inc")
+        io.replace("Makefile.inc", "ORDERINGSF  = -Dpord", "ORDERINGSF  = -Dscotch -Dpord", {plain = true})
+        io.replace("Makefile.inc", "LAPACK = -llapack", "LAPACK = -lopenblas", {plain = true})
+        io.replace("Makefile.inc", "LIBBLAS = -lblas", "LIBBLAS = -lopenblas", {plain = true})
+        io.replace("Makefile.inc", "f90", fortranc.program, {plain = true})
+        io.replace("Makefile.inc", "OPTF    = -O", "OPTF    = -O -std=legacy", {plain = true})
+        local envs = import("package.tools.make").buildenvs(package)
+        local cflags, ldflags
+        for _, dep in ipairs(package:orderdeps()) do
+            local fetchinfo = dep:fetch()
+            if fetchinfo then
+                for _, includedir in ipairs(fetchinfo.includedirs or fetchinfo.sysincludedirs) do
+                    cflags = (cflags or "") .. " -I" .. includedir
+                end
+                for _, linkdir in ipairs(fetchinfo.linkdirs) do
+                    ldflags = (ldflags or "") .. " -L" .. linkdir
+                end
+            end
+        end
+        ldflags = (ldflags or "") .. " -lesmumps -lscotch -lscotcherr"
+        envs.ISCOTCH = cflags
+        envs.LSCOTCH = ldflags
+        os.vrunv("make", {"all"}, {envs = envs})
+        os.cp("include/*.h", package:installdir("include"))
+        os.cp("lib/*.a|README", package:installdir("lib"))
+        os.cp("libseq/*.a", package:installdir("lib"))
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("dmumps_c", {includes = {"dmumps_c.h"}}))
+    end)

+ 2 - 0
packages/s/scotch/xmake.lua

@@ -11,6 +11,7 @@ package("scotch")
     if is_plat("linux") then
         add_syslinks("pthread")
     end
+    add_links("esmumps", "scotch", "scotcherr", "scotcherrexit", "scotchmetis")
     on_install("macosx|x86_64", "linux", function (package)
         os.cd("src")
         if package:is_plat("macosx") then
@@ -40,6 +41,7 @@ package("scotch")
             envs.LDFLAGS = ldflags
         end
         os.vrunv("make", {"scotch"}, {envs = envs})
+        os.vrunv("make", {"esmumps"}, {envs = envs})
         os.vrunv("make", {"prefix=" .. package:installdir(), "install"}, {envs = envs})
     end)
 

+ 27 - 0
packages/s/spot/xmake.lua

@@ -0,0 +1,27 @@
+package("spot")
+
+    set_homepage("https://spot.lrde.epita.fr/")
+    set_description("Spot: a platform for LTL and ω-automata manipulation")
+    set_license("GPL-3.0")
+
+    add_urls("http://www.lrde.epita.fr/dload/spot/spot-2.10.1.tar.gz")
+    add_versions("2.10.1", "38002989fc8e3725841a0537665bb2d5dfc259d2e09358100322c38f4c7481ad")
+
+    on_install("macosx", "linux", function (package)
+        local configs = {"--disable-python"}
+        table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
+        table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
+        if package:config("pic") then
+            table.insert(configs, "--with-pic")
+        end
+        import("package.tools.autoconf").install(package, configs)
+    end)
+
+    on_test(function (package)
+        assert(package:check_cxxsnippets({test = [[
+            #include <spot/tl/parse.hh>
+            void test() {
+                spot::formula f = spot::parse_formula("& & G p0 p1 p2");
+            }
+        ]]}, {configs = {languages = "c++17"}}))
+    end)