On 28 Oct 2024, at 15:00, Khem Raj <[email protected]> wrote: > > On Mon, Oct 28, 2024 at 7:02 AM Ross Burton <[email protected]> wrote: >> >> On 22 Oct 2024, at 07:27, Khem Raj via lists.openembedded.org >> <[email protected]> wrote: >>> find_library API depends on platform to provide ldconfig, ld, gcc, objdump >>> etc, so either we add these dependencies or avoid them by computing the >>> libarchive library name during build, which we can be done. >> >> OH GOD THAT IS HORRIBLE. >> >> "On Linux, find_library() tries to run external programs (/sbin/ldconfig, >> gcc, objdump and ld) to find the library file. It returns the filename of >> the library file.” >> >>> +DEPENDS += "patchelf-native libarchive" >>> +# Avoid using find_library API which needs ldconfig and ld/objdump >>> +# https://docs.python.org/3/library/ctypes.html#ctypes-reference >>> +# >>> +do_configure:append() { >>> + sed -i -e "s|find_library('archive')|'${libdir}/$(patchelf >>> --print-soname ${STAGING_LIBDIR}/libarchive.so)'|" ${S}/libarchive/ffi.py >>> +} >> >> Can we patch the source instead: >> >> -libarchive_path = os.environ.get('LIBARCHIVE') or find_library('archive') >> +libarchive_path = @LIBARCHIVE_SONAME@ > > This would mean we do not respect LIBARCHIVE envvar which is a > documented way of calling > a non-default libarchive.so perhaps we can do > > libarchive_path = os.environ.get('LIBARCHIVE') or @LIBARCHIVE_SONAME@
Yes, that works. Just something that would actually fail to apply instead of silently doing nothing if upstream rewrote the code. Ross
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#206452): https://lists.openembedded.org/g/openembedded-core/message/206452 Mute This Topic: https://lists.openembedded.org/mt/109147889/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
