From ee07b6043230c467121721520a3505217d87249a Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 16 Feb 2015 10:36:30 +0100 Subject: [PATCH] libgsm: create a versioned soname (#874). Also merge two additional patches from Gentoo. --- common/shlibs | 2 +- srcpkgs/libgsm/patches/gsm-1.0.12-64bit.patch | 15 ++ .../libgsm/patches/gsm-1.0.12-memcpy.patch | 10 ++ .../libgsm/patches/gsm-1.0.13-shared.patch | 150 ++++++++++++++++++ srcpkgs/libgsm/patches/sharedlib.patch | 53 ------- srcpkgs/libgsm/template | 20 ++- 6 files changed, 188 insertions(+), 62 deletions(-) create mode 100644 srcpkgs/libgsm/patches/gsm-1.0.12-64bit.patch create mode 100644 srcpkgs/libgsm/patches/gsm-1.0.12-memcpy.patch create mode 100644 srcpkgs/libgsm/patches/gsm-1.0.13-shared.patch delete mode 100644 srcpkgs/libgsm/patches/sharedlib.patch diff --git a/common/shlibs b/common/shlibs index bfb6b4ba37..8b9778d4ed 100644 --- a/common/shlibs +++ b/common/shlibs @@ -895,7 +895,7 @@ libIceXML.so.35 libIce-3.5.0_1 libvdpau.so.1 libvdpau-0.4.1_1 libgtkhtml-4.0.so.0 libgtkhtml-4.2.1_1 libgtkhtml-editor-4.0.so.0 libgtkhtml-4.2.1_1 -libgsm.so libgsm-1.0.13_1 +libgsm.so.1 libgsm-1.0.13_13 libcgroup.so.1 libcgroup-0.37.1_1 libxdg-basedir.so.1 libxdg-basedir-1.1.1_1 libev.so.4 libev-4.04_1 diff --git a/srcpkgs/libgsm/patches/gsm-1.0.12-64bit.patch b/srcpkgs/libgsm/patches/gsm-1.0.12-64bit.patch new file mode 100644 index 0000000000..1fde542ae9 --- /dev/null +++ b/srcpkgs/libgsm/patches/gsm-1.0.12-64bit.patch @@ -0,0 +1,15 @@ +--- inc/private.h 2006-04-26 22:17:01.000000000 +0300 ++++ inc/private.h 2007-08-19 12:23:02.000000000 +0300 +@@ -10,10 +10,10 @@ + #define PRIVATE_H + + typedef short word; /* 16 bit signed int */ +-typedef long longword; /* 32 bit signed int */ ++typedef int longword; /* 32 bit signed int */ + + typedef unsigned short uword; /* unsigned word */ +-typedef unsigned long ulongword; /* unsigned longword */ ++typedef unsigned int ulongword; /* unsigned longword */ + + struct gsm_state { + diff --git a/srcpkgs/libgsm/patches/gsm-1.0.12-memcpy.patch b/srcpkgs/libgsm/patches/gsm-1.0.12-memcpy.patch new file mode 100644 index 0000000000..0521cfe68f --- /dev/null +++ b/srcpkgs/libgsm/patches/gsm-1.0.12-memcpy.patch @@ -0,0 +1,10 @@ +--- src/code.c 2006-04-26 22:16:50.000000000 +0300 ++++ src/code.c 2007-08-19 12:18:01.000000000 +0300 +@@ -8,6 +8,7 @@ + + #include "config.h" + ++#include + + #ifdef HAS_STDLIB_H + #include diff --git a/srcpkgs/libgsm/patches/gsm-1.0.13-shared.patch b/srcpkgs/libgsm/patches/gsm-1.0.13-shared.patch new file mode 100644 index 0000000000..90d94da4ed --- /dev/null +++ b/srcpkgs/libgsm/patches/gsm-1.0.13-shared.patch @@ -0,0 +1,150 @@ +--- Makefile 2006-04-26 22:14:26.000000000 +0300 ++++ Makefile 2009-09-08 14:50:02.000000000 +0300 +@@ -96,7 +96,7 @@ + # Other tools + + SHELL = /bin/sh +-LN = ln ++LN = ln -s + BASENAME = basename + AR = ar + ARFLAGS = cr +@@ -140,6 +140,7 @@ + # Targets + + LIBGSM = $(LIB)/libgsm.a ++LIBGSMSO= $(LIB)/libgsm.so + + TOAST = $(BIN)/toast + UNTOAST = $(BIN)/untoast +@@ -203,24 +204,43 @@ + + # Object files + +-GSM_OBJECTS = $(SRC)/add.o \ +- $(SRC)/code.o \ +- $(SRC)/debug.o \ +- $(SRC)/decode.o \ +- $(SRC)/long_term.o \ +- $(SRC)/lpc.o \ +- $(SRC)/preprocess.o \ +- $(SRC)/rpe.o \ +- $(SRC)/gsm_destroy.o \ +- $(SRC)/gsm_decode.o \ +- $(SRC)/gsm_encode.o \ +- $(SRC)/gsm_explode.o \ +- $(SRC)/gsm_implode.o \ +- $(SRC)/gsm_create.o \ +- $(SRC)/gsm_print.o \ +- $(SRC)/gsm_option.o \ +- $(SRC)/short_term.o \ +- $(SRC)/table.o ++STATIC_GSM_OBJECTS = $(SRC)/add.o \ ++ $(SRC)/code.o \ ++ $(SRC)/debug.o \ ++ $(SRC)/decode.o \ ++ $(SRC)/long_term.o \ ++ $(SRC)/lpc.o \ ++ $(SRC)/preprocess.o \ ++ $(SRC)/rpe.o \ ++ $(SRC)/gsm_destroy.o \ ++ $(SRC)/gsm_decode.o \ ++ $(SRC)/gsm_encode.o \ ++ $(SRC)/gsm_explode.o \ ++ $(SRC)/gsm_implode.o \ ++ $(SRC)/gsm_create.o \ ++ $(SRC)/gsm_print.o \ ++ $(SRC)/gsm_option.o \ ++ $(SRC)/short_term.o \ ++ $(SRC)/table.o ++ ++SHARED_GSM_OBJECTS = $(SRC)/add.lo \ ++ $(SRC)/code.lo \ ++ $(SRC)/debug.lo \ ++ $(SRC)/decode.lo \ ++ $(SRC)/long_term.lo \ ++ $(SRC)/lpc.lo \ ++ $(SRC)/preprocess.lo \ ++ $(SRC)/rpe.lo \ ++ $(SRC)/gsm_destroy.lo \ ++ $(SRC)/gsm_decode.lo \ ++ $(SRC)/gsm_encode.lo \ ++ $(SRC)/gsm_explode.lo \ ++ $(SRC)/gsm_implode.lo \ ++ $(SRC)/gsm_create.lo \ ++ $(SRC)/gsm_print.lo \ ++ $(SRC)/gsm_option.lo \ ++ $(SRC)/short_term.lo \ ++ $(SRC)/table.lo + + TOAST_OBJECTS = $(SRC)/toast.o \ + $(SRC)/toast_lin.o \ +@@ -228,7 +248,7 @@ + $(SRC)/toast_alaw.o \ + $(SRC)/toast_audio.o + +-OBJECTS = $(GSM_OBJECTS) $(TOAST_OBJECTS) ++OBJECTS = $(STATIC_GSM_OBJECTS) $(SHARED_GSM_OBJECTS) $(TOAST_OBJECTS) + + # Manuals + +@@ -277,9 +297,12 @@ + $(CC) $(CFLAGS) $? + @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1 + ++%.lo: %.c ++ $(CC) $(CFLAGS) -fPIC -c $< -o $@ ++ + # Target rules + +-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST) ++all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST) + @-echo $(ROOT): Done. + + tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result +@@ -299,24 +322,29 @@ + + # The basic API: libgsm + +-$(LIBGSM): $(LIB) $(GSM_OBJECTS) ++$(LIBGSMSO): $(LIB) $(SHARED_GSM_OBJECTS) ++ $(LD) $(LFLAGS) -o $@.1.0.13 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(SHARED_GSM_OBJECTS) -lc ++ ln -fs libgsm.so.1.0.13 lib/libgsm.so.1 ++ ln -fs libgsm.so.1.0.13 lib/libgsm.so ++ ++$(LIBGSM): $(LIB) $(STATIC_GSM_OBJECTS) + -rm $(RMFLAGS) $(LIBGSM) +- $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) ++ $(AR) $(ARFLAGS) $(LIBGSM) $(STATIC_GSM_OBJECTS) + $(RANLIB) $(LIBGSM) + + + # Toast, Untoast and Tcat -- the compress-like frontends to gsm. + + $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) +- $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB) ++ $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB) + + $(UNTOAST): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(UNTOAST) +- $(LN) $(TOAST) $(UNTOAST) ++ $(LN) toast $(UNTOAST) + + $(TCAT): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(TCAT) +- $(LN) $(TOAST) $(TCAT) ++ $(LN) toast $(TCAT) + + + # The local bin and lib directories +@@ -426,7 +454,9 @@ + + clean: semi-clean + -rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \ +- $(TOAST) $(TCAT) $(UNTOAST) \ ++ $(LIBGSMSO) $(LIB)/libgsm.so.1.0.13 \ ++ $(LIB)libgsm.so.1 \ ++ $(TOAST) $(TCAT) $(UNTOAST) \ + $(ROOT)/gsm-1.0.tar.Z + + diff --git a/srcpkgs/libgsm/patches/sharedlib.patch b/srcpkgs/libgsm/patches/sharedlib.patch deleted file mode 100644 index 80cb4b2666..0000000000 --- a/srcpkgs/libgsm/patches/sharedlib.patch +++ /dev/null @@ -1,53 +0,0 @@ ---- Makefile.orig 2011-11-03 11:49:56.862331506 +0100 -+++ Makefile 2011-11-03 11:53:52.750659225 +0100 -@@ -140,6 +140,7 @@ LFLAGS = $(LDFLAGS) $(LDINC) - # Targets - - LIBGSM = $(LIB)/libgsm.a -+LIBGSM_SO = $(LIB)/libgsm.so - - TOAST = $(BIN)/toast - UNTOAST = $(BIN)/untoast -@@ -257,6 +258,7 @@ STUFF = ChangeLog \ - # Install targets - - GSM_INSTALL_TARGETS = \ -+ $(GSM_INSTALL_LIB)/libgsm.so \ - $(GSM_INSTALL_LIB)/libgsm.a \ - $(GSM_INSTALL_INC)/gsm.h \ - $(GSM_INSTALL_MAN)/gsm.3 \ -@@ -274,12 +276,12 @@ TOAST_INSTALL_TARGETS = \ - # Default rules - - .c.o: -- $(CC) $(CFLAGS) $? -+ $(CC) -fPIC -DPIC $(CFLAGS) $? - @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1 - - # Target rules - --all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST) -+all: $(LIBGSM) $(LIBGSM_SO) $(TOAST) $(TCAT) $(UNTOAST) - @-echo $(ROOT): Done. - - tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result -@@ -304,6 +306,9 @@ $(LIBGSM): $(LIB) $(GSM_OBJECTS) - $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) - $(RANLIB) $(LIBGSM) - -+$(LIBGSM_SO): $(LIB) $(GSM_OBJECTS) -+ -rm $(RMFLAGS) $(LIBGSM_SO) -+ $(LD) -shared $(LFLAGS) -o $(LIBGSM_SO) $(GSM_OBJECTS) - - # Toast, Untoast and Tcat -- the compress-like frontends to gsm. - -@@ -398,6 +403,9 @@ $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM) - cp $? $@ - chmod 444 $@ - -+$(GSM_INSTALL_LIB)/libgsm.so: $(LIBGSM_SO) -+ -rm $@ -+ install -m755 $? $@ - - # Distribution - diff --git a/srcpkgs/libgsm/template b/srcpkgs/libgsm/template index a6bbc32137..f39ee0d4f0 100644 --- a/srcpkgs/libgsm/template +++ b/srcpkgs/libgsm/template @@ -2,7 +2,7 @@ pkgname=libgsm version=1.0.13 wrksrc="gsm-1.0-pl13" -revision=12 +revision=13 homepage="http://www.quut.com/gsm/" distfiles="http://www.mangler.org/downloads/${pkgname}-${version}.tar.gz" short_desc="GSM 06.10 lossy speech compression" @@ -10,21 +10,24 @@ maintainer="Juan RP " license="BSD" checksum=52c518244d428c2e56c543b98c9135f4a76ff780c32455580b793f60a0a092ad -shlib_provides="libgsm.so" - do_build() { - make CC=$CC CCFLAGS="$CFLAGS -c -DNeedFunctionPrototypes=1" ${makejobs} + make CC=$CC CCFLAGS="$CFLAGS -c -DNeedFunctionPrototypes=1" LD=$CC AR=$AR } do_install() { - vmkdir usr/include/gsm - vmkdir usr/lib vmkdir usr/bin + vmkdir usr/lib + vmkdir usr/include/gsm + vmkdir usr/share/man/man3 + vmkdir usr/share/man/man1 install -m755 bin/* ${DESTDIR}/usr/bin - install -m755 lib/*.so ${DESTDIR}/usr/lib install -m644 lib/*.a ${DESTDIR}/usr/lib install -m644 inc/* ${DESTDIR}/usr/include/gsm + vinstall lib/libgsm.so.${version} 755 usr/lib + vcopy lib/libgsm.so usr/lib + vcopy lib/libgsm.so.1 usr/lib + rm -f ${DESTDIR}/usr/include/gsm/*.orig ln -sfr ${DESTDIR}/usr/include/gsm/gsm.h ${DESTDIR}/usr/include/gsm.h } @@ -34,6 +37,7 @@ libgsm-devel_package() { short_desc+=" - development files" pkg_install() { vmove usr/include - vmove "usr/lib/*.a" + vmove usr/lib/*.a + vmove usr/lib/*.so } }