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.

74 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. HOST_BUILD_DEPENDS:=python/host
  14. PKG_BUILD_DEPENDS:=python/host
  15. PKG_INSTALL:=1
  16. PKG_USE_MIPS16:=0
  17. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  18. PKG_LICENSE:=
  19. include $(INCLUDE_DIR)/host-build.mk
  20. include $(INCLUDE_DIR)/package.mk
  21. define Package/node
  22. SECTION:=lang
  23. CATEGORY:=Languages
  24. SUBMENU:=Node.js
  25. TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
  26. URL:=http://nodejs.org/
  27. DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +libuv
  28. endef
  29. define Package/node/description
  30. Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
  31. an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js'
  32. package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
  33. endef
  34. CONFIGURE_ARGS= \
  35. --dest-cpu=$(CONFIG_ARCH) \
  36. --dest-os=linux \
  37. --without-snapshot \
  38. --shared-zlib \
  39. --shared-openssl \
  40. --prefix=/usr
  41. HOST_CONFIGURE_VARS:=
  42. HOST_CONFIGURE_ARGS:= \
  43. --dest-os=linux \
  44. --without-snapshot \
  45. --prefix=$(STAGING_DIR_HOST)/
  46. HOST_CONFIGURE_CMD:=python ./configure
  47. define Build/InstallDev
  48. $(INSTALL_DIR) $(1)/usr/include
  49. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  50. endef
  51. define Package/node/install
  52. mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
  53. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
  54. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
  55. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
  56. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
  57. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
  58. endef
  59. $(eval $(call HostBuild))
  60. $(eval $(call BuildPackage,node))