aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2017-10-27 16:51:27 +0200
committerRobert Griebl <robert.griebl@pelagicore.com>2017-10-27 14:58:24 +0000
commitc73c0c23d582262d9579b5c511fe90be30fc56cc (patch)
treeccc867471ea83ce059f4624d5bea6447ba296883
parentf4d2f7ccaa743eac5cda9daa3750a2ae4ddb87cb (diff)
ivigenerator: Fix the deploy-virtualenv.sh to create usable virtualenvs
On some systems libpython needs to be copied into the virtualenv to make the python executable work. As we can't change the rpath easily we need to use LD_LIBRARY_PATH in the qmake integration to make the system find the correct lib. The script now also copies the needed libcrypto.so and libssl.so from the system to the virtualenv as they are needed by the hashlib module Change-Id: Ib7911f6d69c743892397581f91991ef415321aa3 Reviewed-by: Robert Griebl <robert.griebl@pelagicore.com>
-rw-r--r--mkspecs/features/ivigenerator.prf8
-rwxr-xr-xsrc/tools/ivigenerator/deploy-virtualenv.sh17
2 files changed, 21 insertions, 4 deletions
diff --git a/mkspecs/features/ivigenerator.prf b/mkspecs/features/ivigenerator.prf
index b4f291d..b65b34f 100644
--- a/mkspecs/features/ivigenerator.prf
+++ b/mkspecs/features/ivigenerator.prf
@@ -49,8 +49,12 @@ QTEST_ENVIRONMENT = $$upper($$(QTEST_ENVIRONMENT))
else: ENV += IVIGENERATOR_CONFIG="$$shell_path($$QTIVI_BUILD_ROOT/src/tools/ivigenerator/.config)"
}
-equals(QMAKE_HOST.os, Windows): VIRTUALENV_PYTHON = $$VIRTUALENV_PATH/Scripts/python.exe
-else: VIRTUALENV_PYTHON = $$VIRTUALENV_PATH/bin/python
+equals(QMAKE_HOST.os, Windows) {
+ VIRTUALENV_PYTHON = $$VIRTUALENV_PATH/Scripts/python.exe
+} else {
+ VIRTUALENV_PYTHON = $$VIRTUALENV_PATH/bin/python
+ ENV += LD_LIBRARY_PATH="$$shell_path($$VIRTUALENV_PATH/bin)"
+}
IVI_GENERATOR = $$VIRTUALENV_PYTHON $$IVI_GENERATOR_PATH/generate.py
# TODO make this work with multiple input files, or only support one QFACE_SOURCE
diff --git a/src/tools/ivigenerator/deploy-virtualenv.sh b/src/tools/ivigenerator/deploy-virtualenv.sh
index 5d076e5..41b9a07 100755
--- a/src/tools/ivigenerator/deploy-virtualenv.sh
+++ b/src/tools/ivigenerator/deploy-virtualenv.sh
@@ -58,8 +58,7 @@ fi
LIBPYTHON=`ldd $VIRTUALENV/bin/python | awk '{print $3}' | grep python`
if [[ -e "$LIBPYTHON" ]] ; then
echo "copying $LIBPYTHON"
- cp -Lf "$LIBPYTHON" "$LIB_FOLDER/"
- echo "export LD_LIBRARY_PATH=`readlink -e $LIB_FOLDER/`" >> $VIRTUALENV/bin/activate
+ cp -Lf "$LIBPYTHON" "$VIRTUALENV/bin"
fi
# Find all the locations used for the system python files
@@ -82,6 +81,20 @@ for ORIG_LIB in ${ORIG_LIBS} ; do
done
done
+# random.py is needed in order to generate temp directories from python
+# It is based on hashlib, which needs libcrypto and libssl to work.
+# As there is no compatibility for openssl libs, we need to copy
+# them to the bin folder similar to libpython
+HASHLIB=`find $LIB_FOLDER/lib-dynload -iname '_hashlib*'`
+if [[ -e "$HASHLIB" ]] ; then
+ LIBCRYPTO=`ldd $HASHLIB | awk '{print $3}' | grep crypto`
+ echo "copying $LIBCRYPTO"
+ cp -Lf "$LIBCRYPTO" "$VIRTUALENV/bin"
+ LIBSSL=`ldd $HASHLIB | awk '{print $3}' | grep ssl`
+ echo "copying $LIBSSL"
+ cp -Lf "$LIBSSL" "$VIRTUALENV/bin"
+fi
+
if [ "$(readlink -- "$VIRTUALENV/lib64")" != "lib" ] ; then
rm -f "$VIRTUALENV/lib64"
cd "$VIRTUALENV"