Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 187703 - sys-libs/readline patch for working libraries on Darwin and AIX
Summary: sys-libs/readline patch for working libraries on Darwin and AIX
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-04 10:24 UTC by Fabian Groffen
Modified: 2007-08-04 14:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
from /usr/lib to /lib patch (readline-prefix.patch,1.49 KB, patch)
2007-08-04 10:25 UTC, Fabian Groffen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2007-08-04 10:24:03 UTC
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)
 }
Comment 1 Fabian Groffen gentoo-dev 2007-08-04 10:25:07 UTC
Created attachment 126851 [details, diff]
from /usr/lib to /lib patch

the patch as pasted in the initial post.
Comment 2 SpanKY gentoo-dev 2007-08-04 13:44:54 UTC
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
Comment 3 Fabian Groffen gentoo-dev 2007-08-04 13:48:48 UTC
aha... I didn't think of those.  Hmmm... so one of both needs to be fixed.  Reconsideration time here...
Comment 4 Fabian Groffen gentoo-dev 2007-08-04 14:19:41 UTC
in hindsight this was not a good idea, as this leaves the libtool files with references to /lib:wq