Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 453650 - db-use.eclass does not correctly handle extension of dynamic library
Summary: db-use.eclass does not correctly handle extension of dynamic library
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All All
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-23 10:08 UTC by Shunsuke Shimizu
Modified: 2013-01-27 09:45 UTC (History)
0 users

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


Attachments
try searching dynamic library with all possible extension (db-use-fix-lib-extension.patch,1.13 KB, text/plain)
2013-01-23 10:08 UTC, Shunsuke Shimizu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shunsuke Shimizu 2013-01-23 10:08:33 UTC
Created attachment 336564 [details]
try searching dynamic library with all possible extension

Currently db-use.class in portage overlay assumes that the extension of dynamic library is .so, therefore db library weren't found on my OS X laptop, on which platform the correct extension is .dylib.

I made a little fix and attached  patch. The list of extensions is copied from db.eclass.
Comment 1 Fabian Groffen gentoo-dev 2013-01-27 09:45:29 UTC
Thanks!  We could also use get_libname() from multilib.eclass, that would cover even more cases.

I applied this one:

--- db-use.eclass       (revision 61535)
+++ db-use.eclass       (working copy)
@@ -89,7 +89,7 @@
 db_libname() {
        if [ $# -eq 0 ]; then
                VER="$(db_findver sys-libs/db)" || return 1
-               if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}.so" ]; then
+               if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
                        echo -n "db-${VER}"
                        return 0
                else
@@ -101,7 +101,7 @@
                for x in $@
                do
                        if VER=$(db_findver "=sys-libs/db-${x}*"); then
-                               if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}.so" ]; then
+                               if [ -e "${EPREFIX}/usr/$(get_libdir)/libdb-${VER}$(get_libname)" ]; then
                                        echo -n "db-${VER}"
                                        return 0
                                fi