-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
211 lines (173 loc) · 7.36 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup active_variants 1.1
PortGroup compiler_blacklist_versions 1.0
PortGroup conflicts_build 1.0
PortGroup legacysupport 1.0
PortGroup muniversal 1.0
name gnutls
version 3.7.11
revision 0
categories devel security
# yes, some of the libs are GPL only
license LGPL-2.1+ GPL-3+
maintainers {mps @Schamschula} openmaintainer
description GNU Transport Layer Security Library
long_description \
GnuTLS is a portable ANSI C based library which implements the TLS 1.2, \
TLS 1.1, TLS 1.0, SSL 3.0, and Datagram TLS protocols. The library does \
not include any patented algorithms and is available under the GNU \
Lesser General Public License (LGPL).
homepage http://www.gnutls.org/
checksums rmd160 b8a3b948b2cfd504f72e04a31fce31a79b4316b1 \
sha256 90e337504031ef7d3077ab1a52ca8bac9b2f72bc454c95365a1cd1e0e81e06e9 \
size 6406420
subport ${name} {
conflicts ${name}-devel
patchfiles patch-lib-system-certs.c.old.diff
}
subport ${name}-devel {
conflicts ${name}
version 3.8.6
revision 0
checksums rmd160 fa7d5faf5359e6de786eacb369b8c4077b15fd99 \
sha256 2e1588aae53cb32d43937f1f4eca28febd9c0c7aa1734fc5dd61a7e81e0ebcdd \
size 6517476
patchfiles patch-lib-system-certs.c.diff
}
if {${build_arch} ne "ppc" || ${build_arch} ne "ppc64"} {
# see: https://gitlab.com/gnutls/gnutls/-/issues/1370
# and https://github.com/macports/macports-ports/pull/14613
configure.args-append --disable-hardware-acceleration
}
set branch [join [lrange [split ${version} .] 0 1] .]
set major [join [lrange [split ${version} .] 0 2] .]
master_sites https://www.gnupg.org/ftp/gcrypt/gnutls/v${branch}/ \
https://mirrors.dotsrc.org/gcrypt/gnutls/v${branch}/
use_xz yes
# deal with minor updates that extract to major version number
worksrcdir ${name}-${major}
# see: https://trac.macports.org/ticket/57893
# and https://github.com/macports/macports-ports/pull/3379 for autogen
conflicts_build autogen
depends_build-append \
port:gettext \
port:pkgconfig
depends_lib-append \
port:gettext-runtime \
port:gmp \
port:libidn2 \
port:libtasn1 \
port:libunistring \
port:p11-kit \
port:nettle \
port:zlib
patchfiles-append \
implicit.patch
post-patch {
# Remove comments which confuse at least Leopard's assembler.
reinplace {/^#/d} {*}[glob ${worksrcpath}/lib/accelerated/x86/macosx/*.s]
}
# Note: configure script detects zstd, but flags it as missing anyway
configure.args-append \
--disable-dependency-tracking \
--disable-doc \
--disable-guile \
--disable-heartbeat-support \
--disable-libdane \
--disable-silent-rules \
--disable-static \
--enable-manpages \
--enable-openssl-compatibility \
--with-p11-kit \
--with-system-priority-file="${prefix}/etc/gnutls/default-priorities" \
--with-default-trust-store-pkcs11=pkcs11: \
--without-brotli \
--without-zstd \
ac_cv_prog_AWK=/usr/bin/awk
# https://trac.macports.org/wiki/WimplicitFunctionDeclaration#strchr
configure.checks.implicit_function_declaration.whitelist-append strchr
compiler.thread_local_storage yes
# Undefined symbols for architecture x86_64: "___get_cpuid_count"
compiler.blacklist-append {clang < 1000} {macports-clang-3.[0-9]} {macports-clang-[4-6].0}
if {${os.platform} eq "darwin" && ${os.major} < 10 && [string match *clang* ${configure.compiler}] } {
depends_build-append port:cctools
configure.env-append NM=${prefix}/bin/nm
configure.args-append lt_cv_path_NM=${prefix}/bin/nm
}
platform darwin 8 {
depends_build-append port:texinfo
configure.cppflags-append -D__WORDSIZE=32
}
variant brotli description {Build brotli support} {
depends_lib-append \
port:brotli
configure.args-delete \
--without-brotli
}
variant dane description {Build libdane using unbound libraries} {
depends_lib-append port:unbound
configure.args-append --with-unbound-root-key-file="${prefix}/var/run/unbound/root.key"
configure.args-delete --disable-libdane
}
variant docs description {Install supplemental developer documentation} {
depends_build-append \
port:gtk-doc
configure.args-delete \
--disable-doc
}
# as of r120660 (#43881) unbound installs its root key file at ${prefix}/var/run/unbound/root.key
# the following may be superfluous
if {[variant_isset dane] && ![file exists ${prefix}/var/run/unbound/root.key]} {
notes "
***
*** WARNING:
***
*** The DNSSEC root key file in ${prefix}/var/run/unbound/root.key was not found.
*** This file is needed for the verification of DNSSEC responses.
*** Use the command: sudo unbound-anchor -a \"${prefix}/var/run/unbound/root.key\"
*** to generate or update it.
***
"
}
variant guile description {Build guile bindings} {
# there currently is a build issue with the guile variant
# the workaround is to first install guile w/o guile and then with +guile
depends_lib-append port:guile
configure.args-replace --disable-guile --enable-guile
}
if {${universal_possible} && [variant_isset universal]} {
set merger_host(x86_64) x86_64-apple-${os.platform}${os.major}
set merger_host(i386) i686-apple-${os.platform}${os.major}
set merger_configure_args(x86_64) --build=x86_64-apple-${os.platform}${os.major}
set merger_configure_args(i386) --build=i686-apple-${os.platform}${os.major}
set merger_host(ppc) powerpc-apple-${os.platform}${os.major}
set merger_host(ppc64) powerpc64-apple-${os.platform}${os.major}
set merger_configure_args(ppc) --build=powerpc-apple-${os.platform}${os.major}
set merger_configure_args(ppc64) --build=powerpc64-apple-${os.platform}${os.major}
} elseif {${build_arch} eq "i386"} {
configure.args-append \
--host=i686-apple-${os.platform}${os.major} \
--build=i686-apple-${os.platform}${os.major}
} elseif {${build_arch} eq "ppc"} {
configure.args-append \
--host=powerpc-apple-${os.platform}${os.major} \
--build=powerpc-apple-${os.platform}${os.major}
} elseif {${build_arch} eq "ppc64"} {
configure.args-append \
--host=powerpc64-apple-${os.platform}${os.major} \
--build=powerpc64-apple-${os.platform}${os.major}
} else {
configure.args-append \
--host=${build_arch}-apple-${os.platform}${os.major} \
--build=${build_arch}-apple-${os.platform}${os.major}
}
test.run yes
test.target check
post-destroot {
move ${destroot}${prefix}/bin/certtool ${destroot}${prefix}/bin/gnutls-certtool
move ${destroot}${prefix}/share/man/man1/certtool.1 ${destroot}${prefix}/share/man/man1/gnutls-certtool.1
}
livecheck.type regex
livecheck.url [lindex ${master_sites} 0]
livecheck.regex "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"