nacl-0_p20110221.ebuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # Copyright 1999-2013 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit flag-o-matic toolchain-funcs multilib-minimal
  5. DESCRIPTION="high-speed software library for network communication, encryption, decryption, signatures"
  6. HOMEPAGE="http://nacl.cr.yp.to/"
  7. SRC_URI="http://hyperelliptic.org/nacl/${P/0_p}.tar.bz2"
  8. LICENSE="public-domain"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="test"
  12. DEPEND=""
  13. RDEPEND="${DEPEND}"
  14. S=${WORKDIR}/${P/0_p}
  15. MULTILIB_WRAPPED_HEADERS=(
  16. /usr/include/nacl/cpucycles.h
  17. /usr/include/nacl/crypto_core_hsalsa20.h
  18. /usr/include/nacl/crypto_hashblocks_sha256.h
  19. /usr/include/nacl/crypto_hashblocks_sha512.h
  20. /usr/include/nacl/crypto_onetimeauth_poly1305.h
  21. /usr/include/nacl/crypto_scalarmult_curve25519.h
  22. /usr/include/nacl/crypto_stream_aes128ctr.h
  23. /usr/include/nacl/crypto_stream_salsa20.h
  24. /usr/include/nacl/crypto_stream_salsa2012.h
  25. /usr/include/nacl/crypto_stream_salsa208.h )
  26. src_prepare() {
  27. #drop useless path elements, verbose output, predictable include dir
  28. sed -e '/^export/d' \
  29. -e '/^PATH/d' \
  30. -e '/^LD_LIBRARY_PATH/d' \
  31. -e '/^DYLD_LIBRARY_PATH/d' \
  32. -e '/^exec >/d' \
  33. -e '/^shorthostname/s:=.*:=gentoo:' \
  34. -i do || die
  35. sed -e 's:=== `date` === ::' \
  36. -i $(find . -name do) || die
  37. rm -r tests
  38. multilib_copy_sources
  39. filter-flags "-O*"
  40. append-cflags -O3 -fomit-frame-pointer -funroll-loops
  41. append-cxxflags -O3 -fomit-frame-pointer -funroll-loops
  42. }
  43. multilib_src_configure() {
  44. echo "$(tc-getCC) ${CFLAGS}" > okcompilers/c
  45. echo "$(tc-getCXX) ${CXXFLAGS}" > okcompilers/cpp
  46. echo "$(tc-getAR)" > okcompilers/archivers
  47. sed -e "1aexport PATH=\"${BUILD_DIR}/build/gentoo/bin:${PATH}\"" \
  48. -i do || die
  49. }
  50. multilib_src_compile() {
  51. ./do || die
  52. }
  53. multilib_src_install() {
  54. insinto /usr/$(get_libdir)/${PN}
  55. doins build/gentoo/lib/*/*
  56. insinto /usr/include/${PN}
  57. doins build/gentoo/include/*/*
  58. }