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.

113 lines
3.0 KiB

  1. #
  2. # Copyright (C) 2006-2016 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:=v4.4.5
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=http://nodejs.org/dist/${PKG_VERSION}
  13. PKG_MD5SUM:=376140907bbe362f36065a30af04f020
  14. HOST_BUILD_DEPENDS:=python/host
  15. PKG_BUILD_DEPENDS:=python/host
  16. PKG_INSTALL:=1
  17. PKG_USE_MIPS16:=0
  18. HOST_BUILD_PARALLEL:=1
  19. PKG_BUILD_PARALLEL:=1
  20. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  21. PKG_LICENSE:=
  22. include $(INCLUDE_DIR)/host-build.mk
  23. include $(INCLUDE_DIR)/package.mk
  24. define Package/node
  25. SECTION:=lang
  26. CATEGORY:=Languages
  27. SUBMENU:=Node.js
  28. TITLE:=Node.js is a platform built on Chrome's JavaScript runtime
  29. URL:=http://nodejs.org/
  30. DEPENDS:=+libpthread +librt +libstdcpp +libopenssl +zlib
  31. endef
  32. define Package/node/description
  33. Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses
  34. an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js'
  35. package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
  36. endef
  37. define Package/node-npm
  38. SECTION:=lang
  39. CATEGORY:=Languages
  40. SUBMENU:=Node.js
  41. TITLE:=NPM stands for Node Package Manager
  42. URL:=http://npmjs.com/
  43. DEPENDS:=+node
  44. endef
  45. define Package/node-npm/description
  46. NPM is the package manager for NodeJS
  47. endef
  48. CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))
  49. MAKE_VARS += \
  50. DESTCPU=$(CPU)
  51. CONFIGURE_ARGS= \
  52. --dest-cpu=$(CPU) \
  53. --dest-os=linux \
  54. --without-snapshot \
  55. --shared-zlib \
  56. --shared-openssl \
  57. --prefix=/usr
  58. ifneq ($(findstring arm,$(ARCH)),)
  59. CONFIGURE_ARGS+= \
  60. $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
  61. endif
  62. ifneq ($(findstring mips,$(ARCH)),)
  63. CONFIGURE_ARGS+= \
  64. $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
  65. endif
  66. HOST_CONFIGURE_VARS:=
  67. HOST_CONFIGURE_ARGS:= \
  68. --dest-os=linux \
  69. --without-snapshot \
  70. --prefix=$(STAGING_DIR_HOSTPKG)
  71. HOST_CONFIGURE_CMD:=python ./configure
  72. define Build/InstallDev
  73. $(INSTALL_DIR) $(1)/usr/include
  74. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  75. endef
  76. define Package/node/install
  77. mkdir -p $(1)/usr/bin
  78. $(CP) $(PKG_INSTALL_DIR)/usr/bin/node $(1)/usr/bin/
  79. endef
  80. define Package/node-npm/install
  81. mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
  82. $(CP) $(PKG_INSTALL_DIR)/usr/bin/npm $(1)/usr/bin/
  83. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
  84. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
  85. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
  87. endef
  88. $(eval $(call HostBuild))
  89. $(eval $(call BuildPackage,node))
  90. $(eval $(call BuildPackage,node-npm))