http-parser-2.6.2.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs multilib multilib-minimal
  5. DESCRIPTION="Http request/response parser for C"
  6. HOMEPAGE="https://github.com/nodejs/http-parser"
  7. SRC_URI="https://github.com/nodejs/http-parser/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0/${PV}"
  10. KEYWORDS="amd64 arm ~arm64 ppc ppc64 x86 ~amd64-linux ~x64-macos ~x64-solaris"
  11. IUSE="static-libs"
  12. # https://github.com/nodejs/http-parser/pull/272
  13. PATCHES=(
  14. "${FILESDIR}"/0001-makefile-fix-DESTDIR-usage.patch
  15. "${FILESDIR}"/0002-makefile-quote-variables.patch
  16. "${FILESDIR}"/0003-makefile-fix-SONAME-symlink-it-should-not-be-a-full-.patch
  17. "${FILESDIR}"/0004-makefile-add-CFLAGS-to-linking-command.patch
  18. "${FILESDIR}"/0005-makefile-fix-install-rule-dependency.patch
  19. "${FILESDIR}"/${PN}-2.6.2-darwin.patch
  20. )
  21. src_prepare() {
  22. tc-export CC AR
  23. epatch "${PATCHES[@]}"
  24. multilib_copy_sources
  25. }
  26. multilib_src_compile() {
  27. emake PREFIX="${EPREFIX}/usr" LIBDIR="${EPREFIX}/usr/$(get_libdir)" CFLAGS_FAST="${CFLAGS}" library
  28. use static-libs && emake CFLAGS_FAST="${CFLAGS}" package
  29. }
  30. multilib_src_test() {
  31. emake CFLAGS_DEBUG="${CFLAGS}" test
  32. }
  33. multilib_src_install() {
  34. emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" LIBDIR="${EPREFIX}/usr/$(get_libdir)" install
  35. use static-libs && dolib.a libhttp_parser.a
  36. }