From be06d6d0992a93797b0328f99887204c01fa64f2 Mon Sep 17 00:00:00 2001 From: Aria Stewart Date: Sun, 2 Dec 2012 10:17:29 -0700 Subject: [PATCH] - 0.8.15 --- nodejs-shared.patch | 112 ++++++++++++++++++++++++++++++++++++++++++++ nodejs.spec | 71 +++++++++++++--------------- 2 files changed, 145 insertions(+), 38 deletions(-) create mode 100644 nodejs-shared.patch diff --git a/nodejs-shared.patch b/nodejs-shared.patch new file mode 100644 index 0000000..7aaa239 --- /dev/null +++ b/nodejs-shared.patch @@ -0,0 +1,112 @@ +diff -ur node-v0.8.15-o/Makefile node-v0.8.15/Makefile +--- node-v0.8.15-o/Makefile 2012-11-26 08:51:39.000000000 -0700 ++++ node-v0.8.15/Makefile 2012-12-02 10:04:42.000000000 -0700 +@@ -39,11 +39,13 @@ + out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/common.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi + $(PYTHON) tools/gyp_node -f make + +-install: all +- $(PYTHON) tools/install.py $@ $(DESTDIR) ++install: all justinstall ++ ++justinstall: ++ $(PYTHON) tools/install.py install $(DESTDIR) $(LIBDIR) + + uninstall: +- $(PYTHON) tools/install.py $@ $(DESTDIR) ++ $(PYTHON) tools/install.py $@ $(DESTDIR) $(LIBDIR) + + clean: + -rm -rf out/Makefile node node_g out/$(BUILDTYPE)/node blog.html email.md +diff -ur node-v0.8.15-o/node.gyp node-v0.8.15/node.gyp +--- node-v0.8.15-o/node.gyp 2012-11-26 08:51:39.000000000 -0700 ++++ node-v0.8.15/node.gyp 2012-12-02 10:04:42.000000000 -0700 +@@ -57,6 +57,36 @@ + 'type': 'executable', + + 'dependencies': [ ++ 'libnode', ++ 'deps/uv/uv.gyp:uv', ++ 'node_js2c#host', ++ ], ++ ++ 'include_dirs': [ ++ 'src', ++ 'deps/uv/src/ares', ++ '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h ++ ], ++ ++ 'sources': [ ++ 'src/node_main.cc', ++ # node.gyp is added to the project by default. ++ 'common.gypi', ++ ], ++ ++ 'defines': [ ++ 'NODE_WANT_INTERNALS=1', ++ 'ARCH="<(target_arch)"', ++ 'PLATFORM="<(OS)"', ++ ], ++ }, ++ { ++ 'target_name': 'libnode', ++ 'type': 'shared_library', ++ 'product_extension': 'so.8.0.0', ++ 'soname_version': '8.0.0', ++ ++ 'dependencies': [ + 'deps/http_parser/http_parser.gyp:http_parser', + 'deps/uv/uv.gyp:uv', + 'node_js2c#host', +@@ -79,7 +109,6 @@ + 'src/node_file.cc', + 'src/node_http_parser.cc', + 'src/node_javascript.cc', +- 'src/node_main.cc', + 'src/node_os.cc', + 'src/node_script.cc', + 'src/node_stat_watcher.cc', +diff -ur node-v0.8.15-o/tools/install.py node-v0.8.15/tools/install.py +--- node-v0.8.15-o/tools/install.py 2012-12-01 22:39:50.000000000 -0700 ++++ node-v0.8.15/tools/install.py 2012-12-02 10:04:52.000000000 -0700 +@@ -10,6 +10,7 @@ + # set at init time + dst_dir = None + node_prefix = None # dst_dir without DESTDIR prefix ++lib_dir = 'lib' + target_defaults = None + variables = None + +@@ -168,6 +169,7 @@ + assert(0) # unhandled action type + + def files(action): ++ global lib_dir + action(['deps/uv/include/ares.h', + 'deps/uv/include/ares_version.h', + 'deps/uv/include/uv.h', +@@ -193,6 +195,7 @@ + 'include/node/uv-private/') + action(['doc/node.1'], 'share/man/man1/') + action(['out/Release/node'], 'bin/node') ++ action(['out/Release/lib.target/libnode.so.8.0.0'], lib_dir + '/libnode.so.8.0.0') + + # install unconditionally, checking if the platform supports dtrace doesn't + # work when cross-compiling and besides, there's at least one linux flavor +@@ -203,7 +206,7 @@ + if 'true' == variables.get('node_install_npm'): npm_files(action) + + def run(args): +- global dst_dir, node_prefix, target_defaults, variables ++ global dst_dir, node_prefix, target_defaults, variables, lib_dir + + # chdir to the project's top-level directory + os.chdir(abspath(os.path.dirname(__file__), '..')) +@@ -215,6 +218,7 @@ + # argv[2] is a custom install prefix for packagers (think DESTDIR) + dst_dir = node_prefix = variables.get('node_prefix') or '/usr/local' + if len(args) > 2: dst_dir = abspath(args[2] + '/' + dst_dir) ++ if len(args) > 3: lib_dir = args[3] + + cmd = args[1] if len(args) > 1 else 'install' + if cmd == 'install': return files(install) diff --git a/nodejs.spec b/nodejs.spec index 745fbc9..ee1533e 100644 --- a/nodejs.spec +++ b/nodejs.spec @@ -1,28 +1,25 @@ Summary: Asynchronous JavaScript Engine Name: nodejs -Version: 0.6.21 +Version: 0.8.15 Release: 1 License: BSD and MIT and ASL 2.0 and GPLv3 Group: Development/Languages URL: http://www.nodejs.org/ Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz -# Source0-md5: 0da985a0bf820400af92363b9f453fe4 -Patch1: %{name}-soname.patch +# Source0-md5: 6cb31180b07475db103e694f65e8bb9b +Patch1: %{name}-shared.patch # force node to use /usr/lib/node as the systemwide module directory Patch2: %{name}-libpath.patch # use /usr/lib64/node as an arch-specific module dir when appropriate Patch3: %{name}-lib64path.patch Patch5: uv-fpic.patch -BuildRequires: c-ares-devel >= 1.7.4 BuildRequires: gcc >= 5:4.0 -BuildRequires: libeio-devel -BuildRequires: libev-devel >= 4.0.0 BuildRequires: libstdc++-devel BuildRequires: python >= 1:2.5.2 BuildRequires: python-jsmin BuildRequires: rpm >= 4.4.9-56 BuildRequires: rpmbuild(macros) >= 1.219 -BuildRequires: v8-devel >= 3.6 +BuildRequires: v8-devel >= 3.11.10.25 ExclusiveArch: %{ix86} %{x8664} arm BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -83,18 +80,6 @@ used by Node.js and many of its modules. grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},' %build -CFLAGS="%{rpmcflags} -fPIC" -CPPFLAGS="%{rpmcppflags} -fPIC" -CXXFLAGS="%{rpmcxxflags} -fPIC" -LDFLAGS="%{rpmcflags}" -%if "%{pld_release}" == "ac" -CC="%{__cc}4" -CXX="%{__cxx}4" -%else -CC="%{__cc}" -CXX="%{__cxx}" -%endif -export CFLAGS LDFLAGS CXXFLAGS CC CXX LINKFLAGS_UV # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc' CC=${CC#ccache } @@ -102,24 +87,42 @@ CC=${CC#ccache } # NOT autoconf so dont use macro export PYTHONPATH=tools ./configure \ - --shared-cares \ --shared-v8 \ --shared-zlib \ + --shared-openssl \ --without-npm \ - --libdir=%{_libdir} \ --prefix=%{_prefix} -# build library -%{__make} dynamiclib -%{__make} program - -# relink with shared lib -$CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release +%make -C out \ + BUILDTYPE=Release \ + V=1 \ + CFLAGS.host="%{rpmcflags} -fPIC" \ + CXXFLAGS.host="%{rpmcppflags} -fPIC" \ + LDFLAGS.host="%{rpmcflags}" \ + CFLAGS.target="%{rpmcflags} -fPIC" \ + CXXFLAGS.target="%{rpmcppflags} -fPIC" \ + LDFLAGS.target="%{rpmcflags}" \ +%if "%{pld_release}" == "ac" + CC.host="%{__cc}4" \ + CXX.host="%{__cxx}4" \ + CC.target="%{__cc}4" \ + CXX.target="%{__cxx}4" \ +%else + CC.host="%{__cc}" \ + CXX.host="%{__cxx}" \ + CC.target="%{__cc}" \ + CXX.target="%{__cxx}" +%endif %install rm -rf $RPM_BUILD_ROOT -%{__make} install \ - DESTDIR=$RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT/%{_prefix}/lib/node/wafadmin +%{__make} justinstall \ + DESTDIR=$RPM_BUILD_ROOT \ + LIBDIR=%{_lib} + +ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so.8 +ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1 @@ -132,14 +135,6 @@ install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules # default searchpaths install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node -# install shared lib -export PYTHONPATH=tools -%{__python} tools/waf-light install \ - --product-type=cshlib \ - --destdir=$RPM_BUILD_ROOT - -chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so* - # create pkgconfig install -d $RPM_BUILD_ROOT%{_pkgconfigdir} cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc @@ -177,7 +172,7 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{_bindir}/node %attr(755,root,root) %{_bindir}/nodejs %attr(755,root,root) %{_libdir}/libnode.so.*.*.* -%ghost %{_libdir}/libnode.so.6 +%ghost %{_libdir}/libnode.so.8 %if "%{_lib}" != "lib" %dir %{_libdir}/node %endif -- 2.44.0