node: fix host build error on macOS 9628/head
authorHirokazu MORIKAWA <morikw2@gmail.com>
Thu, 1 Aug 2019 07:43:13 +0000 (16:43 +0900)
committerHirokazu MORIKAWA <morikw2@gmail.com>
Thu, 1 Aug 2019 07:43:13 +0000 (16:43 +0900)
fix host build error on macOS
reference: https://github.com/openwrt/packages/issues/9616

Related: https://github.com/openwrt/packages/issues/7171
(This correspondence is necessary to build with macOS.)

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
lang/node/Makefile
lang/node/patches/007-fix_host_build_on_macos.patch [new file with mode: 0644]

index 71b023bd0ad124b177e8c1e034f3bc20f0dc296e..3ddd9b79d2fc7e612aed5b43fae825a2f3b6469b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=node
 PKG_VERSION:=v8.16.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_SOURCE:=node-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://nodejs.org/dist/${PKG_VERSION}
 PKG_HASH:=3515e8e01568a5dc4dff3d91a76ebc6724f5fa2fbb58b4b0c5da7b178a2f7340
@@ -103,7 +103,7 @@ CONFIGURE_ARGS:= \
 HOST_CONFIGURE_VARS:=
 
 HOST_CONFIGURE_ARGS:= \
-       --dest-os=linux \
+       --dest-os=$(if $(findstring Darwin,$(HOST_OS)),mac,linux) \
        --without-snapshot \
        --prefix=$(STAGING_DIR_HOSTPKG)
 
diff --git a/lang/node/patches/007-fix_host_build_on_macos.patch b/lang/node/patches/007-fix_host_build_on_macos.patch
new file mode 100644 (file)
index 0000000..34f6ec8
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/tools/gyp/pylib/gyp/generator/make.py
++++ b/tools/gyp/pylib/gyp/generator/make.py
+@@ -174,7 +174,7 @@
+ LINK_COMMANDS_MAC = """\
+ quiet_cmd_alink = LIBTOOL-STATIC $@
+-cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
++cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool /usr/bin/libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^)
+ quiet_cmd_link = LINK($(TOOLSET)) $@
+ cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS)