#225 setup_posix.py patching for RPATH inclusion

MySQLdb-1.3
open
Andy Dustman
MySQLdb (285)
5
2012-09-19
2007-03-21
bhodi
No

Right now, you have to set LD_LIBRARY_PATH or change ld.so.conf in order to use this library. Those are two things I'd rather not do, so I'd like to go ahead and link at install time with all the rest.

This is what I'm doing, and the proposed patch for you:

Index: setup_posix.py

--- setup_posix.py (revision 216765)
+++ setup_posix.py (working copy)
@@ -51,6 +51,7 @@

 library_dirs = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("L")) ]
 libraries = [ dequote(i[2:]) for i in libs if i.startswith(compiler_flag("l")) ]
  • extra_link_args = [ dequote(i) for i in libs if i.startswith("-W") ]

    removable_compile_args = [ compiler_flag(f) for f in "ILl" ]
    extra_compile_args = [ i.replace("%", "%%") for i in mysql_config("cflags")
    @@ -85,6 +86,7 @@
    extra_compile_args = extra_compile_args,
    include_dirs = include_dirs,
    extra_objects = extra_objects,
    + extra_link_args=extra_link_args,
    define_macros = define_macros,
    )
    return metadata, ext_options

Discussion

  • Jim Nusbaum
    Jim Nusbaum
    2007-03-22

    Logged In: YES
    user_id=1750325
    Originator: NO

    Isn't this most easily done with the following change to setup_posix.py. You just need to add a value for the runtime_library_dirs attribute:

    diff -c /usr/local/src/MySQL-python-1.2.2/setup_posix.py\~ /usr/local/src/MySQL-python-1.2.2/setup_posix.py
    /usr/local/src/MySQL-python-1.2.2/setup_posix.py~ Sat Mar 3 19:52:26 2007
    --- /usr/local/src/MySQL-python-1.2.2/setup_posix.py Thu Mar 22 09:10:11 2007
    ***
    81,86 ****
    --- 81,87 ----
    ext_options = dict(
    name = "_mysql",
    library_dirs = library_dirs,
    + runtime_library_dirs = library_dirs,
    libraries = libraries,
    extra_compile_args = extra_compile_args,
    include_dirs = include_dirs,

    Diff finished at Thu Mar 22 09:51:51