mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-01-03 10:06:01 +01:00
Fix portability issue with sed on MacOS
This commit is contained in:
parent
213e51f606
commit
550cc73603
@ -32,9 +32,14 @@ cp ${INCLUDIR}/trexio.h ${PYDIR}/src
|
|||||||
# fix needed to define HAVE_HDF5 symbol so that Python extension is always compiled with HDF5 (without including config.h)
|
# fix needed to define HAVE_HDF5 symbol so that Python extension is always compiled with HDF5 (without including config.h)
|
||||||
# add "#define HAVE_HDF5 1" line after "#include stdint.h" using awk and sed
|
# add "#define HAVE_HDF5 1" line after "#include stdint.h" using awk and sed
|
||||||
export LINE_NO=$(($(awk '/stdint.h/{print NR}' ${PYDIR}/src/trexio.h) + 1))
|
export LINE_NO=$(($(awk '/stdint.h/{print NR}' ${PYDIR}/src/trexio.h) + 1))
|
||||||
|
# sed on MacOS is different from GNU sed on Linux and requires special treatment
|
||||||
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
sed -i '' -e "$LINE_NO"'i \
|
sed -i '' -e "$LINE_NO"'i \
|
||||||
#define HAVE_HDF5 1
|
#define HAVE_HDF5 1' "${PYDIR}/src/trexio.h"
|
||||||
' -- ${PYDIR}/src/trexio.h
|
else
|
||||||
|
sed -i -e "$LINE_NO"'i \
|
||||||
|
#define HAVE_HDF5 1' "${PYDIR}/src/trexio.h"
|
||||||
|
fi
|
||||||
|
|
||||||
# Copy additional info
|
# Copy additional info
|
||||||
cp ${TREXIO_ROOT}/AUTHORS ${TREXIO_ROOT}/LICENSE ${PYDIR}
|
cp ${TREXIO_ROOT}/AUTHORS ${TREXIO_ROOT}/LICENSE ${PYDIR}
|
||||||
|
Loading…
Reference in New Issue
Block a user