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.

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