logo

overlay

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

bearssl-0.6.ebuild (1239B)


  1. # Copyright 2024 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. DESCRIPTION="Implementation of the SSL/TLS protocol in C"
  6. HOMEPAGE="https://bearssl.org/"
  7. SRC_URI="https://bearssl.org/${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64"
  11. IUSE="static-libs"
  12. src_compile() {
  13. emake \
  14. AR="$(tc-getAR)" \
  15. CC="$(tc-getCC)" CFLAGS="$CFLAGS" \
  16. LD="$(tc-getCC)" LDFLAGS="$CFLAGS" \
  17. LDDLL="$(tc-getCC)" LDDLLFLAGS="$CFLAGS $LDFLAGS -shared -Wl,-soname,libbearssl.so.${PV%%.*}" \
  18. D=".so.$PV"
  19. }
  20. src_test() {
  21. cd "${S}/build" || die
  22. ./testx509 || die
  23. ./testcrypto all || die
  24. }
  25. src_install() {
  26. libdir="${ED}/usr/$(get_libdir)/"
  27. dobin build/brssl
  28. doheader -r inc/*
  29. mkdir -p "$libdir" || die
  30. cp -f build/libbearssl.so.$PV "$libdir/" || die
  31. ln -s libbearssl.so.$PV "$libdir/libbearssl.so.${PV%%.*}" || die
  32. ln -s libbearssl.so.$PV "$libdir/libbearssl.so" || die
  33. if use static-libs; then
  34. cp -f build/libbearssl.a "$libdir/" || die
  35. fi
  36. mkdir -p "$libdir/pkgconfig/" || die
  37. sed \
  38. -e "s;@PREFIX@;${EPREFIX}/usr;" \
  39. -e "s;@VERSION@;${PV};" \
  40. "${FILESDIR}/libbearssl.pc.in" > "${libdir}/pkgconfig/libbearssl.pc" || die
  41. }