add nettle, gmp, sfntly and libtasn1 (#170)
* add nettle * add gmp * add sfntly * update libxcb * add libtasn1 * add license for nettlepull/171/head
parent
30b3f83644
commit
8e17335f1a
6 changed files with 122 additions and 4 deletions
@ -0,0 +1,24 @@ |
||||
package("gmp") |
||||
|
||||
set_homepage("https://gmplib.org/") |
||||
set_description("GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers.") |
||||
set_license("LGPL-3.0") |
||||
|
||||
add_urls("https://gmplib.org/download/gmp/gmp-$(version).tar.xz") |
||||
add_versions("6.2.1", "fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2") |
||||
|
||||
on_install("macosx", "linux", function (package) |
||||
local configs = {} |
||||
if package:config("shared") then |
||||
table.insert(configs, "--enable-shared=yes") |
||||
table.insert(configs, "--enable-static=no") |
||||
else |
||||
table.insert(configs, "--enable-static=yes") |
||||
table.insert(configs, "--enable-shared=no") |
||||
end |
||||
import("package.tools.autoconf").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("gmp_randinit", {includes = "gmp.h"})) |
||||
end) |
@ -0,0 +1,24 @@ |
||||
package("libtasn1") |
||||
|
||||
set_homepage("https://www.gnu.org/software/libtasn1/") |
||||
set_description("Libtasn1 is the ASN.1 library used by GnuTLS, p11-kit and some other packages.") |
||||
set_license("LGPL-2.1") |
||||
|
||||
add_urls("https://ftp.gnu.org/gnu/libtasn1/libtasn1-$(version).tar.gz") |
||||
add_versions("4.15.0", "dd77509fe8f5304deafbca654dc7f0ea57f5841f41ba530cff9a5bf71382739e") |
||||
|
||||
on_install("macosx", "linux", function (package) |
||||
local configs = {"--disable-doc", "--disable-dependency-tracking", "--with-pic"} |
||||
if package:config("shared") then |
||||
table.insert(configs, "--enable-shared") |
||||
table.insert(configs, "--disable-static") |
||||
else |
||||
table.insert(configs, "--disable-shared") |
||||
table.insert(configs, "--enable-static") |
||||
end |
||||
import("package.tools.autoconf").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("asn1_create_element", {includes = "libtasn1.h"})) |
||||
end) |
@ -0,0 +1,24 @@ |
||||
package("nettle") |
||||
|
||||
set_homepage("https://www.lysator.liu.se/~nisse/nettle/") |
||||
set_description("Nettle is a cryptographic library that is designed to fit easily in more or less any context.") |
||||
set_license("LGPL-3.0") |
||||
|
||||
add_urls("https://ftp.gnu.org/gnu/nettle/nettle-$(version).tar.gz") |
||||
add_versions("3.6", "d24c0d0f2abffbc8f4f34dcf114b0f131ec3774895f3555922fe2f40f3d5e3f1") |
||||
|
||||
on_install("macosx", "linux", function (package) |
||||
local configs = {"--disable-openssl", "--disable-documentation", "--enable-pic"} |
||||
if package:config("shared") then |
||||
table.insert(configs, "--enable-shared") |
||||
table.insert(configs, "--disable-static") |
||||
else |
||||
table.insert(configs, "--disable-shared") |
||||
table.insert(configs, "--enable-static") |
||||
end |
||||
import("package.tools.autoconf").install(package, configs) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:has_cfuncs("sha1_init", {includes = "nettle/sha1.h"})) |
||||
end) |
@ -0,0 +1,44 @@ |
||||
package("sfntly") |
||||
|
||||
set_homepage("https://github.com/googlefonts/sfntly") |
||||
set_description("The sfntly project contains Java and C++ libraries for reading, editing, and writing sfnt container fonts (OpenType, TrueType, AAT/GX, and Graphite.)") |
||||
|
||||
local commits = {["20190917"] = "1e7adf313bd9c488a70015f8df8782f7c65e9ce7"} |
||||
add_urls("https://github.com/googlefonts/sfntly/archive/$(version).zip", {version = function (version) return commits[version] end}) |
||||
add_versions("20190917", "8b27d570624dcbe1769c64274c75cfce4afc9d12893b0b8acba090e5c870e51f") |
||||
|
||||
add_deps("icu4c") |
||||
if is_plat("linux") then |
||||
add_syslinks("pthread") |
||||
end |
||||
|
||||
on_install("linux", "macosx", "windows", function (package) |
||||
os.cd(path.join("cpp", "src")) |
||||
io.replace(path.join("sfntly", "port", "atomic.h"), "WIN32", "_WIN32") |
||||
io.replace(path.join("sfntly", "port", "lock.h"), "WIN32", "_WIN32") |
||||
io.writefile("xmake.lua", string.format([[ |
||||
add_rules("mode.debug", "mode.release") |
||||
add_requires("icu4c") |
||||
target("sfntly") |
||||
set_kind("%s") |
||||
set_languages("cxx14") |
||||
add_includedirs("%s") |
||||
add_packages("icu4c") |
||||
add_defines("SFNTLY_NO_EXCEPTION") |
||||
if is_plat("windows") then |
||||
add_defines("NOMINMAX") |
||||
end |
||||
add_files("sfntly/*.cc", "sfntly/data/*.cc", "sfntly/port/*.cc", "sfntly/table/*.cc", "sfntly/table/core/*.cc", "sfntly/table/bitmap/*.cc", "sfntly/table/truetype/*.cc") |
||||
add_headerfiles("(sfntly/*.h)", "(sfntly/data/*.h)", "(sfntly/math/*.h)", "(sfntly/port/*.h)", "(sfntly/table/*.h)", "(sfntly/table/core/*.h)", "(sfntly/table/bitmap/*.h)", "(sfntly/table/truetype/*.h)") |
||||
]], package:config("shared") and "shared" or "static", os.curdir():replace("\\", "/"))) |
||||
import("package.tools.xmake").install(package) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
assert(package:check_cxxsnippets({test = [[ |
||||
void test() { |
||||
sfntly::FontArray fonts; |
||||
sfntly::Ptr<sfntly::Font> font; |
||||
} |
||||
]]}, {configs = {languages = "c++14"}, includes = {"sfntly/font.h"}})) |
||||
end) |
Loading…
Reference in new issue