blob: b5a3c3feea55e8353b6cb147cd537a5a3e5973d7 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
2# Copyright OpenEmbedded Contributors
3#
4# SPDX-License-Identifier: MIT
5#
6
7inherit python_pep517 python3native python3-dir setuptools3-base
8
9DEPENDS += "python3-hatchling-native"
Patrick Williamsb542dec2023-06-09 01:26:37 -050010
11# delete nested, empty directories from the python site-packages path. Make
12# sure that we remove the native ones for target builds as well
13hatchling_rm_emptydirs:class-target () {
14 find ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
15 find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
16}
17
18hatchling_rm_emptydirs:class-native () {
19 find ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/* -depth -type d -empty -delete
20}
21
22# Define a default empty version of hatchling_rm_emptydirs to appease bitbake
23hatchling_rm_emptydirs () {
24 :
25}
26
27do_prepare_recipe_sysroot[postfuncs] += " hatchling_rm_emptydirs"