Update gha-install-ncrystal.sh

This commit is contained in:
Jose Ignacio Marquez Damian 2022-11-28 09:15:45 -03:00 committed by GitHub
parent 3e6bb9d5f6
commit be330a11b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,8 +25,7 @@ cmake \
-DCMAKE_BUILD_TYPE=Release \
-DNCRYSTAL_ENABLE_EXAMPLES=OFF \
-DNCRYSTAL_ENABLE_SETUPSH=OFF \
-DNCRYSTAL_ENABLE_DATA=OFF \
-DNCRYSTAL_SKIP_PYMODINST=ON \
-DNCRYSTAL_ENABLE_DATA=EMBED \
-DCMAKE_INSTALL_PREFIX="${INST_DIR}" \
-DPython3_EXECUTABLE="$PYTHON"
@ -36,30 +35,8 @@ make install
#Note: There is no "make test" or "make ctest" functionality for NCrystal
# yet. If it appears in the future, we should add it here.
#The next stuff is not pretty, but it is needed as a temporary
#workaround until NCrystal add better support for system-wide
#installations in CMake:
cat <<EOF > ./findncrystallib.py
import pathlib
libname = pathlib.Path('./cfg_ncrystal_libname.txt').read_text().strip()
libs = list(pathlib.Path("${INST_DIR}").glob("**/lib*/**/%s"%libname))
assert len(libs)==1
pathlib.Path('ncrystal_liblocation.txt').write_text(str(libs[0]))
EOF
python3 ./findncrystallib.py
TMPNCRYSTALLIBLOCATION=$(cat ./ncrystal_liblocation.txt)
cat <<EOF > ./ncrystal_pypkg/NCrystal/_nclibpath.py
#File autogenerated for working with systemwide install of NCrystal:
import pathlib
liblocation = pathlib.Path('${TMPNCRYSTALLIBLOCATION}'.strip())
EOF
$PYTHON -m pip install ./ncrystal_pypkg/ -vv
eval $( "${INST_DIR}/bin/ncrystal-config --setup" )
# Check installation worked
ncrystal-config --setup