libmpack-1.0.5-r5.ebuild 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit autotools toolchain-funcs
  5. DESCRIPTION="Simple implementation of msgpack in C"
  6. HOMEPAGE="https://github.com/libmpack/libmpack"
  7. SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos"
  11. BDEPEND="
  12. dev-build/slibtool
  13. virtual/pkgconfig
  14. "
  15. PATCHES=(
  16. "${FILESDIR}"/${P}-libtool.patch # 778899
  17. )
  18. src_prepare() {
  19. default
  20. # Respect users CFLAGS
  21. sed -e 's/-ggdb//g' -i Makefile.in || die
  22. sed -e 's/-O[0-9]//g' -i .config/release.mk || die
  23. eautoreconf
  24. }
  25. _emake() {
  26. local myemakeargs=(
  27. "VERBOSE=1"
  28. "PREFIX=${EPREFIX}/usr"
  29. "HOST_CC=$(tc-getBUILD_CC)"
  30. "HOST_CFLAGS=${BUILD_CPPFLAGS} ${BUILD_CFLAGS}"
  31. "HOST_LDFLAGS=${BUILD_LDFLAGS}"
  32. "CC=$(tc-getCC)"
  33. "LD=$(tc-getLD)"
  34. "config=release"
  35. "LIBDIR=${EPREFIX}/usr/$(get_libdir)"
  36. "INCDIR=${EPREFIX}/usr/include"
  37. )
  38. emake "${myemakeargs[@]}" "${@}"
  39. }
  40. src_compile() {
  41. _emake lib-bin
  42. }
  43. src_test() {
  44. _emake XLDFLAGS="-shared" test
  45. }
  46. src_install() {
  47. _emake "DESTDIR=${D}" "XLDFLAGS=-shared" install
  48. if [[ ${CHOST} == *-darwin* ]] ; then
  49. local file="libmpack.0.0.0.dylib"
  50. install_name_tool \
  51. -id "${EPREFIX}/usr/$(get_libdir)/${file}" \
  52. "${ED}/usr/$(get_libdir)/${file}" \
  53. || die "Failed to adjust install_name"
  54. fi
  55. find "${ED}" -name '*.la' -delete || die
  56. }