pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fix for devel/talloc shared library install_name on Darwin



Hello.

The package devel/talloc from -current on Mac OS X Mavericks (10.9.4)
(Darwin 13.3.0), installs shared libraries with an incorrect
install_name as well as incorrect dependency paths that reference
build-time paths rather than final install paths.  Attached is a patch
to fix this for the talloc library.  (I did not try to fix the others.)
Would a developer be willing to commit this patch?

I reported the problem upstream at

  https://bugzilla.samba.org/show_bug.cgi?id=10791

Here's an example of the incorrect install_name:

===
$ otool -L /pkg-current/lib/libtalloc.dylib
/pkg-current/lib/libtalloc.dylib:
    /pkgsrc-current/devel/talloc/work/talloc-2.1.1/bin/default/\
libtalloc.inst.dylib (compatibility version 0.0.0, current version \
0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current \
version 1197.1.1)
===

And here's the correct install_name with the patch:

===
$ otool -L /pkg-current/lib/libtalloc.dylib
/pkg-current/lib/libtalloc.dylib:
    /pkg-current/lib/libtalloc.2.1.1.dylib (compatibility version \
0.0.0, current version 0.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current \
version 1197.1.1)
===

Thanks!

Lewis
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/devel/talloc/Makefile,v
retrieving revision 1.6
diff -b -u -r1.6 Makefile
--- Makefile    27 Jun 2014 23:02:04 -0000      1.6
+++ Makefile    29 Aug 2014 20:34:14 -0000
@@ -101,6 +101,20 @@
 REPLACE_PYTHON+=       lib/replace/wscript
 REPLACE_PYTHON+=       wscript
 
+.include "../../mk/bsd.prefs.mk"
+
+# Fix incorrect install_name of talloc library on Darwin.  Don't bother
+# fixing similar problem in pytalloc-util nor the Python talloc.so
+# since those reference other build-time paths in addition to having an
+# incorrect install_name; they will remain broken.
+# Upstream bug report: https://bugzilla.samba.org/show_bug.cgi?id=10791
+post-install:
+.if ${OPSYS} == "Darwin"
+       install_name_tool -id \
+           ${PREFIX}/lib/libtalloc.${PKGVERSION_NOREV}.dylib \
+           ${DESTDIR}${PREFIX}/lib/libtalloc.${PKGVERSION_NOREV}.dylib
+.endif
+
 .include "../../lang/python/application.mk"
 .include "../../lang/python/extension.mk"
 .include "../../mk/bsd.pkg.mk"


Home | Main Index | Thread Index | Old Index