diff options
| author | Ross Burton <ross.burton@arm.com> | 2023-05-04 16:22:53 +0100 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2023-05-04 10:23:40 -0700 |
| commit | 15bc6cc2f0206a07c0e896f200fecd2da6145637 (patch) | |
| tree | d7e080bf6d3ecc29f3e88a6b425866e336413617 /meta-python/recipes-devtools/python | |
| parent | 20d63965da15558a17bfc38bd5c151d0353e0315 (diff) | |
| download | meta-openembedded-15bc6cc2f0206a07c0e896f200fecd2da6145637.tar.gz | |
python3-ninja: simplify recipe
Delete more code from __init__.py as we'll never be running from inside
a build tree.
Replace the use of skbuild.setup() with setuptools.setup(): the same
Python module is built and the only value-add is the potential build of
ninja, which we don't want and delete anyway.
This means we can remove most of the DEPENDS and RDEPENDS.
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python/recipes-devtools/python')
3 files changed, 70 insertions, 20 deletions
diff --git a/meta-python/recipes-devtools/python/python3-ninja/no-scikit-build.patch b/meta-python/recipes-devtools/python/python3-ninja/no-scikit-build.patch new file mode 100644 index 0000000000..276fb50172 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-ninja/no-scikit-build.patch | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | We don't need to build ninja so there's no need to use scikit-build, | ||
| 2 | as we just need the python module with it's one ninja() function. | ||
| 3 | |||
| 4 | Upstream-Status: Inappropriate | ||
| 5 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 6 | |||
| 7 | diff --git a/pyproject.toml b/pyproject.toml | ||
| 8 | index b895c20..577b642 100644 | ||
| 9 | --- a/pyproject.toml | ||
| 10 | +++ b/pyproject.toml | ||
| 11 | @@ -1,7 +1,6 @@ | ||
| 12 | [build-system] | ||
| 13 | requires = [ | ||
| 14 | "setuptools>=42", | ||
| 15 | - "scikit-build>=0.12", | ||
| 16 | ] | ||
| 17 | build-backend = "setuptools.build_meta" | ||
| 18 | |||
| 19 | diff --git a/setup.py b/setup.py | ||
| 20 | index dbe1fbc..3259754 100755 | ||
| 21 | --- a/setup.py | ||
| 22 | +++ b/setup.py | ||
| 23 | @@ -5,7 +5,7 @@ import os | ||
| 24 | import sys | ||
| 25 | from distutils.text_file import TextFile | ||
| 26 | |||
| 27 | -from skbuild import setup | ||
| 28 | +from setuptools import setup | ||
| 29 | |||
| 30 | # Add current folder to path | ||
| 31 | # This is required to import versioneer in an isolated pip build | ||
diff --git a/meta-python/recipes-devtools/python/python3-ninja/run-ninja-from-path.patch b/meta-python/recipes-devtools/python/python3-ninja/run-ninja-from-path.patch index 26bd037373..0068efcc3a 100644 --- a/meta-python/recipes-devtools/python/python3-ninja/run-ninja-from-path.patch +++ b/meta-python/recipes-devtools/python/python3-ninja/run-ninja-from-path.patch | |||
| @@ -1,7 +1,40 @@ | |||
| 1 | --- ninja-1.11.1/src/ninja/__init__.py.old 2022-11-05 09:49:23.000000000 +0100 | 1 | There's no need to hunt around source or install trees when we're just running ninja |
| 2 | +++ ninja-1.11.1/src/ninja/__init__.py 2023-03-10 09:45:13.452082888 +0100 | 2 | from PATH. |
| 3 | @@ -44,7 +44,7 @@ | 3 | |
| 4 | Upstream-Status: Inappropriate | ||
| 5 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
| 6 | |||
| 7 | diff --git a/src/ninja/__init__.py b/src/ninja/__init__.py | ||
| 8 | index f83767e..31bb926 100644 | ||
| 9 | --- a/src/ninja/__init__.py | ||
| 10 | +++ b/src/ninja/__init__.py | ||
| 11 | @@ -19,32 +19,9 @@ except ImportError: | ||
| 12 | os.path.dirname(__file__), '../../Ninja-src/misc'))) | ||
| 13 | from ninja_syntax import Writer, escape, expand # noqa: F401 | ||
| 4 | 14 | ||
| 15 | -DATA = os.path.join(os.path.dirname(__file__), 'data') | ||
| 16 | - | ||
| 17 | -# Support running tests from the source tree | ||
| 18 | -if not os.path.exists(DATA): | ||
| 19 | - from skbuild.constants import CMAKE_INSTALL_DIR as SKBUILD_CMAKE_INSTALL_DIR | ||
| 20 | - from skbuild.constants import set_skbuild_plat_name | ||
| 21 | - | ||
| 22 | - if platform.system().lower() == "darwin": | ||
| 23 | - # Since building the project specifying --plat-name or CMAKE_OSX_* variables | ||
| 24 | - # leads to different SKBUILD_DIR, the code below attempt to guess the most | ||
| 25 | - # likely plat-name. | ||
| 26 | - _skbuild_dirs = os.listdir(os.path.join(os.path.dirname(__file__), '..', '..', '_skbuild')) | ||
| 27 | - if _skbuild_dirs: | ||
| 28 | - _likely_plat_name = '-'.join(_skbuild_dirs[0].split('-')[:3]) | ||
| 29 | - set_skbuild_plat_name(_likely_plat_name) | ||
| 30 | - | ||
| 31 | - _data = os.path.abspath(os.path.join( | ||
| 32 | - os.path.dirname(__file__), '..', '..', SKBUILD_CMAKE_INSTALL_DIR(), 'src/ninja/data')) | ||
| 33 | - if os.path.exists(_data): | ||
| 34 | - DATA = _data | ||
| 35 | - | ||
| 36 | -BIN_DIR = os.path.join(DATA, 'bin') | ||
| 37 | - | ||
| 5 | 38 | ||
| 6 | def _program(name, args): | 39 | def _program(name, args): |
| 7 | - return subprocess.call([os.path.join(BIN_DIR, name)] + args, close_fds=False) | 40 | - return subprocess.call([os.path.join(BIN_DIR, name)] + args, close_fds=False) |
diff --git a/meta-python/recipes-devtools/python/python3-ninja_1.11.1.bb b/meta-python/recipes-devtools/python/python3-ninja_1.11.1.bb index 635fd076a5..47a70aa38a 100644 --- a/meta-python/recipes-devtools/python/python3-ninja_1.11.1.bb +++ b/meta-python/recipes-devtools/python/python3-ninja_1.11.1.bb | |||
| @@ -2,33 +2,19 @@ SUMMARY = "Ninja is a small build system with a focus on speed" | |||
| 2 | LICENSE = "Apache-2.0" | 2 | LICENSE = "Apache-2.0" |
| 3 | LIC_FILES_CHKSUM = "file://LICENSE_Apache_20;md5=19cbd64715b51267a47bf3750cc6a8a5" | 3 | LIC_FILES_CHKSUM = "file://LICENSE_Apache_20;md5=19cbd64715b51267a47bf3750cc6a8a5" |
| 4 | 4 | ||
| 5 | DEPENDS = "ninja-native cmake-native python3-scikit-build-native" | ||
| 6 | |||
| 7 | PYPI_PACKAGE = "ninja" | 5 | PYPI_PACKAGE = "ninja" |
| 8 | PYPI_ARCHIVE_NAME_PREFIX = "pypi-" | 6 | PYPI_ARCHIVE_NAME_PREFIX = "pypi-" |
| 9 | 7 | ||
| 10 | inherit pypi python_setuptools_build_meta | 8 | inherit pypi python_setuptools_build_meta |
| 11 | SRC_URI[sha256sum] = "c833a47d39b2d1eee3f9ca886fa1581efd5be6068b82734ac229961ee8748f90" | 9 | SRC_URI[sha256sum] = "c833a47d39b2d1eee3f9ca886fa1581efd5be6068b82734ac229961ee8748f90" |
| 12 | 10 | ||
| 13 | SRC_URI += " \ | 11 | SRC_URI += "file://no-scikit-build.patch \ |
| 14 | file://CMakeLists.txt \ | 12 | file://run-ninja-from-path.patch" |
| 15 | file://run-ninja-from-path.patch \ | ||
| 16 | " | ||
| 17 | |||
| 18 | addtask do_patchbuild after do_patch before do_configure | ||
| 19 | |||
| 20 | do_patchbuild () { | ||
| 21 | rm -f ${S}/CMakeLists.txt | ||
| 22 | cp ${WORKDIR}/CMakeLists.txt ${S}/ | ||
| 23 | } | ||
| 24 | 13 | ||
| 25 | do_install:append () { | 14 | do_install:append () { |
| 26 | rm -rf ${D}${bindir} | 15 | rm -rf ${D}${bindir} |
| 27 | } | 16 | } |
| 28 | 17 | ||
| 29 | RDEPENDS:${PN} = " \ | 18 | RDEPENDS:${PN} = "ninja" |
| 30 | ninja \ | ||
| 31 | python3-scikit-build \ | ||
| 32 | " | ||
| 33 | 19 | ||
| 34 | BBCLASSEXTEND = "native nativesdk" | 20 | BBCLASSEXTEND = "native nativesdk" |
