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.

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