summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/nspr/APKBUILD23
-rw-r--r--main/nspr/nspr-4.8-sonames.patch256
2 files changed, 277 insertions, 2 deletions
diff --git a/main/nspr/APKBUILD b/main/nspr/APKBUILD
index 4fefc886d..3382b0ce8 100644
--- a/main/nspr/APKBUILD
+++ b/main/nspr/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nspr
pkgver=4.8.6
-pkgrel=1
+pkgrel=2
pkgdesc="Netscape Portable Runtime"
url="http://www.mozilla.org/projects/nspr/"
arch="all"
@@ -13,6 +13,7 @@ source="ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v$pkgver/src/nspr-$p
nspr-4.7.0-prtime.patch
nspr-4.8-config.patch
nspr-4.8-pkgconfig-gentoo-3.patch
+ nspr-4.8-sonames.patch
"
_builddir="$srcdir"/$pkgname-$pkgver
@@ -40,6 +41,23 @@ build() {
make CC="${CC:-gcc}" CXX="${CXX:-g++}" || return 1
}
+dev() {
+ local i= j=
+ depends="$pkgname $depends_dev"
+
+ cd "$pkgdir" || return 0
+ for i in usr/include usr/lib/pkgconfig; do
+ if [ -e "$pkgdir/$i" ] || [ -L "$pkgdir/$i" ]; then
+ d="$subpkgdir/${i%/*}" # dirname $i
+ mkdir -p "$d"
+ mv "$pkgdir/$i" "$d"
+ rmdir "$pkgdir/${i%/*}" 2>/dev/null
+ fi
+ done
+
+ return 0
+}
+
package() {
local file= minor_version=${pkgver#*.}
minor_version=${minor_version%.*}
@@ -67,4 +85,5 @@ md5sums="592c275728c29d193fdba8009165990b nspr-4.8.6.tar.gz
d204a641dd7cbf6751d14dc6b98835f1 nspr-4.6.1-config-1.patch
c48e1f47799c1cff7e3bf46dc0e653f1 nspr-4.7.0-prtime.patch
c790c638a7c9fd1d731272f464f065c6 nspr-4.8-config.patch
-5b67b4339be94d0dbc4337a55eabe73a nspr-4.8-pkgconfig-gentoo-3.patch"
+5b67b4339be94d0dbc4337a55eabe73a nspr-4.8-pkgconfig-gentoo-3.patch
+5c9f15c65561af93ff5e148d8b64e212 nspr-4.8-sonames.patch"
diff --git a/main/nspr/nspr-4.8-sonames.patch b/main/nspr/nspr-4.8-sonames.patch
new file mode 100644
index 000000000..d0f5ad801
--- /dev/null
+++ b/main/nspr/nspr-4.8-sonames.patch
@@ -0,0 +1,256 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 81_sonames.dpatch by Mike Hommey <glandium@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add soname support
+
+@DPATCH@
+
+diff --git a/mozilla/nsprpub/config/rules.mk b/mozilla/nsprpub/config/rules.mk
+index 794b1ae..235929d 100644
+--- a/mozilla/nsprpub/config/rules.mk
++++ b/mozilla/nsprpub/config/rules.mk
+@@ -132,6 +132,29 @@ SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
+ else
+ ifdef MKSHLIB
+ SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
++SONAME = $(notdir $(SHARED_LIBRARY))
++
++ifdef SO_VERSION
++ifneq (,$(findstring $(SONAME),$(MKSHLIB)))
++SO_VERSION_MAJOR := $(shell echo $(SO_VERSION) | sed 's/^\([^.]*\)\(\.[^.]*\)\?\(\.[^.]*\)\?/\1/')
++SO_VERSION_MINOR := $(shell echo $(SO_VERSION) | sed 's/^\([^.]*\)\(\.[^.]*\)\?\(\.[^.]*\)\?/\2/')
++SO_VERSION_MICRO := $(shell echo $(SO_VERSION) | sed 's/^\([^.]*\)\(\.[^.]*\)\?\(\.[^.]*\)\?/\3/')
++
++SHARED_LIBRARY_LINKS := $(SONAME)
++ifdef SO_VERSION_MINOR
++SHARED_LIBRARY_LINKS += $(SONAME).$(SO_VERSION_MAJOR)
++endif
++ifdef SO_VERSION_MICRO
++SHARED_LIBRARY_LINKS += $(SHARED_LIBRARY).$(SO_VERSION_MAJOR)$(SO_VERSION_MINOR)
++endif
++
++SONAME := $(SONAME).$(SO_VERSION_MAJOR)
++SHARED_LIBRARY := $(SHARED_LIBRARY).$(SO_VERSION)
++
++MKSHLINKS = (cd $(1) && for link in $(SHARED_LIBRARY_LINKS); do rm -f $$link; ln -s $(notdir $(SHARED_LIBRARY)) $$link; done)
++endif
++endif
++
+ endif
+ endif
+
+@@ -165,7 +188,7 @@ OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
+ endif
+
+ ALL_TRASH = $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
+- $(NOSUCHFILE) \
++ $(SHARED_LIBRARY_LINKS) $(NOSUCHFILE) \
+ so_locations
+
+ ifndef RELEASE_LIBS_DEST
+@@ -215,6 +238,7 @@ ifdef RELEASE_HEADERS
+ endif
+ ifdef RELEASE_LIBS
+ $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
++ $(call MKSHLINKS,$(DESTDIR)$(libdir)/$(lib_subdir))
+ endif
+ +$(LOOP_OVER_DIRS)
+
+@@ -310,6 +334,8 @@ $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
+ endif
+ endif
+
++$(SHARED_LIBRARY_LINKS): %: $(SHARED_LIBRARY)
++
+ $(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE)
+ @$(MAKE_OBJDIR)
+ rm -f $@
+@@ -332,6 +358,7 @@ ifdef MT
+ endif # MSVC with manifest tool
+ else # WINNT && !GCC
+ $(MKSHLIB) $(OBJS) $(RES) $(LDFLAGS) $(EXTRA_LIBS)
++ $(call MKSHLINKS,.)
+ endif # WINNT && !GCC
+ endif # AIX 4.1
+ ifdef ENABLE_STRIP
+diff --git a/mozilla/nsprpub/configure.in b/mozilla/nsprpub/configure.in
+index 772e288..e4cea9a 100644
+--- a/mozilla/nsprpub/configure.in
++++ b/mozilla/nsprpub/configure.in
+@@ -1113,7 +1113,7 @@ case "$target" in
+ AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
+ MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
++ DSO_LDOPTS='-shared -Wl,-soname,$(SONAME)'
+ STRIP="$STRIP -d"
+ case "$target_os" in
+ bsdi4.2* | bsdi4.3* | bsdi5.*)
+@@ -1311,7 +1311,7 @@ tools are selected during the Xcode/Developer Tools installation.])
+ fi
+ MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
++ DSO_LDOPTS='-shared -Wl,-soname -Wl,$(SONAME)'
+ MDCPUCFG_H=_freebsd.cfg
+ PR_MD_CSRCS=freebsd.c
+ ;;
+@@ -1326,7 +1326,7 @@ tools are selected during the Xcode/Developer Tools installation.])
+ # workaround this problem.
+ AC_DEFINE(_PR_POLL_WITH_SELECT)
+ AC_DEFINE(_USE_BIG_FDS)
+- DSO_LDOPTS='-b +h $(notdir $@)'
++ DSO_LDOPTS='-b +h $(SONAME)'
+ PR_MD_CSRCS=hpux.c
+ if test "$OS_TEST" = "ia64"; then
+ DLL_SUFFIX=so
+@@ -1579,7 +1579,7 @@ arm-android-eabi)
+ PR_MD_CSRCS=linux.c
+ MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
++ DSO_LDOPTS='-shared -Wl,-soname -Wl,$(SONAME)'
+ _OPTIMIZE_FLAGS=-O2
+ _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
+ # combo is not yet good at debugging inlined
+@@ -1610,7 +1610,7 @@ arm-android-eabi)
+ PR_MD_CSRCS=linux.c
+ MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
+ DSO_CFLAGS=-fPIC
+- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
++ DSO_LDOPTS='-shared -Wl,-soname -Wl,$(SONAME)'
+ _OPTIMIZE_FLAGS=-O2
+ _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
+ # combo is not yet good at debugging inlined
+@@ -1943,7 +1943,7 @@ mips-nec-sysv*)
+ else
+ OBJECT_FMT=ELF
+ DLL_SUFFIX=so
+- DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
++ DSO_LDOPTS='-shared -Wl,-soname,$(SONAME)'
+ fi
+ fi
+
+@@ -1989,7 +1989,7 @@ mips-sony-newsos*)
+ AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
+ MDCPUCFG_H=_nto.cfg
+ PR_MD_CSRCS=nto.c
+- MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
++ MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(SONAME) -o $@'
+ DSO_CFLAGS=-fPIC
+ DSO_LDOPTS=-shared
+ OS_LIBS="$OS_LIBS -lsocket"
+@@ -2052,7 +2052,7 @@ mips-sony-newsos*)
+ if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
+ AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
+ fi
+- DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
++ DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(SONAME)'
+ MDCPUCFG_H=_osf1.cfg
+ PR_MD_CSRCS=osf1.c
+ ;;
+@@ -2119,7 +2119,7 @@ mips-sony-newsos*)
+ _OPTIMIZE_FLAGS='-O -F Olimit,4000'
+ fi
+
+- DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
++ DSO_LDOPTS='-G -z defs -h $(SONAME)'
+
+ if test "$OS_RELEASE" = "5.43"; then
+ AC_DEFINE(IP_MULTICAST)
+@@ -2184,13 +2184,13 @@ mips-sony-newsos*)
+ if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
+ GCC_USE_GNU_LD=1
+ fi
+- DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
++ DSO_LDOPTS='-shared -Wl,-h,$(SONAME),-z,combreloc,-z,defs,-z,ignore'
+ if test -n "$USE_B_DIRECT"; then
+ DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
+ fi
+ else
+ DSO_CFLAGS=-KPIC
+- DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
++ DSO_LDOPTS='-G -h $(SONAME) -z combreloc -z defs -z ignore'
+ if test -n "$USE_B_DIRECT"; then
+ DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
+ fi
+diff --git a/mozilla/nsprpub/lib/ds/Makefile.in b/mozilla/nsprpub/lib/ds/Makefile.in
+index 82dca03..ab4e64d 100644
+--- a/mozilla/nsprpub/lib/ds/Makefile.in
++++ b/mozilla/nsprpub/lib/ds/Makefile.in
+@@ -122,6 +122,7 @@ endif
+
+ LIBRARY_NAME = plds
+ LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
++SO_VERSION = 0d
+
+ RELEASE_HEADERS = $(HEADERS)
+ RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
+@@ -176,11 +177,13 @@ endif
+ export:: $(TARGETS)
+ $(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
+ $(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
++ $(call MKSHLINKS,$(dist_libdir))
+ ifdef SHARED_LIBRARY
+ ifeq ($(OS_ARCH),HP-UX)
+ $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
+ $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
+ else
+ $(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
++ $(call MKSHLINKS,$(dist_bindir))
+ endif
+ endif
+diff --git a/mozilla/nsprpub/lib/libc/src/Makefile.in b/mozilla/nsprpub/lib/libc/src/Makefile.in
+index 2cafb1a..0d74a4a 100644
+--- a/mozilla/nsprpub/lib/libc/src/Makefile.in
++++ b/mozilla/nsprpub/lib/libc/src/Makefile.in
+@@ -68,6 +68,7 @@ CSRCS =\
+
+ LIBRARY_NAME = plc
+ LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
++SO_VERSION = 0d
+
+ RELEASE_LIBS = $(TARGETS)
+
+@@ -177,11 +178,13 @@ endif
+
+ export:: $(TARGETS)
+ $(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
++ $(call MKSHLINKS,$(dist_libdir))
+ ifdef SHARED_LIBRARY
+ ifeq ($(OS_ARCH),HP-UX)
+ $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
+ $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
+ else
+ $(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
++ $(call MKSHLINKS,$(dist_bindir))
+ endif
+ endif
+diff --git a/mozilla/nsprpub/pr/src/Makefile.in b/mozilla/nsprpub/pr/src/Makefile.in
+index 3514ab1..a86766e 100644
+--- a/mozilla/nsprpub/pr/src/Makefile.in
++++ b/mozilla/nsprpub/pr/src/Makefile.in
+@@ -325,6 +325,7 @@ endif
+
+ LIBRARY_NAME = nspr
+ LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
++SO_VERSION = 0d
+
+ RELEASE_LIBS = $(TARGETS)
+
+@@ -391,12 +392,14 @@ endif
+
+ export:: $(TARGETS)
+ $(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
++ $(call MKSHLINKS,$(dist_libdir))
+ ifdef SHARED_LIBRARY
+ ifeq ($(OS_ARCH),HP-UX)
+ $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
+ $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir)
+ else
+ $(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir)
++ $(call MKSHLINKS,$(dist_bindir))
+ endif
+ endif
+