Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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" |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 11 | LICENSE:${PN}-openssl = "GPL-3.0-or-later" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 12 | |
| 13 | LIC_FILES_CHKSUM = "file://LICENSE;md5=71391c8e0c1cfe68077e7fce3b586283 \ |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 14 | file://doc/COPYING;md5=1ebbd3e34237af26da5dc08a4e440464 \ |
| 15 | file://doc/COPYING.LESSER;md5=4fbd65380cdd255951079008b364516c" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 16 | |
| 17 | DEPENDS = "nettle gmp virtual/libiconv libunistring" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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 \ |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 24 | file://run-ptest \ |
| 25 | file://Add-ptest-support.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 26 | " |
| 27 | |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 28 | SRC_URI[sha256sum] = "0ea0d11a1660a1e63f960f157b197abe6d0c8cb3255be24e1fb3815930b9bdc5" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 29 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 30 | inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 31 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 32 | PACKAGECONFIG ??= "libidn libtasn1 ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)}" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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" |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 38 | PACKAGECONFIG[libtasn1] = "--without-included-libtasn1,--with-included-libtasn1,libtasn1" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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}" |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 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" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 47 | |
| 48 | EXTRA_OECONF = " \ |
| 49 | --enable-doc \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 66 | do_compile_ptest() { |
| 67 | oe_runmake -C tests buildtest-TESTS |
| 68 | } |
| 69 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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 | |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 77 | PACKAGES =+ "${PN}-dane ${PN}-openssl ${PN}-xx ${PN}-fips" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 78 | |
| 79 | FILES:${PN}-dev += "${bindir}/gnutls-cli-debug" |
Patrick Williams | e760df8 | 2023-05-26 11:10:49 -0500 | [diff] [blame] | 80 | |
| 81 | FILES:${PN}-dane = "${libdir}/libgnutls-dane.so.*" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 82 | FILES:${PN}-openssl = "${libdir}/libgnutls-openssl.so.*" |
| 83 | FILES:${PN}-xx = "${libdir}/libgnutlsxx.so.*" |
| 84 | FILES:${PN}-fips = "${bindir}/fipshmac" |
| 85 | |
Andrew Geissler | fc113ea | 2023-03-31 09:59:46 -0500 | [diff] [blame] | 86 | RDEPENDS:${PN}-ptest += "python3" |
| 87 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 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 | } |