[packages/nodejs/dev-4.2: 1/3] up to 4.2.1-lts
glen
glen at pld-linux.org
Sat Oct 17 23:02:21 CEST 2015
commit 3de234b3f98d9942e6b04beb8630f9ee232a4a64
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sat Oct 17 15:55:00 2015 +0300
up to 4.2.1-lts
disable system v8 - nobody builds like that
disabe shared patch - node modules don't link with it, they just assume
symbols from node process
nodejs-use-system-certs.patch | 39 +++++++++++++++++++--------------------
nodejs.spec | 23 ++++++++++++-----------
2 files changed, 31 insertions(+), 31 deletions(-)
---
diff --git a/nodejs.spec b/nodejs.spec
index e5fcd8b..fd49c9f 100644
--- a/nodejs.spec
+++ b/nodejs.spec
@@ -1,20 +1,20 @@
#
# Conditional build:
-%bcond_without system_v8 # system v8
-%bcond_without system_uv # system uv
-%bcond_without shared # build libnode.so shared library
+%bcond_with system_v8 # system v8
+%bcond_with system_uv # system uv
+%bcond_with shared # build libnode.so shared library
# NOTES:
# - https://nodejs.org/en/download/releases/
Summary: Asynchronous JavaScript Engine
Name: nodejs
-Version: 0.10.40
-Release: 1
+Version: 4.2.1
+Release: 0.1
License: BSD and MIT and Apache v2.0 and GPL v3
Group: Development/Languages
Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
-# Source0-md5: f6ef20f327ecd6cb1586c41c7184290c
+# Source0-md5: 41d2b9fb5220af3fd98dd70fb33a2a10
Patch1: %{name}-shared.patch
# force node to use /usr/lib/node as the systemwide module directory
Patch2: %{name}-libpath.patch
@@ -90,20 +90,21 @@ This package contains the documentation for nodejs.
%prep
%setup -q -n node-v%{version}
%{?with_shared:%patch1 -p1}
+#%patch1 -p1
%if %{_lib} == "lib64"
%patch3 -p1
%else
%patch2 -p1
%endif
%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
+#%{?with_system_uv:%patch5 -p1}
+#%patch6 -p1
+#%patch7 -p1
grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
rm -r deps/npm
-rm -r deps/cares
+#rm -r deps/cares
rm -r deps/http_parser
rm -r deps/openssl
%{?with_system_uv:rm -r deps/uv}
@@ -119,7 +120,7 @@ GYP_DEFINES="soname_version=%{sover}" \
%{?with_system_v8:--shared-v8} \
--shared-zlib \
--shared-openssl \
- --shared-cares \
+ %{?0:--shared-cares} \
%{?with_system_uv:--shared-libuv} \
--shared-http-parser \
--without-npm \
diff --git a/nodejs-use-system-certs.patch b/nodejs-use-system-certs.patch
index 952f341..ec528c2 100644
--- a/nodejs-use-system-certs.patch
+++ b/nodejs-use-system-certs.patch
@@ -6,40 +6,41 @@ Last-Update: 2014-03-02
Modified 2014-05-02 by T.C. Hollingsworth <tchollingsworth at gmail.com> with the correct path for Fedora
Modified 2014-08-11 by Elan Ruusamäe <glen at delfi.ee> with the correct path for PLD
---- a/src/node_crypto.cc
-+++ b/src/node_crypto.cc
-@@ -64,7 +64,6 @@
- namespace node {
+Modified 2015-10-17 by Elan Ruusamäe <glen at delfi.ee> updated for node 4.2.1-LTS
+--- node-v4.2.1/src/node_crypto.cc 2015-10-17 15:14:47.248709690 +0300
++++ node-v4.2.1/src/node_crypto.cc 2015-10-17 15:21:21.109176336 +0300
+@@ -127,7 +127,6 @@
+ static uv_mutex_t* locks;
- const char* root_certs[] = {
+ const char* const root_certs[] = {
-#include "node_root_certs.h" // NOLINT(build/include_order)
- NULL
};
-@@ -561,32 +560,16 @@
- assert(sc->ca_store_ == NULL);
+ X509_STORE* root_cert_store;
+@@ -706,32 +705,17 @@
+ CHECK_EQ(sc->ca_store_, nullptr);
if (!root_cert_store) {
- root_cert_store = X509_STORE_new();
-
-- for (int i = 0; root_certs[i]; i++) {
-- BIO *bp = BIO_new(BIO_s_mem());
+- for (size_t i = 0; i < ARRAY_SIZE(root_certs); i++) {
+- BIO* bp = NodeBIO::New();
-
- if (!BIO_write(bp, root_certs[i], strlen(root_certs[i]))) {
-- BIO_free(bp);
-- return False();
+- BIO_free_all(bp);
+- return;
- }
-
-- X509 *x509 = PEM_read_bio_X509(bp, NULL, NULL, NULL);
+- X509 *x509 = PEM_read_bio_X509(bp, nullptr, CryptoPemCallback, nullptr);
-
-- if (x509 == NULL) {
-- BIO_free(bp);
-- return False();
+- if (x509 == nullptr) {
+- BIO_free_all(bp);
+- return;
- }
-
- X509_STORE_add_cert(root_cert_store, x509);
-
-- BIO_free(bp);
+- BIO_free_all(bp);
- X509_free(x509);
+ if (SSL_CTX_load_verify_locations(sc->ctx_, "/etc/certs/ca-certificates.crt", NULL) == 1) {
+ root_cert_store = SSL_CTX_get_cert_store(sc->ctx_);
@@ -50,9 +51,7 @@ Modified 2014-08-11 by Elan Ruusamäe <glen at delfi.ee> with the correct path for
+ } else {
+ SSL_CTX_set_cert_store(sc->ctx_, root_cert_store);
}
--
+
sc->ca_store_ = root_cert_store;
- SSL_CTX_set_cert_store(sc->ctx_, sc->ca_store_);
-
- return True();
}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/nodejs.git/commitdiff/9618d15b362f2bdfe81b094355f474cea74ab062
More information about the pld-cvs-commit
mailing list