matthew-brett / delocate

Find and copy needed dynamic libraries into python wheels
BSD 2-Clause "Simplified" License
262 stars 59 forks source link

Is it possible to set a custom search path? #151

Closed cansik closed 2 years ago

cansik commented 2 years ago

First of all thank you very much for building this tool, it helped me a lot in the past. But there were some libraries where I knew where they are located, but delocate could not find them (search path was empty).

Would it be possible to add a custom search path parameter, which is used to locate the rpath libs (additionally to the system paths)?

HexDecimal commented 2 years ago

If it's a library you've built then you add rpaths using the -rpath <path> link flags. Otherwise you can use install_name_tool to add/change a libraries rpaths.

Delocate tries to follow the dynamic linking rules of MacOS. If the library wouldn't load normally than I'd be uncomfortable with making a workaround, but that's just me.

fbrennen commented 2 years ago

delocate will also search locations you have stored in the DYLD_LIBRARY_PATH and DYLD_FALLBACK_LIBRARY_PATH environment variables (those are the mechanisms that MacOS provides to solve the problem you're having) -- you should be able to address your issue that way.

cansik commented 2 years ago

@fbrennen Thanks!