diff options
3 files changed, 113 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0001-build-allow-passing-multiple-libs-to-pkg_config.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0001-build-allow-passing-multiple-libs-to-pkg_config.patch new file mode 100644 index 0000000000..13edf229b3 --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/0001-build-allow-passing-multiple-libs-to-pkg_config.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From fdaa0e3bef93c5c72a7258b5f1e30718e7d81f9b Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net> | ||
3 | Date: Mon, 2 Mar 2020 12:17:09 +0000 | ||
4 | Subject: [PATCH 1/2] build: allow passing multiple libs to pkg_config | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Sometimes it's necessary to pass multiple library names to pkg-config, | ||
10 | e.g. the brotli shared libraries can be pulled in with | ||
11 | pkg-config libbrotlienc libbrotlidec | ||
12 | |||
13 | Update the code to handle both, strings (as used so far), and lists | ||
14 | of strings. | ||
15 | |||
16 | Signed-off-by: André Draszik <git@andred.net> | ||
17 | --- | ||
18 | Upstream-Status: Submitted [https://github.com/nodejs/node/pull/32046] | ||
19 | configure.py | 6 +++++- | ||
20 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/configure.py b/configure.py | ||
23 | index beb08df088..e3f78f2fed 100755 | ||
24 | --- a/configure.py | ||
25 | +++ b/configure.py | ||
26 | @@ -680,7 +680,11 @@ def pkg_config(pkg): | ||
27 | retval = () | ||
28 | for flag in ['--libs-only-l', '--cflags-only-I', | ||
29 | '--libs-only-L', '--modversion']: | ||
30 | - args += [flag, pkg] | ||
31 | + args += [flag] | ||
32 | + if isinstance(pkg, list): | ||
33 | + args += pkg | ||
34 | + else: | ||
35 | + args += [pkg] | ||
36 | try: | ||
37 | proc = subprocess.Popen(shlex.split(pkg_config) + args, | ||
38 | stdout=subprocess.PIPE) | ||
39 | -- | ||
40 | 2.25.0 | ||
41 | |||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs/0002-build-allow-use-of-system-installed-brotli.patch b/meta-oe/recipes-devtools/nodejs/nodejs/0002-build-allow-use-of-system-installed-brotli.patch new file mode 100644 index 0000000000..fc038f3aae --- /dev/null +++ b/meta-oe/recipes-devtools/nodejs/nodejs/0002-build-allow-use-of-system-installed-brotli.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | From f0f927feee8cb1fb173835d5c3f6beb6bf7d5e54 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <git@andred.net> | ||
3 | Date: Mon, 2 Mar 2020 12:17:35 +0000 | ||
4 | Subject: [PATCH 2/2] build: allow use of system-installed brotli | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | brotli is available as a shared library since 2016, so it makes sense | ||
10 | to allow its use as a system-installed version. | ||
11 | |||
12 | Some of the infrastructure was in place already (node.gyp and | ||
13 | node.gypi), but some bits in the configure script here were missing. | ||
14 | |||
15 | Add them, keeping the default as before, to use the bundled version. | ||
16 | |||
17 | Refs: https://github.com/google/brotli/pull/421 | ||
18 | Signed-off-by: André Draszik <git@andred.net> | ||
19 | --- | ||
20 | Upstream-Status: Submitted [https://github.com/nodejs/node/pull/32046] | ||
21 | configure.py | 22 ++++++++++++++++++++++ | ||
22 | 1 file changed, 22 insertions(+) | ||
23 | |||
24 | diff --git a/configure.py b/configure.py | ||
25 | index e3f78f2fed..0190e31b41 100755 | ||
26 | --- a/configure.py | ||
27 | +++ b/configure.py | ||
28 | @@ -301,6 +301,27 @@ shared_optgroup.add_option('--shared-zlib-libpath', | ||
29 | dest='shared_zlib_libpath', | ||
30 | help='a directory to search for the shared zlib DLL') | ||
31 | |||
32 | +shared_optgroup.add_option('--shared-brotli', | ||
33 | + action='store_true', | ||
34 | + dest='shared_brotli', | ||
35 | + help='link to a shared brotli DLL instead of static linking') | ||
36 | + | ||
37 | +shared_optgroup.add_option('--shared-brotli-includes', | ||
38 | + action='store', | ||
39 | + dest='shared_brotli_includes', | ||
40 | + help='directory containing brotli header files') | ||
41 | + | ||
42 | +shared_optgroup.add_option('--shared-brotli-libname', | ||
43 | + action='store', | ||
44 | + dest='shared_brotli_libname', | ||
45 | + default='brotlidec,brotlienc', | ||
46 | + help='alternative lib name to link to [default: %default]') | ||
47 | + | ||
48 | +shared_optgroup.add_option('--shared-brotli-libpath', | ||
49 | + action='store', | ||
50 | + dest='shared_brotli_libpath', | ||
51 | + help='a directory to search for the shared brotli DLL') | ||
52 | + | ||
53 | shared_optgroup.add_option('--shared-cares', | ||
54 | action='store_true', | ||
55 | dest='shared_cares', | ||
56 | @@ -1692,6 +1713,7 @@ configure_napi(output) | ||
57 | configure_library('zlib', output) | ||
58 | configure_library('http_parser', output) | ||
59 | configure_library('libuv', output) | ||
60 | +configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc']) | ||
61 | configure_library('cares', output, pkgname='libcares') | ||
62 | configure_library('nghttp2', output, pkgname='libnghttp2') | ||
63 | configure_v8(output) | ||
64 | -- | ||
65 | 2.25.0 | ||
66 | |||
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb b/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb index 49bb71e282..1ea438c5b0 100644 --- a/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb +++ b/meta-oe/recipes-devtools/nodejs/nodejs_12.14.1.bb | |||
@@ -20,6 +20,8 @@ SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.xz \ | |||
20 | file://0003-Install-both-binaries-and-use-libdir.patch \ | 20 | file://0003-Install-both-binaries-and-use-libdir.patch \ |
21 | file://0004-v8-don-t-override-ARM-CFLAGS.patch \ | 21 | file://0004-v8-don-t-override-ARM-CFLAGS.patch \ |
22 | file://big-endian.patch \ | 22 | file://big-endian.patch \ |
23 | file://0001-build-allow-passing-multiple-libs-to-pkg_config.patch \ | ||
24 | file://0002-build-allow-use-of-system-installed-brotli.patch \ | ||
23 | " | 25 | " |
24 | SRC_URI_append_class-target = " \ | 26 | SRC_URI_append_class-target = " \ |
25 | file://0002-Using-native-binaries.patch \ | 27 | file://0002-Using-native-binaries.patch \ |
@@ -51,8 +53,9 @@ ARCHFLAGS_arm = "${@bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '- | |||
51 | GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' " | 53 | GYP_DEFINES_append_mipsel = " mips_arch_variant='r1' " |
52 | ARCHFLAGS ?= "" | 54 | ARCHFLAGS ?= "" |
53 | 55 | ||
54 | PACKAGECONFIG ??= "ares icu libuv zlib" | 56 | PACKAGECONFIG ??= "ares brotli icu libuv zlib" |
55 | PACKAGECONFIG[ares] = "--shared-cares,,c-ares" | 57 | PACKAGECONFIG[ares] = "--shared-cares,,c-ares" |
58 | PACKAGECONFIG[brotli] = "--shared-brotli,,brotli" | ||
56 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" | 59 | PACKAGECONFIG[icu] = "--with-intl=system-icu,--without-intl,icu" |
57 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" | 60 | PACKAGECONFIG[libuv] = "--shared-libuv,,libuv" |
58 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" | 61 | PACKAGECONFIG[nghttp2] = "--shared-nghttp2,,nghttp2" |
@@ -81,6 +84,8 @@ python do_unpack() { | |||
81 | shutil.rmtree(d.getVar('S') + '/deps/openssl', True) | 84 | shutil.rmtree(d.getVar('S') + '/deps/openssl', True) |
82 | if 'ares' in d.getVar('PACKAGECONFIG'): | 85 | if 'ares' in d.getVar('PACKAGECONFIG'): |
83 | shutil.rmtree(d.getVar('S') + '/deps/cares', True) | 86 | shutil.rmtree(d.getVar('S') + '/deps/cares', True) |
87 | if 'brotli' in d.getVar('PACKAGECONFIG'): | ||
88 | shutil.rmtree(d.getVar('S') + '/deps/brotli', True) | ||
84 | if 'libuv' in d.getVar('PACKAGECONFIG'): | 89 | if 'libuv' in d.getVar('PACKAGECONFIG'): |
85 | shutil.rmtree(d.getVar('S') + '/deps/uv', True) | 90 | shutil.rmtree(d.getVar('S') + '/deps/uv', True) |
86 | if 'nghttp2' in d.getVar('PACKAGECONFIG'): | 91 | if 'nghttp2' in d.getVar('PACKAGECONFIG'): |