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.

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