diff mbox series

[meta-python,6/7] python3-lief: Add recipe

Message ID 20250129114039.3562870-6-leon.anavi@konsulko.com
State Accepted
Headers show
Series [meta-python,1/7] python3-scikit-build-core: Use PYTHON_INCLUDE_DIR | expand

Commit Message

Leon Anavi Jan. 29, 2025, 11:40 a.m. UTC
Add recipe to build the Python API of LIEF (Library to Instrument
Executable Formats). The purpose of this project is to provide a
cross-platform library to parse, modify and abstract ELF, PE and
MachO formats.

Changelog for LIEF release 0.16.2:

- Fix broken aarch64 Python wheel which is related to a toolchain
  issue

This work was sponsored by GOVCERT.LU.

Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
---
 ...equirements.txt-Allow-newer-versions.patch | 39 +++++++++++++++++++
 ...api-python-config-default.toml-Debug.patch | 28 +++++++++++++
 .../python/python3-lief_0.16.2.bb             | 29 ++++++++++++++
 3 files changed, 96 insertions(+)
 create mode 100644 meta-python/recipes-devtools/python/python3-lief/0001-build-requirements.txt-Allow-newer-versions.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-lief/0002-api-python-config-default.toml-Debug.patch
 create mode 100644 meta-python/recipes-devtools/python/python3-lief_0.16.2.bb
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-lief/0001-build-requirements.txt-Allow-newer-versions.patch b/meta-python/recipes-devtools/python/python3-lief/0001-build-requirements.txt-Allow-newer-versions.patch
new file mode 100644
index 0000000000..e2d041dac7
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-lief/0001-build-requirements.txt-Allow-newer-versions.patch
@@ -0,0 +1,39 @@ 
+From d6686206658aadc74d21a29c781320e2e13fe8f3 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <leon.anavi@konsulko.com>
+Date: Mon, 27 Jan 2025 17:05:53 +0000
+Subject: [PATCH] build-requirements.txt: Allow newer versions
+
+Allowing building with newer version
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
+---
+ api/python/build-requirements.txt | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/api/python/build-requirements.txt b/api/python/build-requirements.txt
+index 4c9004ca..fe0d1055 100644
+--- a/api/python/build-requirements.txt
++++ b/api/python/build-requirements.txt
+@@ -1,10 +1,10 @@
+-tomli==2.0.1
+-scikit-build-core==0.9.8
++tomli>=2.0.1
++scikit-build-core>=0.9.8
+ # For Ninja: msvc.msvc14_get_vc_env
+-setuptools==70.2.0
++setuptools>=70.2.0
+ # For the "env" feature
+-pydantic==2.8.2
++pydantic>=2.8.2
+ # Implicit from scikit-build-core
+-pathspec==0.12.1
+-build==1.2.1
+-wheel==0.43.0
++pathspec>=0.12.1
++build>=1.2.1
++wheel>=0.43.0
+-- 
+2.39.5
+
diff --git a/meta-python/recipes-devtools/python/python3-lief/0002-api-python-config-default.toml-Debug.patch b/meta-python/recipes-devtools/python/python3-lief/0002-api-python-config-default.toml-Debug.patch
new file mode 100644
index 0000000000..bc38a63726
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-lief/0002-api-python-config-default.toml-Debug.patch
@@ -0,0 +1,28 @@ 
+From 064f361f113e1e4496f40dd0a075f89d21bad5a3 Mon Sep 17 00:00:00 2001
+From: Leon Anavi <leon.anavi@konsulko.com>
+Date: Tue, 28 Jan 2025 12:25:31 +0000
+Subject: [PATCH] api/python/config-default.toml: Debug
+
+Fixes do_package: QA Issue: [already-stripped]
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
+---
+ api/python/config-default.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/api/python/config-default.toml b/api/python/config-default.toml
+index 519bc046..49477864 100644
+--- a/api/python/config-default.toml
++++ b/api/python/config-default.toml
+@@ -1,5 +1,5 @@
+ [lief.build]
+-type          = "Release"
++type          = "Debug"
+ cache         = true
+ ninja         = true
+ parallel-jobs = 0
+-- 
+2.39.5
+
diff --git a/meta-python/recipes-devtools/python/python3-lief_0.16.2.bb b/meta-python/recipes-devtools/python/python3-lief_0.16.2.bb
new file mode 100644
index 0000000000..6cc6e7e5ae
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-lief_0.16.2.bb
@@ -0,0 +1,29 @@ 
+SUMMARY = "Library to instrument executable formats"
+DESCRIPTION = "LIEF: Library to Instrument Executable Formats"
+HOMEPAGE = "https://github.com/lief-project/LIEF"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9ab5db472ff936b441055522f5000547"
+SECTION = "libs"
+
+SRC_URI = " \
+    git://github.com/lief-project/LIEF.git;protocol=https;branch=main \
+    file://0001-build-requirements.txt-Allow-newer-versions.patch \
+    file://0002-api-python-config-default.toml-Debug.patch \
+"
+SRCREV = "d3ad812008fd286322b7085e84136e422b3afea4"
+
+S = "${WORKDIR}/git"
+PEP517_SOURCE_PATH = "${S}/api/python"
+
+inherit python_setuptools_build_meta
+
+DEPENDS += "\
+    python3-scikit-build-native \
+    python3-scikit-build-core-native \
+    python3-tomli-native \
+    python3-pydantic-native \
+    ninja-native \
+    ccache-native \
+"
+
+BBCLASSEXTEND = "native nativesdk"