Skip to content
Permalink
Browse files

libgsm: fix incorrect id on some systems

using install_name_tool -change to change the library ID name did not work on newer systems
use install_name_tool -id instead to change it.

Added support for the Makefile library version to reflect the source version
this will be done dynamically now using ${version} and reinplace
will make updating in the future simpler and less error-prone

bump revision to pass these changes through
no dependents as yet so no need to bump any
  • Loading branch information
kencu committed Apr 13, 2019
1 parent 2b95be1 commit 3525986373dedc00f15995a370b93f1db5c2c733
Showing with 15 additions and 10 deletions.
  1. +11 −6 audio/libgsm/Portfile
  2. +4 −4 audio/libgsm/files/patch-makefile.diff
@@ -4,6 +4,7 @@ PortSystem 1.0

name libgsm
version 1.0.18
revision 1
license public-domain

categories audio
@@ -14,7 +15,7 @@ long_description ${description}
homepage http://www.quut.com/gsm
platforms darwin
distname gsm-${version}
master_sites http://www.quut.com/gsm/
master_sites ${homepage}
checksums rmd160 e268a667257aa42d5ddbb76c9a8b519f0a7cdb2d \
sha256 04f68087c3348bf156b78d59f4d8aff545da7f6e14f33be8f47d33f4efae2a10 \
size 64549
@@ -25,6 +26,10 @@ use_configure no
patch.pre_args -p1
patchfiles patch-makefile.diff patch-makefile-more.diff

post-patch {
reinplace "s|@@VERSION@@|${version}|g" ${worksrcpath}/Makefile
}

variant universal {}
use_parallel_build no

@@ -37,18 +42,18 @@ build.args CC="${configure.cc} [get_canonical_archflags cc]"
destroot.env INSTALL_ROOT=${destroot}${prefix}

post-destroot {
move ${worksrcpath}/lib/libgsm.1.0.13.dylib ${destroot}${prefix}/lib
move ${worksrcpath}/lib/libgsm.${version}.dylib ${destroot}${prefix}/lib
move ${worksrcpath}/lib/libgsm.1.dylib ${destroot}${prefix}/lib
move ${worksrcpath}/lib/libgsm.dylib ${destroot}${prefix}/lib

system -W ${destroot}${prefix} \
"install_name_tool -change ./lib/libgsm.1.0.13.dylib ${prefix}/lib/libgsm.1.0.13.dylib ./lib/libgsm.1.0.13.dylib"
"install_name_tool -id ${prefix}/lib/libgsm.${version}.dylib ./lib/libgsm.${version}.dylib"
system -W ${destroot}${prefix} \
"install_name_tool -change ./lib/libgsm.1.0.13.dylib ${prefix}/lib/libgsm.1.0.13.dylib ./bin/tcat"
"install_name_tool -change ./lib/libgsm.${version}.dylib ${prefix}/lib/libgsm.${version}.dylib ./bin/tcat"
system -W ${destroot}${prefix} \
"install_name_tool -change ./lib/libgsm.1.0.13.dylib ${prefix}/lib/libgsm.1.0.13.dylib ./bin/toast"
"install_name_tool -change ./lib/libgsm.${version}.dylib ${prefix}/lib/libgsm.${version}.dylib ./bin/toast"
system -W ${destroot}${prefix} \
"install_name_tool -change ./lib/libgsm.1.0.13.dylib ${prefix}/lib/libgsm.1.0.13.dylib ./bin/untoast"
"install_name_tool -change ./lib/libgsm.${version}.dylib ${prefix}/lib/libgsm.${version}.dylib ./bin/untoast"

}

@@ -17,7 +17,7 @@ diff -urNad libgsm-1.0.12~/Makefile libgsm-1.0.12/Makefile
# Targets

LIBGSM = $(LIB)/libgsm.a
+LIBGSMSO= $(LIB)/libgsm.1.0.13.dylib
+LIBGSMSO= $(LIB)/libgsm.@@VERSION@@.dylib

TOAST = $(BIN)/toast
UNTOAST = $(BIN)/untoast
@@ -35,9 +35,9 @@ diff -urNad libgsm-1.0.12~/Makefile libgsm-1.0.12/Makefile
# The basic API: libgsm

+$(LIBGSMSO): $(LIB) $(GSM_OBJECTS)
+ $(LD) -o $(LIBGSMSO) -dynamiclib -Wl,-compatibility_version,1,-current_version,1.0.13,-install_name,$(LIBGSMSO) $(GSM_OBJECTS) -lc
+ ln -fs libgsm.1.0.13.dylib lib/libgsm.1.dylib
+ ln -fs libgsm.1.0.13.dylib lib/libgsm.dylib
+ $(LD) -o $(LIBGSMSO) -dynamiclib -Wl,-compatibility_version,1,-current_version,@@VERSION@@,-install_name,$(LIBGSMSO) $(GSM_OBJECTS) -lc
+ ln -fs libgsm.@@VERSION@@.dylib lib/libgsm.1.dylib
+ ln -fs libgsm.@@VERSION@@.dylib lib/libgsm.dylib
+
$(LIBGSM): $(LIB) $(GSM_OBJECTS)
-rm $(RMFLAGS) $(LIBGSM)

1 comment on commit 3525986

@kencu

This comment has been minimized.

Copy link
Contributor Author

@kencu kencu commented on 3525986 Apr 13, 2019

@ryandesign -- this should give the proper version going forward. Thanks for noticing.

Please sign in to comment.
You can’t perform that action at this time.