Przeglądaj źródła

add bison, cpu-features and openjpeg (#181)

* add bison

* add cpu-features

* add openjpeg
Hoildkv 4 lat temu
rodzic
commit
4095212d76

+ 18 - 0
packages/b/bison/xmake.lua

@@ -0,0 +1,18 @@
+package("bison")
+
+    set_homepage("https://www.gnu.org/software/bison/")
+    set_description("A general-purpose parser generator.")
+    set_license("GPL-3.0")
+
+    add_urls("http://ftp.gnu.org/gnu/bison/bison-$(version).tar.gz")
+    add_versions("3.7.4", "fbabc7359ccd8b4b36d47bfe37ebbce44805c052526d5558b95eda125d1677e2")
+
+    set_kind("binary")
+    on_install("macosx", "linux", function (package)
+        import("package.tools.autoconf").install(package)
+        os.rm(package:installdir("share", "doc"))
+    end)
+
+    on_test(function (package)
+        os.vrun("bison -h")
+    end)

+ 28 - 0
packages/c/cpu-features/xmake.lua

@@ -0,0 +1,28 @@
+package("cpu-features")
+
+    set_homepage("https://github.com/google/cpu_features")
+    set_description("A cross platform C99 library to get cpu features at runtime.")
+    set_license("Apache-2.0")
+
+    add_urls("https://github.com/google/cpu_features/archive/$(version).tar.gz",
+             "https://github.com/google/cpu_features.git")
+    add_versions("v0.6.0", "95a1cf6f24948031df114798a97eea2a71143bd38a4d07d9a758dda3924c1932")
+
+    add_deps("cmake")
+
+    on_install("windows", "linux", "macosx", "android", function (package)
+        local configs = {"-DBUILD_TESTING=OFF"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        if package:is_plat("linux") then
+            table.insert(configs, "-DBUILD_PIC=ON")
+        end
+        import("package.tools.cmake").install(package, configs)
+        package:addenv("PATH", "bin")
+    end)
+
+    on_test(function (package)
+        if package:is_plat(os.host()) then
+            os.vrun("list_cpu_features")
+        end
+        assert(package:has_ctypes("CacheLevelInfo", {includes = "cpu_features/cpu_features_cache_info.h"}))
+    end)

+ 24 - 0
packages/o/openjpeg/xmake.lua

@@ -0,0 +1,24 @@
+package("openjpeg")
+
+    set_homepage("http://www.openjpeg.org/")
+    set_description("OpenJPEG is an open-source JPEG 2000 codec written in C language.")
+    set_license("BSD-2-Clause")
+
+    add_urls("https://github.com/uclouvain/openjpeg/archive/v$(version).tar.gz",
+             "https://github.com/uclouvain/openjpeg.git")
+    add_versions("2.3.1", "63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9")
+
+    add_deps("cmake")
+    add_deps("lcms", "libtiff", "libpng")
+
+    on_install("windows", "linux", "macosx", function (package)
+        local configs = {"-DBUILD_TESTING=OFF", "-DBUILD_DOC=OFF"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        import("package.tools.cmake").install(package, configs)
+        os.mv(package:installdir("include", "openjpeg*", "*.h"), package:installdir("include"))
+        package:add("PATH", "bin")
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("opj_version", {includes = "openjpeg.h"}))
+    end)