libtermkey-0.22.ebuild 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Copyright 1999-2022 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit flag-o-matic toolchain-funcs
  5. DESCRIPTION="Library for easy processing of keyboard entry from terminal-based programs"
  6. HOMEPAGE="http://www.leonerd.org.uk/code/libtermkey/"
  7. SRC_URI="http://www.leonerd.org.uk/code/${PN}/${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="amd64 arm arm64 ~riscv x86 ~x64-macos"
  11. IUSE="demos man pgo static-libs"
  12. RDEPEND="dev-libs/unibilium:="
  13. BDEPEND="
  14. sys-devel/slibtool
  15. virtual/pkgconfig
  16. "
  17. DEPEND="
  18. demos? ( dev-libs/glib:2 )
  19. "
  20. src_prepare() {
  21. default
  22. sed -e 's/LIBTOOL ?= libtool/LIBTOOL ?= rlibtool/' \
  23. -e 's|PREFIX=/usr/local|PREFIX=/usr|' \
  24. -e "s|-rpath \$\(LIBDIR\)|-rpath ${EROOT}/usr/$(get_libdir)|" \
  25. -i Makefile || die
  26. if ! use demos; then
  27. sed -e '/^all:/s:$(DEMOS)::' -i Makefile || die
  28. fi
  29. }
  30. _emake() {
  31. local myemakeargs=(
  32. "VERBOSE=1"
  33. "PROFILE=$(usex pgo 1 0)"
  34. "CC=$(tc-getCC)"
  35. "LIBDIR=/usr/$(get_libdir)"
  36. "INCDIR=/usr/include"
  37. )
  38. tc-export_build_env
  39. emake "${myemakeargs[@]}" "$@"
  40. }
  41. src_compile() {
  42. _emake all
  43. }
  44. src_install() {
  45. _emake DESTDIR="${D}" install-lib install-inc
  46. use man && _emake DESTDIR="${D}" install-man
  47. use static-libs || rm "${ED}"/usr/$(get_libdir)/${PN}.a || die
  48. }