add nettle, gmp, sfntly and libtasn1 (#170)

* add nettle

* add gmp

* add sfntly

* update libxcb

* add libtasn1

* add license for nettle
pull/171/head
Hoildkv 4 years ago committed by GitHub
parent 30b3f83644
commit 8e17335f1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      packages/g/gmp/xmake.lua
  2. 24
      packages/l/libtasn1/xmake.lua
  3. 5
      packages/l/libxcb/xmake.lua
  4. 24
      packages/n/nettle/xmake.lua
  5. 44
      packages/s/sfntly/xmake.lua
  6. 5
      packages/x/xcb-proto/xmake.lua

@ -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)

@ -3,8 +3,9 @@ package("libxcb")
set_homepage("https://www.x.org/")
set_description("X.Org: Interface to the X Window System protocol")
set_urls("https://xcb.freedesktop.org/dist/libxcb-$(version).tar.bz2")
add_versions("1.13.1", "a89fb7af7a11f43d2ce84a844a4b38df688c092bf4b67683aef179cdf2a647c4")
set_urls("https://xcb.freedesktop.org/dist/libxcb-$(version).tar.gz")
add_versions("1.13.1", "f09a76971437780a602303170fd51b5f7474051722bc39d566a272d2c4bde1b5")
add_versions("1.14", "2c7fcddd1da34d9b238c9caeda20d3bd7486456fc50b3cc6567185dbd5b0ad02")
if is_plat("macosx", "linux") then
add_deps("pkg-config", "python 3.x", "xcb-proto", "libpthread-stubs", "libxau", "libxdmcp")

@ -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)

@ -3,8 +3,9 @@ package("xcb-proto")
set_homepage("https://www.x.org/")
set_description("X.Org: XML-XCB protocol descriptions for libxcb code generation")
set_urls("https://xcb.freedesktop.org/dist/xcb-proto-$(version).tar.bz2")
add_versions("1.13", "7b98721e669be80284e9bbfeab02d2d0d54cd11172b72271e47a2fe875e2bde1")
set_urls("https://xcb.freedesktop.org/dist/xcb-proto-$(version).tar.gz")
add_versions("1.13", "0698e8f596e4c0dbad71d3dc754d95eb0edbb42df5464e0f782621216fa33ba7")
add_versions("1.14", "1c3fa23d091fb5e4f1e9bf145a902161cec00d260fabf880a7a248b02ab27031")
if is_plat("macosx", "linux") then
add_deps("pkg-config", "python 3.x")

Loading…
Cancel
Save