diff options
Diffstat (limited to 'meta/recipes-support/gnutls/gnutls_3.8.3.bb')
-rw-r--r-- | meta/recipes-support/gnutls/gnutls_3.8.3.bb | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/meta/recipes-support/gnutls/gnutls_3.8.3.bb b/meta/recipes-support/gnutls/gnutls_3.8.3.bb new file mode 100644 index 0000000000..27d6753be0 --- /dev/null +++ b/meta/recipes-support/gnutls/gnutls_3.8.3.bb | |||
@@ -0,0 +1,100 @@ | |||
1 | SUMMARY = "GNU Transport Layer Security Library" | ||
2 | DESCRIPTION = "a secure communications library implementing the SSL, \ | ||
3 | TLS and DTLS protocols and technologies around them." | ||
4 | HOMEPAGE = "https://gnutls.org/" | ||
5 | BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls" | ||
6 | |||
7 | LICENSE = "GPL-3.0-or-later & LGPL-2.1-or-later" | ||
8 | LICENSE:${PN} = "LGPL-2.1-or-later" | ||
9 | LICENSE:${PN}-xx = "LGPL-2.1-or-later" | ||
10 | LICENSE:${PN}-bin = "GPL-3.0-or-later" | ||
11 | LICENSE:${PN}-openssl = "GPL-3.0-or-later" | ||
12 | |||
13 | LIC_FILES_CHKSUM = "file://LICENSE;md5=71391c8e0c1cfe68077e7fce3b586283 \ | ||
14 | file://doc/COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ | ||
15 | file://doc/COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c" | ||
16 | |||
17 | DEPENDS = "nettle gmp virtual/libiconv libunistring" | ||
18 | |||
19 | SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" | ||
20 | |||
21 | SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \ | ||
22 | file://arm_eabi.patch \ | ||
23 | file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \ | ||
24 | file://run-ptest \ | ||
25 | file://Add-ptest-support.patch \ | ||
26 | " | ||
27 | |||
28 | SRC_URI[sha256sum] = "f74fc5954b27d4ec6dfbb11dea987888b5b124289a3703afcada0ee520f4173e" | ||
29 | |||
30 | inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest | ||
31 | |||
32 | PACKAGECONFIG ??= "libidn libtasn1 ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)}" | ||
33 | |||
34 | # You must also have CONFIG_SECCOMP enabled in the kernel for | ||
35 | # seccomp to work. | ||
36 | PACKAGECONFIG[seccomp] = "--with-libseccomp-prefix=${STAGING_EXECPREFIXDIR},ac_cv_libseccomp=no,libseccomp" | ||
37 | PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn2" | ||
38 | PACKAGECONFIG[libtasn1] = "--without-included-libtasn1,--with-included-libtasn1,libtasn1" | ||
39 | PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit" | ||
40 | PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers" | ||
41 | PACKAGECONFIG[fips] = "--enable-fips140-mode --with-libdl-prefix=${STAGING_BASELIBDIR}" | ||
42 | PACKAGECONFIG[dane] = "--enable-libdane,--disable-libdane,unbound" | ||
43 | # Certificate compression | ||
44 | PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli" | ||
45 | PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" | ||
46 | PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" | ||
47 | |||
48 | EXTRA_OECONF = " \ | ||
49 | --enable-doc \ | ||
50 | --disable-rpath \ | ||
51 | --enable-openssl-compatibility \ | ||
52 | --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \ | ||
53 | --with-librt-prefix=${STAGING_DIR_HOST}${prefix} \ | ||
54 | --with-default-trust-store-file=${sysconfdir}/ssl/certs/ca-certificates.crt \ | ||
55 | " | ||
56 | |||
57 | # Otherwise the tools try and use HOSTTOOLS_DIR/bash as a shell. | ||
58 | export POSIX_SHELL="${base_bindir}/sh" | ||
59 | |||
60 | do_configure:prepend() { | ||
61 | for dir in . lib; do | ||
62 | rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4 | ||
63 | done | ||
64 | } | ||
65 | |||
66 | do_compile_ptest() { | ||
67 | oe_runmake -C tests buildtest-TESTS | ||
68 | } | ||
69 | |||
70 | do_install:append:class-target() { | ||
71 | if ${@bb.utils.contains('PACKAGECONFIG', 'fips', 'true', 'false', d)}; then | ||
72 | install -d ${D}${bindir}/bin | ||
73 | install -m 0755 ${B}/lib/.libs/fipshmac ${D}/${bindir}/ | ||
74 | fi | ||
75 | } | ||
76 | |||
77 | PACKAGES =+ "${PN}-dane ${PN}-openssl ${PN}-xx ${PN}-fips" | ||
78 | |||
79 | FILES:${PN}-dev += "${bindir}/gnutls-cli-debug" | ||
80 | |||
81 | FILES:${PN}-dane = "${libdir}/libgnutls-dane.so.*" | ||
82 | FILES:${PN}-openssl = "${libdir}/libgnutls-openssl.so.*" | ||
83 | FILES:${PN}-xx = "${libdir}/libgnutlsxx.so.*" | ||
84 | FILES:${PN}-fips = "${bindir}/fipshmac" | ||
85 | |||
86 | RDEPENDS:${PN}-ptest += "python3" | ||
87 | |||
88 | BBCLASSEXTEND = "native nativesdk" | ||
89 | |||
90 | pkg_postinst_ontarget:${PN}-fips () { | ||
91 | if test -x ${bindir}/fipshmac | ||
92 | then | ||
93 | mkdir ${sysconfdir}/gnutls | ||
94 | touch ${sysconfdir}/gnutls/config | ||
95 | ${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmac | ||
96 | ${bindir}/fipshmac ${libdir}/libnettle.so.8.* > ${libdir}/.libnettle.so.8.hmac | ||
97 | ${bindir}/fipshmac ${libdir}/libgmp.so.10.*.* > ${libdir}/.libgmp.so.10.hmac | ||
98 | ${bindir}/fipshmac ${libdir}/libhogweed.so.6.* > ${libdir}/.libhogweed.so.6.hmac | ||
99 | fi | ||
100 | } | ||