Skip to content

Commit 3fc0bfb

Browse files
committed
gnutls: add package
1 parent 8b25f3d commit 3fc0bfb

File tree

5 files changed

+142
-85
lines changed

5 files changed

+142
-85
lines changed

packages/b/brotli/xmake.lua

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
1-
package("brotli")
2-
set_homepage("https://github.com/google/brotli")
3-
set_description("Brotli compression format.")
4-
set_license("MIT")
5-
6-
set_urls("https://github.com/google/brotli/archive/$(version).tar.gz",
7-
"https://github.com/google/brotli.git")
8-
9-
add_versions("v1.1.0", "e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff")
10-
add_versions("v1.0.9", "f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46")
11-
12-
-- Fix VC C++ 12.0 BROTLI_MSVC_VERSION_CHECK calls
13-
-- VC <= 2012 build failed
14-
if is_plat("windows") then
15-
add_patches("v1.0.9", path.join(os.scriptdir(), "patches", "1.0.9", "common_platform.patch"),
16-
"5d7363a6ed1f9a504dc7af08920cd184f0d04d1ad12d25d657364cf0a2dae6bb")
17-
add_patches("v1.0.9", path.join(os.scriptdir(), "patches", "1.0.9", "tool_brotli.patch"),
18-
"333e2a0306cf33f2fac381aa6b81afd3d1237e7511e5cc8fe7fb760d16d01ca1")
19-
end
20-
21-
add_links("brotlienc", "brotlidec", "brotlicommon")
22-
23-
if is_plat("mingw") and is_subhost("msys") then
24-
add_extsources("pacman::brotli")
25-
elseif is_plat("linux") then
26-
add_extsources("pacman::brotli", "apt::libbrotli-dev")
27-
elseif is_plat("macosx") then
28-
add_extsources("brew::brotli")
29-
end
30-
31-
on_load(function (package)
32-
package:addenv("PATH", "bin")
33-
end)
34-
35-
if on_fetch then
36-
on_fetch("linux", "macosx", function (package, opt)
37-
if opt.system then
38-
local result
39-
for _, name in ipairs({"libbrotlidec", "libbrotlienc", "libbrotlicommon"}) do
40-
local pkginfo = package.find_package and package:find_package("pkgconfig::" .. name, opt)
41-
if pkginfo then
42-
if not result then
43-
result = table.copy(pkginfo)
44-
else
45-
local includedirs = pkginfo.sysincludedirs or pkginfo.includedirs
46-
result.links = table.wrap(result.links)
47-
result.linkdirs = table.wrap(result.linkdirs)
48-
result.includedirs = table.wrap(result.includedirs)
49-
table.join2(result.includedirs, includedirs)
50-
table.join2(result.linkdirs, pkginfo.linkdirs)
51-
table.join2(result.links, pkginfo.links)
52-
end
53-
end
54-
end
55-
return result
56-
end
57-
end)
58-
end
59-
60-
on_install(function (package)
61-
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
62-
local configs = {buildir = "xbuild", vers = package:version_str()}
63-
if package:config("shared") then
64-
configs.kind = "shared"
65-
end
66-
if package:is_plat("linux") and package:config("pic") ~= false then
67-
configs.cxflags = "-fPIC"
68-
end
69-
import("package.tools.xmake").install(package, configs)
70-
end)
71-
72-
on_test(function(package)
73-
if not package:is_cross() then
74-
os.vrun("brotli --version")
75-
end
76-
assert(package:check_csnippets([[
77-
void test() {
78-
BrotliEncoderState* s = BrotliEncoderCreateInstance(NULL, NULL, NULL);
79-
BrotliEncoderDestroyInstance(s);
80-
}
81-
]], {includes = "brotli/encode.h"}))
82-
end)
1+
package("brotli")
2+
set_homepage("https://github.com/google/brotli")
3+
set_description("Brotli compression format.")
4+
set_license("MIT")
5+
6+
set_urls("https://github.com/google/brotli/archive/$(version).tar.gz",
7+
"https://github.com/google/brotli.git")
8+
9+
add_versions("v1.1.0", "e720a6ca29428b803f4ad165371771f5398faba397edf6778837a18599ea13ff")
10+
add_versions("v1.0.9", "f9e8d81d0405ba66d181529af42a3354f838c939095ff99930da6aa9cdf6fe46")
11+
12+
-- Fix VC C++ 12.0 BROTLI_MSVC_VERSION_CHECK calls
13+
-- VC <= 2012 build failed
14+
if is_plat("windows") then
15+
add_patches("v1.0.9", path.join(os.scriptdir(), "patches", "1.0.9", "common_platform.patch"),
16+
"5d7363a6ed1f9a504dc7af08920cd184f0d04d1ad12d25d657364cf0a2dae6bb")
17+
add_patches("v1.0.9", path.join(os.scriptdir(), "patches", "1.0.9", "tool_brotli.patch"),
18+
"333e2a0306cf33f2fac381aa6b81afd3d1237e7511e5cc8fe7fb760d16d01ca1")
19+
end
20+
21+
add_links("brotlienc", "brotlidec", "brotlicommon")
22+
23+
if is_plat("mingw") and is_subhost("msys") then
24+
add_extsources("pacman::brotli")
25+
elseif is_plat("linux") then
26+
add_extsources("pacman::brotli", "apt::libbrotli-dev")
27+
elseif is_plat("macosx") then
28+
add_extsources("brew::brotli")
29+
end
30+
31+
on_load(function (package)
32+
package:addenv("PATH", "bin")
33+
end)
34+
35+
if on_fetch then
36+
on_fetch("linux", "macosx", function (package, opt)
37+
if opt.system then
38+
local result
39+
for _, name in ipairs({"libbrotlidec", "libbrotlienc", "libbrotlicommon"}) do
40+
local pkginfo = package.find_package and package:find_package("pkgconfig::" .. name, opt)
41+
if pkginfo then
42+
if not result then
43+
result = table.copy(pkginfo)
44+
else
45+
local includedirs = pkginfo.sysincludedirs or pkginfo.includedirs
46+
result.links = table.wrap(result.links)
47+
result.linkdirs = table.wrap(result.linkdirs)
48+
result.includedirs = table.wrap(result.includedirs)
49+
table.join2(result.includedirs, includedirs)
50+
table.join2(result.linkdirs, pkginfo.linkdirs)
51+
table.join2(result.links, pkginfo.links)
52+
end
53+
end
54+
end
55+
return result
56+
end
57+
end)
58+
end
59+
60+
on_install(function (package)
61+
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
62+
local configs = {buildir = "xbuild", vers = package:version_str():gsub("^v", "")}
63+
if package:config("shared") then
64+
configs.kind = "shared"
65+
end
66+
if package:is_plat("linux") and package:config("pic") ~= false then
67+
configs.cxflags = "-fPIC"
68+
end
69+
import("package.tools.xmake").install(package, configs)
70+
end)
71+
72+
on_test(function(package)
73+
if not package:is_cross() then
74+
os.vrun("brotli --version")
75+
end
76+
assert(package:check_csnippets([[
77+
void test() {
78+
BrotliEncoderState* s = BrotliEncoderCreateInstance(NULL, NULL, NULL);
79+
BrotliEncoderDestroyInstance(s);
80+
}
81+
]], {includes = "brotli/encode.h"}))
82+
end)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/extra/Makefile.am.orig 2013-02-03 19:40:27.000000000 -0600
2+
+++ b/extra/Makefile.am 2013-02-06 23:08:54.619176090 -0600
3+
@@ -61,7 +61,7 @@
4+
if ENABLE_MINITASN1
5+
libgnutls_openssl_la_LIBADD += ../lib/minitasn1/libminitasn1.la
6+
else
7+
-libgnutls_openssl_la_LIBADD += $(LTLIBTASN1)
8+
+libgnutls_openssl_la_LIBADD += $(LIBTASN1_LIBS)
9+
endif
10+
11+
libgnutls_openssl_la_LIBADD += $(LIBSOCKET)

packages/g/gnutls/xmake.lua

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package("gnutls")
2+
set_homepage("https://www.gnutls.org/")
3+
set_description("GnuTLS is a secure communications library implementing the SSL, TLS and DTLS protocols and technologies around them.")
4+
set_license("LGPL-2.1")
5+
6+
add_urls("https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-$(version).tar.xz")
7+
add_versions("3.8.9", "69e113d802d1670c4d5ac1b99040b1f2d5c7c05daec5003813c049b5184820ed")
8+
9+
add_patches(">=3.6.6", "patches/3.6.6/fix-external-libtasn1-detection.patch", "6493f69e782d60fe04de4b0040987e99851c522d0baf2fe25d10b85b63e97863")
10+
11+
-- Default to shared library to make gnutls_global_init constructors accessible
12+
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean"})
13+
14+
add_deps("autotools")
15+
add_deps("nettle", "p11-kit", "libtasn1", "libidn2", "leancrypto", "gmp", "libunistring", "brotli", "zlib", "zstd")
16+
17+
on_install("linux", "macosx", "mingw", function (package)
18+
local configs = {"--disable-tests",
19+
"--with-idn",
20+
"--with-brotli",
21+
"--with-zstd",
22+
"--enable-openssl-compatibility",
23+
"--with-default-trust-store-pkcs11=pkcs11:",
24+
"--with-leancrypto"}
25+
if not package:is_plat("mingw") then
26+
table.insert(configs, "--enable-ktls")
27+
end
28+
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
29+
if package:is_debug() then
30+
table.insert(configs, "--enable-debug")
31+
end
32+
import("package.tools.autoconf")
33+
local envs = autoconf.buildenvs(package, {packagedeps = {"nettle", "p11-kit", "libtasn1", "libidn2", "leancrypto", "gmp", "libunistring", "brotli", "zlib", "zstd"}})
34+
autoconf.install(package, configs, {envs = envs})
35+
end)
36+
37+
on_test(function (package)
38+
assert(package:check_csnippets([[
39+
#include <gnutls/gnutls.h>
40+
void test(void) {
41+
gnutls_session_t session;
42+
gnutls_global_deinit();
43+
}
44+
]]))
45+
end)

packages/l/libidn2/xmake.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ package("libidn2")
77
add_urls("https://ftpmirror.gnu.org/gnu/libidn/libidn2-$(version).tar.gz",
88
"https://ftp.gnu.org/gnu/libidn/libidn2-$(version).tar.gz")
99
add_versions("2.3.2", "76940cd4e778e8093579a9d195b25fff5e936e9dc6242068528b437a76764f91")
10+
add_versions("2.3.7", "4c21a791b610b9519b9d0e12b8097bf2f359b12f8dd92647611a929e6bfd7d64")
1011

1112
add_deps("libunistring")
1213
if is_plat("linux") then
1314
add_extsources("apt::libidn2-dev", "pacman::libidn2")
1415
end
1516

16-
on_install("macosx", "linux", function (package)
17-
local configs = {"--disable-dependency-tracking"}
17+
on_install("macosx", "linux", "mingw", function (package)
18+
local configs = {"--disable-dependency-tracking", "--disable-doc"}
1819
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
1920
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
2021
if package:config("pic") ~= false then

packages/l/libunistring/xmake.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ package("libunistring")
1111

1212
add_deps("libiconv")
1313

14-
on_install("linux", "macosx", function (package)
14+
on_install("linux", "macosx", "mingw", function (package)
1515
local configs = {"--disable-dependency-tracking"}
1616
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
1717
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))

0 commit comments

Comments
 (0)