logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://anongit.hacktivis.me/git/overlay.git/

bearssl-0.6_p20241009.ebuild (1567B)


  1. # Copyright 2024-2025 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit toolchain-funcs
  5. EGIT_COMMIT="3c040368f6791553610e362401db1efff4b4c5b8"
  6. DESCRIPTION="Implementation of the SSL/TLS protocol in C"
  7. HOMEPAGE="https://bearssl.org/"
  8. SRC_URI="https://bearssl.org/gitweb/?p=BearSSL;a=snapshot;h=${EGIT_COMMIT};sf=tgz -> BearSSL-${EGIT_COMMIT}.tar.gz"
  9. LICENSE="MIT"
  10. SLOT="0/${PV%%.*}"
  11. KEYWORDS="~amd64"
  12. S="${WORKDIR}/BearSSL-${EGIT_COMMIT:0:7}/"
  13. IUSE="static-libs"
  14. src_prepare() {
  15. default
  16. rm T0Comp.exe || die
  17. sed -i 's;^#define BR_MAX_RSA_SIZE.*;#define BR_MAX_RSA_SIZE 8192;' src/inner.h || die
  18. }
  19. src_compile() {
  20. emake \
  21. AR="$(tc-getAR)" \
  22. CC="$(tc-getCC)" CFLAGS="$CFLAGS" \
  23. LD="$(tc-getCC)" LDFLAGS="$LDFLAGS" \
  24. LDDLL="$(tc-getCC)" LDDLLFLAGS="$CFLAGS $LDFLAGS -shared -Wl,-soname,libbearssl.so.${PV%%.*}" \
  25. D=".so.$PV"
  26. }
  27. src_test() {
  28. cd "${S}/build" || die
  29. ./testx509 || die
  30. ./testcrypto all || die
  31. }
  32. src_install() {
  33. libdir="${ED}/usr/$(get_libdir)/"
  34. dobin build/brssl
  35. doheader -r inc/*
  36. mkdir -p "$libdir" || die
  37. cp -f build/libbearssl.so.$PV "$libdir/" || die
  38. ln -s libbearssl.so.$PV "$libdir/libbearssl.so.${PV%%.*}" || die
  39. ln -s libbearssl.so.$PV "$libdir/libbearssl.so" || die
  40. if use static-libs; then
  41. cp -f build/libbearssl.a "$libdir/" || die
  42. fi
  43. mkdir -p "$libdir/pkgconfig/" || die
  44. sed \
  45. -e "s;@PREFIX@;${EPREFIX}/usr;" \
  46. -e "s;@VERSION@;${PV%%_*};" \
  47. "${FILESDIR}/bearssl.pc.in" > "${libdir}/pkgconfig/bearssl.pc" || die
  48. }