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.

79 lines
2.2 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:=2
  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. CPU:=$(subst x86_64,x64,$(subst i386,ia32,$(ARCH)))
  35. MAKE_VARS += \
  36. DESTCPU=$(CPU)
  37. CONFIGURE_ARGS= \
  38. --dest-cpu=$(CPU) \
  39. --dest-os=linux \
  40. --without-snapshot \
  41. --shared-zlib \
  42. --shared-openssl \
  43. --prefix=/usr
  44. HOST_CONFIGURE_VARS:=
  45. HOST_CONFIGURE_ARGS:= \
  46. --dest-os=linux \
  47. --without-snapshot \
  48. --prefix=$(STAGING_DIR)/host/
  49. HOST_CONFIGURE_CMD:=python ./configure
  50. define Build/InstallDev
  51. $(INSTALL_DIR) $(1)/usr/include
  52. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  53. endef
  54. define Package/node/install
  55. mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
  56. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
  57. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
  58. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
  59. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
  60. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
  61. endef
  62. $(eval $(call HostBuild))
  63. $(eval $(call BuildPackage,node))