You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.1 KiB

  1. #
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=node
  9. PKG_VERSION:=v0.12.7
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=node-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
  13. PKG_BUILD_DEPENDS:=python/host
  14. PKG_INSTALL:=1
  15. PKG_USE_MIPS16:=0
  16. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  17. PKG_LICENSE:=
  18. include $(INCLUDE_DIR)/host-build.mk
  19. include $(INCLUDE_DIR)/package.mk
  20. define Package/node
  21. SECTION:=lang
  22. CATEGORY:=Languages
  23. SUBMENU:=Node.js
  24. TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
  25. URL:=http://nodejs.org/
  26. DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +libuv
  27. endef
  28. define Package/node/description
  29. Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
  30. an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js'
  31. package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
  32. endef
  33. CONFIGURE_ARGS= \
  34. --dest-cpu=$(CONFIG_ARCH) \
  35. --dest-os=linux \
  36. --without-snapshot \
  37. --shared-zlib \
  38. --shared-openssl \
  39. --prefix=/usr
  40. HOST_CONFIGURE_VARS:=
  41. HOST_CONFIGURE_ARGS:= \
  42. --dest-os=linux \
  43. --without-snapshot \
  44. --prefix=$(STAGING_DIR_HOST)/
  45. HOST_CONFIGURE_CMD:=python ./configure
  46. define Build/InstallDev
  47. $(INSTALL_DIR) $(1)/usr/include
  48. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  49. endef
  50. define Package/node/install
  51. mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
  52. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
  53. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
  54. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
  55. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
  57. endef
  58. $(eval $(call HostBuild))
  59. $(eval $(call BuildPackage,node))