Add patch to properly report soname version information

This patch will be included upstream in 0.10.6 and can be dropped then.
- Remove Bundles(ev) as this has not been true since 0.9.5
This commit is contained in:
Stephen Gallagher 2013-05-13 07:58:52 -04:00
parent 6ba4fc6d51
commit 4a087b2d68
2 changed files with 77 additions and 5 deletions

View File

@ -0,0 +1,67 @@
From fa17cdcdc8f737fbcf986f96d657ca37e07fb1be Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <info@bnoordhuis.nl>
Date: Sun, 12 May 2013 14:48:58 +0200
Subject: [PATCH] build: set soname in shared library
---
config-unix.mk | 5 +++++
src/version.c | 4 +++-
uv.gyp | 9 ++++++++-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/config-unix.mk b/config-unix.mk
index ae510a332d127e03bd03f6f424e7b2e0c9973053..ea4a0ad4f715ad0ccd834228724b97aa3feed3ae 100644
--- a/config-unix.mk
+++ b/config-unix.mk
@@ -153,6 +153,11 @@ CPPFLAGS += -Isrc/unix
CFLAGS += -DHAVE_DTRACE
endif
+ifneq (darwin,$(PLATFORM))
+# Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR in src/version.c
+LDFLAGS += -Wl,-soname,libuv.so.0.10
+endif
+
libuv.a: $(OBJS)
$(AR) rcs $@ $^
diff --git a/src/version.c b/src/version.c
index 3291d47eebb10532638c58b2e5ffa348064f7564..9e9bf003e4ced453e28dfeb383b6474eb69271ff 100644
--- a/src/version.c
+++ b/src/version.c
@@ -24,7 +24,9 @@
/*
* Versions with an even minor version (e.g. 0.6.1 or 1.0.4) are API and ABI
* stable. When the minor version is odd, the API can change between patch
- * releases.
+ * releases. Make sure you update the -soname directives in config-unix.mk
+ * and uv.gyp whenever you bump UV_VERSION_MAJOR or UV_VERSION_MINOR (but
+ * not UV_VERSION_PATCH.)
*/
#undef UV_VERSION_MAJOR /* TODO(bnoordhuis) Remove in v0.11. */
diff --git a/uv.gyp b/uv.gyp
index 7824819a9bd4a889b566cefa45873d24822a689e..407da4bb3483a5eb4ff1f23fa90596013e721655 100644
--- a/uv.gyp
+++ b/uv.gyp
@@ -164,9 +164,16 @@
],
},
'conditions': [
- ['"<(library)" == "shared_library"', {
+ ['library=="shared_library"', {
'cflags': [ '-fPIC' ],
}],
+ ['library=="shared_library" and OS!="mac"', {
+ 'link_settings': {
+ # Must correspond with UV_VERSION_MAJOR and UV_VERSION_MINOR
+ # in src/version.c
+ 'libraries': [ '-Wl,-soname,libuv.so.0.10' ],
+ },
+ }],
],
}],
[ 'OS=="linux" or OS=="mac"', {
--
1.8.2.1

View File

@ -7,7 +7,7 @@
Name: libuv
Epoch: 1
Version: 0.10.5
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Platform layer for node.js
Group: Development/Tools
@ -16,14 +16,13 @@ URL: http://nodejs.org/
Source0: http://libuv.org/dist/v%{version}/%{name}-v%{version}.tar.gz
Source2: libuv.pc.in
# Upstream patch for generating versioned shared object
Patch0001: 0001-build-set-soname-in-shared-library.patch
BuildRequires: gyp
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
# Bundling exception request:
# https://fedorahosted.org/fpc/ticket/231
Provides: bundled(libev) = 4.04
%description
libuv is a new platform layer for Node. Its purpose is to abstract IOCP on
Windows and libev on Unix systems. We intend to eventually contain all platform
@ -42,6 +41,7 @@ Development libraries for libuv
%prep
%setup -q -n %{name}-v%{version}
%patch0001 -p1
%build
export CFLAGS='%{optflags}'
@ -113,6 +113,11 @@ sed -e "s#@prefix@#%{_prefix}#g" \
%{_includedir}/uv-private
%changelog
* Mon May 13 2013 Stephen Gallagher <sgallagh@redhat.com> - 1:0.10.5-2
- Add patch to properly report soname version information
This patch will be included upstream in 0.10.6 and can be dropped then.
- Remove Bundles(ev) as this has not been true since 0.9.5
* Wed Apr 24 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 1:0.10.5-1
- new upstream release 0.10.5