blob: fee06393bd6f0f93e56c1e0de20b29417e8a9fd9 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "GNU Transport Layer Security Library"
2DESCRIPTION = "a secure communications library implementing the SSL, \
3TLS and DTLS protocols and technologies around them."
4HOMEPAGE = "https://gnutls.org/"
5BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
6
7LICENSE = "GPL-3.0-or-later & LGPL-2.1-or-later"
8LICENSE:${PN} = "LGPL-2.1-or-later"
9LICENSE:${PN}-xx = "LGPL-2.1-or-later"
10LICENSE:${PN}-bin = "GPL-3.0-or-later"
Patrick Williams2390b1b2022-11-03 13:47:49 -050011LICENSE:${PN}-openssl = "GPL-3.0-or-later"
Patrick Williams92b42cb2022-09-03 06:53:57 -050012
13LIC_FILES_CHKSUM = "file://LICENSE;md5=71391c8e0c1cfe68077e7fce3b586283 \
14 file://doc/COPYING;md5=c678957b0c8e964aa6c70fd77641a71e \
15 file://doc/COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343"
16
17DEPENDS = "nettle gmp virtual/libiconv libunistring"
18DEPENDS:append:libc-musl = " argp-standalone"
19
20SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
21
22SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \
23 file://arm_eabi.patch \
24 file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \
Patrick Williams864cc432023-02-09 14:54:44 -060025 file://run-ptest \
26 file://Add-ptest-support.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050027 "
28
Patrick Williams2390b1b2022-11-03 13:47:49 -050029SRC_URI[sha256sum] = "c58ad39af0670efe6a8aee5e3a8b2331a1200418b64b7c51977fb396d4617114"
Patrick Williams92b42cb2022-09-03 06:53:57 -050030
Patrick Williams864cc432023-02-09 14:54:44 -060031inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest
Patrick Williams92b42cb2022-09-03 06:53:57 -050032
33PACKAGECONFIG ??= "libidn ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)}"
34
35# You must also have CONFIG_SECCOMP enabled in the kernel for
36# seccomp to work.
37PACKAGECONFIG[seccomp] = "--with-libseccomp-prefix=${STAGING_EXECPREFIXDIR},ac_cv_libseccomp=no,libseccomp"
38PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn2"
39PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1"
40PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit"
41PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers"
42PACKAGECONFIG[fips] = "--enable-fips140-mode --with-libdl-prefix=${STAGING_BASELIBDIR}"
43
44EXTRA_OECONF = " \
45 --enable-doc \
46 --disable-libdane \
47 --disable-guile \
48 --disable-rpath \
49 --enable-openssl-compatibility \
50 --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \
51 --with-librt-prefix=${STAGING_DIR_HOST}${prefix} \
52 --with-default-trust-store-file=${sysconfdir}/ssl/certs/ca-certificates.crt \
53"
54
55# Otherwise the tools try and use HOSTTOOLS_DIR/bash as a shell.
56export POSIX_SHELL="${base_bindir}/sh"
57
58LDFLAGS:append:libc-musl = " -largp"
59
60do_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
66do_install:append:class-target() {
67 if ${@bb.utils.contains('PACKAGECONFIG', 'fips', 'true', 'false', d)}; then
68 install -d ${D}${bindir}/bin
69 install -m 0755 ${B}/lib/.libs/fipshmac ${D}/${bindir}/
70 fi
71}
72
Patrick Williams864cc432023-02-09 14:54:44 -060073do_compile:append() {
74 oe_runmake ${PARALLEL_MAKE} -C tests buildtest-TESTS
75}
76
Patrick Williams92b42cb2022-09-03 06:53:57 -050077PACKAGES =+ "${PN}-openssl ${PN}-xx ${PN}-fips"
78
79FILES:${PN}-dev += "${bindir}/gnutls-cli-debug"
80FILES:${PN}-openssl = "${libdir}/libgnutls-openssl.so.*"
81FILES:${PN}-xx = "${libdir}/libgnutlsxx.so.*"
82FILES:${PN}-fips = "${bindir}/fipshmac"
83
84BBCLASSEXTEND = "native nativesdk"
85
86pkg_postinst_ontarget:${PN}-fips () {
87 if test -x ${bindir}/fipshmac
88 then
89 mkdir ${sysconfdir}/gnutls
90 touch ${sysconfdir}/gnutls/config
91 ${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmac
92 ${bindir}/fipshmac ${libdir}/libnettle.so.8.* > ${libdir}/.libnettle.so.8.hmac
93 ${bindir}/fipshmac ${libdir}/libgmp.so.10.*.* > ${libdir}/.libgmp.so.10.hmac
94 ${bindir}/fipshmac ${libdir}/libhogweed.so.6.* > ${libdir}/.libhogweed.so.6.hmac
95 fi
96}