Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The resulting sysupgrade image is

In general we suggest to prepare a build-server with the following command:
```
sudo apt-get install make gcc g++ subversion unzip libncurses5-dev libncursesw5-dev ncurses-doc zlib1g-dev libssl-dev gettext --yes
sudo apt-get install make gcc g++ subversion unzip libncurses5-dev libncursesw5-dev ncurses-doc zlib1g-dev libssl-dev gettext gawk --yes
```

### Related OpenWrt documentation
Expand Down
1 change: 1 addition & 0 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ PACKAGES += mjpg-streamer
PACKAGES += madplay

# JavaScript
PACKAGES += libicu
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot this one, can remove (I thing).

PACKAGES += node
PACKAGES += tessel-app

Expand Down
64 changes: 53 additions & 11 deletions package/node/node/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=node
PKG_VERSION:=v4.5.0
PKG_VERSION:=v6.10.3
PKG_RELEASE:=1

PKG_SOURCE:=node-$(PKG_VERSION).tar.gz
PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://nodejs.org/dist/${PKG_VERSION}/
PKG_SHA256SUM:=74ced83b8d890d90e2a8b0d54b0d0e9b5e01d6fd6148cec6e9911ff6eaf0cf21
PKG_SHA256SUM:=82262a703e61164e09170a14d88b1726720651b0c7ee87a277654247b21b5388

# From : https://github.com/tessel/openwrt-tessel/blob/bc3316cd4458a5359166daf5684e9906a9ef7851/package/node/node/Makefile
# {
HOST_BUILD_DEPENDS:=python/host
PKG_BUILD_DEPENDS:=python/host
PKG_INSTALL:=1
PKG_USE_MIPS16:=0

HOST_BUILD_PARALLEL:=1
# }

PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=

include $(INCLUDE_DIR)/package.mk

Expand All @@ -35,24 +44,58 @@ define Package/npm
URL:=https://npmjs.org/
endef

# From : https://github.com/tessel/openwrt-tessel/blob/bc3316cd4458a5359166daf5684e9906a9ef7851/package/node/node/Makefile
# {
CPU:=$(subst aarch64,arm64,$(subst x86_64,x64,$(subst i386,ia32,$(ARCH))))

MAKE_VARS += \
DESTCPU=$(CPU)
# }

ifeq ($(ARCH),i386)
DEST_CPU=ia32
else
DEST_CPU=$(ARCH)
endif


CONFIGURE_ARGS = --dest-cpu=$(DEST_CPU) --dest-os=linux \
--shared-openssl --shared-openssl-includes="$(STAGING_DIR)/usr/include" --shared-openssl-libpath="$(STAGING_DIR)/usr/lib" \
--shared-zlib --shared-zlib-includes="$(STAGING_DIR)/usr/include" --shared-zlib-libpath="$(STAGING_DIR)/usr/lib" \
--v8-options="--max_old_space_size=20 --initial_old_space_size=4 --max_semi_space_size=2 --max_executable_size=5" \
--without-snapshot
CONFIGURE_ARGS = \
--dest-cpu=$(DEST_CPU) \
--dest-os=linux \
--without-snapshot \
--shared-zlib \
--shared-openssl \
--prefix=/usr \
--v8-options="--max_old_space_size=20 --initial_old_space_size=4 --max_semi_space_size=2 --max_executable_size=5 --optimize_for_size" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Searched but cannot learn all memory stuff in a short time. Added --optimize_for_size for good, without knowing if its valuable.
Also: nodejs/node#7937

--without-inspector \
--without-dtrace \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we dont need debug features. But I cannot see any benefit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would benefit from the inspector feature. We can actually use Chrome inspector for debugging.

--without-intl

ifeq ($(ARCH),mipsel)
CONFIGURE_ARGS += \
--with-mips-arch-variant=r2 --with-mips-fpu-mode=fp32 --with-mips-float-abi=soft
--with-mips-arch-variant=r2 \
--with-mips-fpu-mode=fp32 \
--with-mips-float-abi=soft
endif

# From : https://github.com/tessel/openwrt-tessel/blob/bc3316cd4458a5359166daf5684e9906a9ef7851/package/node/node/Makefile
# {
HOST_CONFIGURE_VARS:=

HOST_CONFIGURE_ARGS:= \
--dest-os=linux \
--without-snapshot \
--with-intl=none \
--prefix=$(STAGING_DIR_HOSTPKG)

HOST_CONFIGURE_CMD:=python ./configure

define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
endef
# }

define Package/node/install
mkdir -p $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/out/Release/node $(1)/usr/bin/node
Expand All @@ -66,4 +109,3 @@ endef

$(eval $(call BuildPackage,node))
$(eval $(call BuildPackage,npm))

36 changes: 0 additions & 36 deletions package/node/node/patches/010-uclib_execinfo.patch

This file was deleted.

107 changes: 107 additions & 0 deletions package/openwrt-addpack/icu/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#
# Copyright (C) 2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
# Taken from github.com/tobiaswaldvogel/openwrt-addpack/blob/master/libicu/Makefile

include $(TOPDIR)/rules.mk

PKG_NAME:=icu
PKG_VERSION:=57.1
PKG_RELEASE:=1

PKG_SOURCE:=icu4c-57_1-src.tgz
PKG_SOURCE_URL:=http://download.icu-project.org/files/icu4c/$(PKG_VERSION)/
PKG_BUILD_DIR:=$(BUILD_DIR)/icu
PKG_FIXUP:=libtool,no-autoreconf
PKG_INSTALL=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk

define Package/libicu
SECTION:=libs
CATEGORY:=Libraries
TITLE:=ICU library for software internationalization
URL:=http://icu-project.org
DEPENDS:=+glib2
endef

define Package/libicu/description
ICU is a mature, widely used set of C/C++ and Java libraries providing Unicode
and Globalization support for software applications.
endef

MAKE_PATH:=source

HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/icu

#define Host/Prepare
# mkdir -p $(HOST_BUILD_DIR)
#endef


define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)/source all install
endef



# Specify what needs to be done to prepare for building the package.
# In our case, we need to copy the source files to the build directory.
# This is NOT the default. The default uses the PKG_SOURCE_URL and the
# PKG_SOURCE which is not defined here to download the source from the web.
# In order to just build a simple program that we have just written, it is
# much easier to do it this way.
#define Build/Prepare
# $(call Build/Prepare/Default)
# $(CP) -a $(PKG_BUILD_DIR)/source/* $(PKG_BUILD_DIR)/
#endef

define Build/Prepare
mkdir -p $(HOST_BUILD_DIR)
$(call Host/Prepare/Default)
$(call Host/Configure/Default,,,source)
$(call Host/Compile)
$(call Build/Prepare/Default)
endef

define Build/Configure
# mkdir -p $(HOST_BUILD_DIR)
# $(call Host/Prepare/Default)
# $(call Host/Configure/Default,,,source)
# $(call Host/Compile)
$(call Build/Configure/Default, \
--with-cross-build=$(HOST_BUILD_DIR)/source,, \
source \
)
endef

#define Build/InstallDev
# $(INSTALL_DIR) $(1)/usr/lib
# $(CP) \
# $(PKG_INSTALL_DIR)/usr/lib/*.so* \
# $(1)/usr/lib/
#
# $(INSTALL_DIR) $(1)/usr/bin
# $(INSTALL_DATA) \
# $(PKG_INSTALL_DIR)/usr/bin/* \
# $(1)/usr/bin/
#
# $(INSTALL_DIR) $(1)/usr/include
# $(CP) \
# $(PKG_INSTALL_DIR)/usr/include/* \
# $(1)/usr/include/
#endef

define Package/libicu/install
$(INSTALL_DIR) $(1)/usr/lib
# $(CP) \
# $(PKG_INSTALL_DIR)/usr/lib/*.so* \
# $(1)/usr/lib/
endef

$(eval $(call HostBuild))
$(eval $(call BuildPackage,libicu))