diff options
| -rw-r--r-- | meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch | 29 | ||||
| -rw-r--r-- | meta/recipes-devtools/python/python3-libarchive-c_5.1.bb | 9 |
2 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch b/meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch new file mode 100644 index 0000000000..7b8775802f --- /dev/null +++ b/meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | From ed20aba335996d3aa97d99dfc122eb5a3a26ba1b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Sat, 2 Nov 2024 11:06:01 -0700 | ||
| 4 | Subject: [PATCH] ffi: Insert a replacable anchor for find_library | ||
| 5 | |||
| 6 | @@REPLACE_FIND_LIBRARY_API@@ must be sustituted from bitbake environment via | ||
| 7 | recipe. This also helps in detecting changes to code from upstream in | ||
| 8 | this area as this patch will fail to apply. | ||
| 9 | |||
| 10 | Upstream-Status: Inappropriate [OE-Specific] | ||
| 11 | |||
| 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 13 | --- | ||
| 14 | libarchive/ffi.py | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/libarchive/ffi.py b/libarchive/ffi.py | ||
| 18 | index 1fc321a..991f1b6 100644 | ||
| 19 | --- a/libarchive/ffi.py | ||
| 20 | +++ b/libarchive/ffi.py | ||
| 21 | @@ -22,7 +22,7 @@ logger = logging.getLogger('libarchive') | ||
| 22 | |||
| 23 | page_size = mmap.PAGESIZE | ||
| 24 | |||
| 25 | -libarchive_path = os.environ.get('LIBARCHIVE') or find_library('archive') | ||
| 26 | +libarchive_path = os.environ.get('LIBARCHIVE') or @@REPLACE_FIND_LIBRARY_API@@ | ||
| 27 | libarchive = ctypes.cdll.LoadLibrary(libarchive_path) | ||
| 28 | |||
| 29 | |||
diff --git a/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb b/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb index 3116c6b62e..333831c4b6 100644 --- a/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb +++ b/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb | |||
| @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.md;md5=bcab380227a83bc147350b40a81e6ffc" | |||
| 7 | 7 | ||
| 8 | SRC_URI += " \ | 8 | SRC_URI += " \ |
| 9 | file://new-libarchive.patch \ | 9 | file://new-libarchive.patch \ |
| 10 | file://0001-ffi-Insert-a-replacable-anchor-for-find_library.patch \ | ||
| 10 | file://run-ptest \ | 11 | file://run-ptest \ |
| 11 | " | 12 | " |
| 12 | 13 | ||
| @@ -16,6 +17,14 @@ inherit pypi setuptools3 ptest | |||
| 16 | 17 | ||
| 17 | SRC_URI[sha256sum] = "7bcce24ea6c0fa3bc62468476c6d2f6264156db2f04878a372027c10615a2721" | 18 | SRC_URI[sha256sum] = "7bcce24ea6c0fa3bc62468476c6d2f6264156db2f04878a372027c10615a2721" |
| 18 | 19 | ||
| 20 | DEPENDS += "patchelf-native libarchive" | ||
| 21 | # Avoid using find_library API which needs ldconfig and ld/objdump | ||
| 22 | # https://docs.python.org/3/library/ctypes.html#ctypes-reference | ||
| 23 | # | ||
| 24 | do_configure:append() { | ||
| 25 | sed -i -e "s|@@REPLACE_FIND_LIBRARY_API@@|'${libdir}/$(patchelf --print-soname ${STAGING_LIBDIR}/libarchive.so)'|" ${S}/libarchive/ffi.py | ||
| 26 | } | ||
| 27 | |||
| 19 | RDEPENDS:${PN} += "\ | 28 | RDEPENDS:${PN} += "\ |
| 20 | libarchive \ | 29 | libarchive \ |
| 21 | python3-ctypes \ | 30 | python3-ctypes \ |
