luvit-0.8.2.ebuild 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs multilib
  5. # TODO: FHS https://github.com/luvit/luvit/issues/379
  6. DESCRIPTION="Takes node.js' architecture and dependencies and fits it in the Lua language"
  7. HOMEPAGE="http://luvit.io/"
  8. SRC_URI="http://luvit.io/dist/latest/${P}.tar.gz"
  9. KEYWORDS="~amd64 ~x86"
  10. SLOT="0"
  11. IUSE="bundled-libs examples libressl"
  12. # luvit Apache-2.0
  13. # luajit MIT
  14. # yajl BSD
  15. LICENSE="Apache-2.0 bundled-libs? ( BSD MIT )"
  16. # fails in portage environment
  17. # succeeds if run manually
  18. RESTRICT="test"
  19. RDEPEND="
  20. !libressl? ( dev-libs/openssl:0= )
  21. libressl? ( dev-libs/libressl:0= )
  22. sys-libs/zlib
  23. !bundled-libs? (
  24. dev-lang/luajit:2[lua52compat]
  25. >=dev-libs/yajl-2.0.2
  26. net-libs/http-parser
  27. )"
  28. DEPEND="${RDEPEND}
  29. virtual/pkgconfig"
  30. src_prepare() {
  31. rm -r deps/{openssl,zlib} || die
  32. epatch "${FILESDIR}"/${PN}-0.7.0-unbundle-http-parser.patch
  33. if use bundled-libs ; then
  34. sed -i \
  35. -e "s/-Werror//" \
  36. -e "s/-O3//" \
  37. deps/http-parser/Makefile || die "fixing flags failed!"
  38. else
  39. rm -r deps/{luajit,yajl,http-parser} || die
  40. # TODO: no version detection for http-parser yet
  41. MY_YAJL_VERSION=$($(tc-getPKG_CONFIG) --modversion yajl)
  42. MY_LUAJIT_VERSION=$($(tc-getPKG_CONFIG) --modversion luajit)
  43. sed -i \
  44. -e "s:^YAJL_VERSION=.*:YAJL_VERSION=${MY_YAJL_VERSION}:" \
  45. -e "s:^LUAJIT_VERSION=.*:LUAJIT_VERSION=${MY_LUAJIT_VERSION}:" \
  46. Makefile || die "setting yajl version failed"
  47. fi
  48. }
  49. src_configure() {
  50. # skip retarded gyp build system
  51. :
  52. }
  53. src_compile() {
  54. tc-export CC AR
  55. emake -C deps/cares
  56. myemakeargs=(
  57. DEBUG=0
  58. WERROR=0
  59. USE_SYSTEM_SSL=1
  60. # bundled luajit is compiled with special flags
  61. USE_SYSTEM_LUAJIT=$(usex bundled-libs "0" "1")
  62. USE_SYSTEM_YAJL=$(usex bundled-libs "0" "1")
  63. USE_SYSTEM_HTTPPARSER=$(usex bundled-libs "0" "1")
  64. USE_SYSTEM_ZLIB=1
  65. PREFIX=/usr
  66. LIBDIR="${D%/}"/usr/$(get_libdir)/${PN}
  67. DESTDIR="${D}"
  68. )
  69. emake "${myemakeargs[@]}" all
  70. }
  71. src_install() {
  72. emake "${myemakeargs[@]}" install
  73. dodoc TODO ChangeLog README.markdown errors.markdown
  74. if use examples ; then
  75. dodoc -r examples
  76. docompress -x /usr/share/doc/${PF}/examples
  77. fi
  78. }