1
0

Makefile 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. ifneq ($(findstring arm,$(ARCH)),)
  48. CONFIGURE_ARGS+= \
  49. $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
  50. endif
  51. ifneq ($(findstring mips,$(ARCH)),)
  52. CONFIGURE_ARGS+= \
  53. $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
  54. endif
  55. HOST_CONFIGURE_VARS:=
  56. HOST_CONFIGURE_ARGS:= \
  57. --dest-os=linux \
  58. --without-snapshot \
  59. --prefix=$(STAGING_DIR_HOSTPKG)
  60. HOST_CONFIGURE_CMD:=python ./configure
  61. define Build/InstallDev
  62. $(INSTALL_DIR) $(1)/usr/include
  63. $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  64. endef
  65. define Package/node/install
  66. mkdir -p $(1)/usr/bin $(1)/usr/lib/node_modules/npm/{bin,lib,node_modules}
  67. $(CP) $(PKG_INSTALL_DIR)/usr/bin/{node,npm} $(1)/usr/bin/
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/{package.json,LICENSE,cli.js} $(1)/usr/lib/node_modules/npm
  69. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/bin/npm-cli.js $(1)/usr/lib/node_modules/npm/bin
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/lib/* $(1)/usr/lib/node_modules/npm/lib/
  71. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/npm/node_modules/* $(1)/usr/lib/node_modules/npm/node_modules/
  72. endef
  73. $(eval $(call HostBuild))
  74. $(eval $(call BuildPackage,node))