blob: 835ab122d84699f492d5b61b63deb9154f858bac [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 \
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060014 file://doc/COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \
15 file://doc/COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c"
Patrick Williams92b42cb2022-09-03 06:53:57 -050016
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
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060029SRC_URI[sha256sum] = "0ea0d11a1660a1e63f960f157b197abe6d0c8cb3255be24e1fb3815930b9bdc5"
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 \
Patrick Williams92b42cb2022-09-03 06:53:57 -050047 --disable-rpath \
48 --enable-openssl-compatibility \
49 --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \
50 --with-librt-prefix=${STAGING_DIR_HOST}${prefix} \
51 --with-default-trust-store-file=${sysconfdir}/ssl/certs/ca-certificates.crt \
52"
53
54# Otherwise the tools try and use HOSTTOOLS_DIR/bash as a shell.
55export POSIX_SHELL="${base_bindir}/sh"
56
57LDFLAGS:append:libc-musl = " -largp"
58
59do_configure:prepend() {
60 for dir in . lib; do
61 rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4
62 done
63}
64
65do_install:append:class-target() {
66 if ${@bb.utils.contains('PACKAGECONFIG', 'fips', 'true', 'false', d)}; then
67 install -d ${D}${bindir}/bin
68 install -m 0755 ${B}/lib/.libs/fipshmac ${D}/${bindir}/
69 fi
70}
71
Patrick Williams864cc432023-02-09 14:54:44 -060072do_compile:append() {
73 oe_runmake ${PARALLEL_MAKE} -C tests buildtest-TESTS
74}
75
Patrick Williams92b42cb2022-09-03 06:53:57 -050076PACKAGES =+ "${PN}-openssl ${PN}-xx ${PN}-fips"
77
78FILES:${PN}-dev += "${bindir}/gnutls-cli-debug"
79FILES:${PN}-openssl = "${libdir}/libgnutls-openssl.so.*"
80FILES:${PN}-xx = "${libdir}/libgnutlsxx.so.*"
81FILES:${PN}-fips = "${bindir}/fipshmac"
82
83BBCLASSEXTEND = "native nativesdk"
84
85pkg_postinst_ontarget:${PN}-fips () {
86 if test -x ${bindir}/fipshmac
87 then
88 mkdir ${sysconfdir}/gnutls
89 touch ${sysconfdir}/gnutls/config
90 ${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmac
91 ${bindir}/fipshmac ${libdir}/libnettle.so.8.* > ${libdir}/.libnettle.so.8.hmac
92 ${bindir}/fipshmac ${libdir}/libgmp.so.10.*.* > ${libdir}/.libgmp.so.10.hmac
93 ${bindir}/fipshmac ${libdir}/libhogweed.so.6.* > ${libdir}/.libhogweed.so.6.hmac
94 fi
95}