logo

overlay

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

elfutils-0.186_pre9999.ebuild (2195B)


  1. # Copyright 2003-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit flag-o-matic multilib-minimal autotools git-r3
  5. DESCRIPTION="Libraries/utilities to handle ELF objects (drop in replacement for libelf)"
  6. HOMEPAGE="http://elfutils.org/"
  7. EGIT_REPO_URI="git://sourceware.org/git/elfutils.git"
  8. LICENSE="|| ( GPL-2+ LGPL-3+ ) utils? ( GPL-3+ )"
  9. SLOT="0"
  10. IUSE="bzip2 lzma nls static-libs test +threads +utils valgrind zstd"
  11. RDEPEND=">=sys-libs/zlib-1.2.8-r1[static-libs?,${MULTILIB_USEDEP}]
  12. bzip2? ( >=app-arch/bzip2-1.0.6-r4[static-libs?,${MULTILIB_USEDEP}] )
  13. lzma? ( >=app-arch/xz-utils-5.0.5-r1[static-libs?,${MULTILIB_USEDEP}] )
  14. zstd? ( app-arch/zstd:=[static-libs?,${MULTILIB_USEDEP}] )
  15. !dev-libs/libelf
  16. "
  17. DEPEND="${RDEPEND}
  18. valgrind? ( dev-util/valgrind )
  19. "
  20. BDEPEND="nls? ( sys-devel/gettext )
  21. >=sys-devel/flex-2.5.4a
  22. sys-devel/m4
  23. "
  24. RESTRICT="!test? ( test )"
  25. PATCHES=(
  26. "${FILESDIR}"/${PN}-0.186-gnu99-cleanup.patch
  27. )
  28. src_prepare() {
  29. default
  30. eautoreconf
  31. if ! use static-libs; then
  32. sed -i -e '/^lib_LIBRARIES/s:=.*:=:' -e '/^%.os/s:%.o$::' lib{asm,dw,elf}/Makefile.in || die
  33. fi
  34. # https://sourceware.org/PR23914
  35. sed -i 's:-Werror::' */Makefile.in || die
  36. }
  37. src_configure() {
  38. use test && append-flags -g #407135
  39. # Symbol aliases are implemented as asm statements.
  40. # Will require porting: https://gcc.gnu.org/PR48200
  41. filter-flags '-flto*'
  42. multilib-minimal_src_configure
  43. }
  44. multilib_src_configure() {
  45. ECONF_SOURCE="${S}" econf \
  46. $(use_enable nls) \
  47. $(use_enable threads thread-safety) \
  48. $(use_enable valgrind) \
  49. --disable-debuginfod \
  50. --disable-libdebuginfod \
  51. --program-prefix="eu-" \
  52. --with-zlib \
  53. --enable-maintainer-mode \
  54. $(use_with bzip2 bzlib) \
  55. $(use_with lzma) \
  56. $(use_with zstd)
  57. }
  58. multilib_src_test() {
  59. env LD_LIBRARY_PATH="${BUILD_DIR}/libelf:${BUILD_DIR}/libebl:${BUILD_DIR}/libdw:${BUILD_DIR}/libasm" \
  60. LC_ALL="C" \
  61. emake check VERBOSE=1
  62. }
  63. multilib_src_install_all() {
  64. einstalldocs
  65. dodoc NOTES
  66. # These build quick, and are needed for most tests, so don't
  67. # disable their building when the USE flag is disabled.
  68. if ! use utils; then
  69. rm -rf "${ED}"/usr/bin || die
  70. fi
  71. }