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 \ |
| 14 | file://doc/COPYING;md5=c678957b0c8e964aa6c70fd77641a71e \ |
| 15 | file://doc/COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343" |
| 16 | |
| 17 | DEPENDS = "nettle gmp virtual/libiconv libunistring" |
| 18 | DEPENDS:append:libc-musl = " argp-standalone" |
| 19 | |
| 20 | SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" |
| 21 | |
| 22 | SRC_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 Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 25 | file://run-ptest \ |
| 26 | file://Add-ptest-support.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 27 | " |
| 28 | |
Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame] | 29 | SRC_URI[sha256sum] = "c58ad39af0670efe6a8aee5e3a8b2331a1200418b64b7c51977fb396d4617114" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 30 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 31 | inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 32 | |
| 33 | PACKAGECONFIG ??= "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. |
| 37 | PACKAGECONFIG[seccomp] = "--with-libseccomp-prefix=${STAGING_EXECPREFIXDIR},ac_cv_libseccomp=no,libseccomp" |
| 38 | PACKAGECONFIG[libidn] = "--with-idn,--without-idn,libidn2" |
| 39 | PACKAGECONFIG[libtasn1] = "--with-included-libtasn1=no,--with-included-libtasn1,libtasn1" |
| 40 | PACKAGECONFIG[p11-kit] = "--with-p11-kit,--without-p11-kit,p11-kit" |
| 41 | PACKAGECONFIG[tpm] = "--with-tpm,--without-tpm,trousers" |
| 42 | PACKAGECONFIG[fips] = "--enable-fips140-mode --with-libdl-prefix=${STAGING_BASELIBDIR}" |
| 43 | |
| 44 | EXTRA_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. |
| 56 | export POSIX_SHELL="${base_bindir}/sh" |
| 57 | |
| 58 | LDFLAGS:append:libc-musl = " -largp" |
| 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_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 Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame] | 73 | do_compile:append() { |
| 74 | oe_runmake ${PARALLEL_MAKE} -C tests buildtest-TESTS |
| 75 | } |
| 76 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 77 | PACKAGES =+ "${PN}-openssl ${PN}-xx ${PN}-fips" |
| 78 | |
| 79 | FILES:${PN}-dev += "${bindir}/gnutls-cli-debug" |
| 80 | FILES:${PN}-openssl = "${libdir}/libgnutls-openssl.so.*" |
| 81 | FILES:${PN}-xx = "${libdir}/libgnutlsxx.so.*" |
| 82 | FILES:${PN}-fips = "${bindir}/fipshmac" |
| 83 | |
| 84 | BBCLASSEXTEND = "native nativesdk" |
| 85 | |
| 86 | pkg_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 | } |