The following patch (also attached) changes the installation of readline to install libraries to /lib instead of /usr/lib. The reason behind this is that on in particular Darwin an id is encoded in the library which can be compared to the ELF soname. It only has a full path, resulting in the library pointing to /usr/lib while the file itself is located in /lib. Since the id/soname points to the versioned library, and only the unversioned library is made available in /usr/lib this breaks any linking against the library on Darwin. Simply installing in /lib, moving the static lib and then making it available in /usr/lib works for Darwin, Linux, Solaris and AIX. Also please note the use of $(get_libname) such that it works on Darwin, having .dylib files instead of .so. This patch is a derivative of what's in the prefix overlay, i.e. with prefix specifics removed. --- ../../../rsync-tree/sys-libs/readline/readline-5.2_p4.ebuild 2007-07-30 13:06:26.000000000 +0200 +++ readline-5.2_p4-r00.1.ebuild 2007-08-01 17:37:43.481292245 +0200 @@ -59,7 +64,7 @@ # the --libdir= is needed because if lib64 is a directory, it will default # to using that... even if CONF_LIBDIR isnt set or we're using a version # of portage without CONF_LIBDIR support. - econf --with-curses --libdir=/usr/$(get_libdir) || die + econf --with-curses --libdir=/$(get_libdir) || die emake || die if ! tc-is-cross-compiler; then @@ -71,14 +76,13 @@ src_install() { emake DESTDIR="${D}" install || die - dodir /$(get_libdir) - - mv "${D}"/usr/$(get_libdir)/*.so* "${D}"/$(get_libdir) - chmod a+rx "${D}"/$(get_libdir)/*.so* + # Move static and extraneous ncurses libraries out of /lib + dodir /usr/$(get_libdir) + mv "${D}"/$(get_libdir)/lib{readline,history}.a "${D}"/usr/$(get_libdir)/ # Bug #4411 - gen_usr_ldscript libreadline.so - gen_usr_ldscript libhistory.so + gen_usr_ldscript lib{readline,history}$(get_libname) + chmod a+rx "${D}"/$(get_libdir)/*$(get_libname)* if ! tc-is-cross-compiler; then dobin examples/rlfe/rlfe || die @@ -91,9 +95,9 @@ } pkg_preinst() { - preserve_old_lib /$(get_libdir)/lib{history,readline}.so.4 #29865 + preserve_old_lib /$(get_libdir)/lib{history,readline}$(get_libname 4) #29865 } pkg_postinst() { - preserve_old_lib_notify /$(get_libdir)/lib{history,readline}.so.4 + preserve_old_lib_notify /$(get_libdir)/lib{history,readline}$(get_libname 4) }
Created attachment 126851 [details, diff] from /usr/lib to /lib patch the patch as pasted in the initial post.
except you left behind the libtool linker script which has paths encoded to /lib instead of /usr/lib ... the exact reason for using /usr/lib and moving to /lib in the first place
aha... I didn't think of those. Hmmm... so one of both needs to be fixed. Reconsideration time here...
in hindsight this was not a good idea, as this leaves the libtool files with references to /lib:wq