Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # $OpenBSD: Makefile,v 1.58 2017/05/31 08:08:16 espie Exp $
  2. # XXX:
  3. # - Needs __ARM_NR_cacheflush (or the like) to work on arm-based ports.
  4. # - Needs bundled libcares as arpa/nameser.h does not include ns_t_a.
  5. ONLY_FOR_ARCHS = amd64 i386
  6. USE_WXNEEDED = Yes
  7. COMMENT = V8 JavaScript for clients and servers
  8. NODE_VERSION = v6.10.1
  9. PLEDGE_VER = 1.1.0
  10. DISTFILES = node-pledge-{}${PLEDGE_VER}.tar.gz:0 ${DISTNAME}.tar.gz
  11. DISTNAME = node-${NODE_VERSION}
  12. PKGNAME = ${DISTNAME:S/v//g}
  13. REVISION = 0
  14. MASTER_SITES0 = https://github.com/qbit/node-pledge/archive/
  15. CATEGORIES = lang devel
  16. HOMEPAGE = http://nodejs.org/
  17. MAINTAINER = Aaron Bieber <abieber@openbsd.org>
  18. # MIT
  19. PERMIT_PACKAGE_CDROM = Yes
  20. MASTER_SITES = ${HOMEPAGE}dist/${NODE_VERSION}/
  21. MODULES = lang/python
  22. COMPILER = gcc
  23. WANTLIB += c execinfo kvm m pthread util z ${LIBECXX}
  24. LIB_DEPENDS = devel/libexecinfo
  25. USE_GMAKE = Yes
  26. BUILD_DEPENDS = sysutils/flock
  27. RUN_DEPENDS = devel/gmake \
  28. ${MODGCC4_CPPDEP} \
  29. sysutils/flock
  30. TEST_TARGET = test
  31. CONFIGURE_STYLE = simple
  32. # libpath and includes aren't picked up, but I added them here as a note.
  33. # The patch for node.gyp is where they are actually being set.
  34. CONFIGURE_ARGS = --prefix=${PREFIX} \
  35. --shared-zlib
  36. SUBST_VARS += DISTNAME
  37. SUBST_VARS += DISTFILES
  38. SUBST_VARS += EXTRACT_SUFX
  39. SUBST_VARS += LOCALBASE
  40. SUBST_VARS += PREFIX
  41. SUBST_VARS += WRKDIST
  42. MAKE_ENV += V=1 CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
  43. LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib"
  44. do-extract:
  45. mkdir ${WRKSRC}; \
  46. tar -C ${WRKDIR} -zxf ${FULLDISTDIR}/${DISTNAME}.tar.gz && \
  47. tar -C ${WRKSRC}/deps/npm/node_modules/ -zxf \
  48. ${FULLDISTDIR}/node-pledge-${PLEDGE_VER}.tar.gz && \
  49. mv ${WRKSRC}/deps/npm/node_modules/node-pledge-${PLEDGE_VER} \
  50. ${WRKSRC}/deps/npm/node_modules/node-pledge
  51. pre-configure:
  52. @# Bad practice, but prevents a whole stack of patches.
  53. ln -sf ${LOCALBASE}/bin/python${MODPY_VERSION} ${WRKDIR}/bin/python
  54. ${SUBST_CMD} ${WRKDIST}/lib/module.js \
  55. ${WRKDIST}/deps/npm/bin/node-gyp-bin/node-gyp \
  56. ${WRKDIST}/deps/npm/node_modules/node-gyp/lib/configure.js \
  57. ${WRKDIST}/deps/npm/node_modules/node-gyp/lib/install.js \
  58. ${WRKDIST}/node.gyp \
  59. ${WRKDIST}/common.gypi \
  60. ${WRKDIST}/tools/test.py
  61. post-install:
  62. ${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py \
  63. ${PREFIX}/lib/node_modules/npm/node_modules/node-gyp/gyp
  64. ${INSTALL_DATA_DIR} ${PREFIX}/share/node
  65. ${INSTALL_DATA} ${FULLDISTDIR}/${DISTNAME}.tar.gz \
  66. ${PREFIX}/share/node/${DISTNAME}.tar.gz
  67. ln -s ${TRUEPREFIX}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp \
  68. ${PREFIX}/bin/node-gyp;
  69. cd ${PREFIX}/lib/node_modules/npm/node_modules && for x in *; do \
  70. mv $$x ../..; \
  71. ln -s ../../$$x $$x; \
  72. done
  73. .include <bsd.port.mk>