package/python-numpy: simplify PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES

The PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES macro was introduced in
commit
2426002d6f ("package/python-numpy: fixup
npymath.ini for numpy extensions").

However, it turns out that by using $(PYTHON3_PATH), we can simplify
the intermediate variables, to the point where they are no longer
needed. Not having the intermediate variables makes the logic a bit
easier to understand.

Also, the logic is changed to use a single sed expression, which we
pass to $(SED).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
This commit is contained in:
Thomas Petazzoni 2022-01-08 00:12:52 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent b1cc6061fd
commit 3093444e9c

View File

@ -40,12 +40,9 @@ endef
# it uses host libraries (like libnpymath.a).
# So, the numpy distutils extension packages would explicitly link this
# config path for their package environment.
PYTHON_NUMPY_STAGING_DIR = $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy
PYTHON_NUMPY_NPY_PKG_CONFIG_PATH=$(PYTHON_NUMPY_STAGING_DIR)/core/lib/npy-pkg-config
define PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES
sed -e '/^pkgdir=/d' \
-e '/^prefix=/i pkgdir=$(PYTHON_NUMPY_STAGING_DIR)/core' \
-i $(PYTHON_NUMPY_NPY_PKG_CONFIG_PATH)/npymath.ini
$(SED) '/^pkgdir=/d;/^prefix=/i pkgdir=$(PYTHON3_PATH)/site-packages/numpy/core' \
$(PYTHON3_PATH)/site-packages/numpy/core/lib/npy-pkg-config/npymath.ini
endef
PYTHON_NUMPY_POST_INSTALL_STAGING_HOOKS += PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES