From 32c9bf2f08b841d266b7ceb6bd2d452600c9e4ab Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 10 Jan 2023 14:00:03 +0100 Subject: [PATCH] Fix numpy compilation issue on Fedora 36 & 37 for embedded numpy --- products/compil_scripts/numpy-1.22.2.sh | 21 ++++++++++---------- products/patches/SPNS-29988-numpy-1.22.patch | 4 ++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/products/compil_scripts/numpy-1.22.2.sh b/products/compil_scripts/numpy-1.22.2.sh index 3e8e7ae..05e370a 100755 --- a/products/compil_scripts/numpy-1.22.2.sh +++ b/products/compil_scripts/numpy-1.22.2.sh @@ -27,8 +27,7 @@ PYTHONPATH=${NUMPY_INSTALL}:${PYTHONPATH} echo echo "*** setup.py build install" $PYTHONBIN setup.py build install --prefix=${PRODUCT_INSTALL} --install-lib=${NUMPY_INSTALL} -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo "ERROR on setup build install" rm -f site.cfg exit 1 @@ -42,16 +41,16 @@ if [ -f numpy/_version.py ]; then else f=$(find . -type d -name "numpy-$VERSION-py${PYTHON_VERSION}-*x86_64.egg") if [ $? -eq 0 ]; then - EGG_DIR=$(ls numpy-$VERSION-py${PYTHON_VERSION}-*-x86_64.egg) - echo "INFO: Found $EGG_DIR" - if [ ! -d $EGG_DIR/numpy ]; then - ln -sf $EGG_DIR/numpy - sed -i "s/0+unknown/$VERSION/g" $EGG_DIR/numpy/_version.py - else - echo "WARNING: could not find $EGG_DIR/numpy" - fi + EGG_DIR=$(ls |grep numpy-$VERSION-py${PYTHON_VERSION} |grep x86_64.egg) + echo "INFO: Found $EGG_DIR" + if [ -d $EGG_DIR/numpy ]; then + ln -sf $EGG_DIR/numpy + sed -i "s/0+unknown/$VERSION/g" $EGG_DIR/numpy/_version.py + else + echo "WARNING: could not find $EGG_DIR/numpy" + fi else - echo "WARNING: could not find egg directory with name: numpy-$VERSION-py${PYTHON_VERSION}-*-x86_64.egg" + echo "WARNING: could not find egg directory with name: numpy-$VERSION-py${PYTHON_VERSION}-*-x86_64.egg" fi fi diff --git a/products/patches/SPNS-29988-numpy-1.22.patch b/products/patches/SPNS-29988-numpy-1.22.patch index 05860ca..ead2ad4 100644 --- a/products/patches/SPNS-29988-numpy-1.22.patch +++ b/products/patches/SPNS-29988-numpy-1.22.patch @@ -17,7 +17,7 @@ diff -Naur numpy-1.22.2_ref/setup.py numpy-1.22.2_dev/setup.py if verbose: print("no suitable tags, using unknown + full revision id") - return {"version": "0+unknown", -+ return {"version": "1.22.0", ++ return {"version": "1.22.2", "full-revisionid": keywords["full"].strip(), "dirty": False, "error": "no suitable tags", "date": None} @@ -26,7 +26,7 @@ diff -Naur numpy-1.22.2_ref/setup.py numpy-1.22.2_dev/setup.py print("unable to compute version") - return {"version": "0+unknown", "full-revisionid": None, -+ return {"version": "1.22.0", "full-revisionid": None, ++ return {"version": "1.22.2", "full-revisionid": None, "dirty": None, "error": "unable to compute version", "date": None} -- 2.39.2