diff --git a/qtcreator/Dockerfile_centos7_qtcreator b/qtcreator/Dockerfile_centos7_qtcreator index 5c3735a..0bd72ef 100644 --- a/qtcreator/Dockerfile_centos7_qtcreator +++ b/qtcreator/Dockerfile_centos7_qtcreator @@ -2,7 +2,8 @@ FROM cos7_base_qt ARG QTCREATOR_VER=v4.15.1 -RUN git clone --recursive https://code.qt.io/qt-creator/qt-creator.git && \ +RUN yum install -y patchelf && \ + git clone --recursive https://code.qt.io/qt-creator/qt-creator.git && \ cd qt-creator && \ git checkout $QTCREATOR_VER && \ mkdir qtcreator_build && cd qtcreator_build && \ diff --git a/qtcreator/qtcreator_post_step.sh b/qtcreator/qtcreator_post_step.sh index 7cde73a..dbeba67 100755 --- a/qtcreator/qtcreator_post_step.sh +++ b/qtcreator/qtcreator_post_step.sh @@ -2,5 +2,32 @@ cp -r --preserve=links /qt-creator/qtcreator_build/lib/qtcreator $WORK_DIR/AppDir/usr/lib/ cp -r --preserve=links /qt-creator/qtcreator_build/share/qtcreator $WORK_DIR/AppDir/usr/share/ +QTCREATOR_PLUGINS_LIB=$WORK_DIR/AppDir/usr/lib/qtcreator/plugins +liste_libs=() +while IFS= read -r -d $'\0'; do + liste_libs+=("$REPLY") +done < <(find $QTCREATOR_PLUGINS_LIB -type f -name *so* -print0) + +cd $QTCREATOR_PLUGINS_LIB +for i in "${liste_libs[@]}"; do + echo $(basename $i) + patchelf --set-rpath '$ORIGIN/../../:$ORIGIN/../' $(basename $i) +done +cd - + +liste_libs=() +QTCREATOR_LIB=$WORK_DIR/AppDir/usr/lib/qtcreator/ +while IFS= read -r -d $'\0'; do + liste_libs+=("$REPLY") +done < <(find $QTCREATOR_LIB -maxdepth 1 -type f -name *so* -print0) + +cd $QTCREATOR_LIB +for i in "${liste_libs[@]}"; do + echo $(basename $i) + patchelf --set-rpath ':$ORIGIN/../' $(basename $i) +done +cd - + + wget https://thomasbriffard.com/public/mon_style_qtcreator.xml -O $WORK_DIR/AppDir/usr/share/qtcreator/styles/onedark_like.xml diff --git a/qtcreator/qtcreator_pre_step.sh b/qtcreator/qtcreator_pre_step.sh index 485bbd2..04180c9 100755 --- a/qtcreator/qtcreator_pre_step.sh +++ b/qtcreator/qtcreator_pre_step.sh @@ -1,18 +1,9 @@ #!/bin/bash -cat << EOF > $WORK_DIR/AppRun -#!/bin/bash -APPDIR=\$(dirname -- "\$0") - -export LD_LIBRARY_PATH=\$APPDIR/usr/lib/:\$LD_LIBRARY_PATH - -exec \$APPDIR/usr/bin/$APP_NOM "\$@" -EOF - fichierIcon=/build/QtProject-qtcreator.svg fichierDesktop=/build/qtcreator.desktop QT_LIB=/qt/$QT_VER/gcc_64/lib/ AUTRES_LIB="-l $QT_LIB/libQt5Help.so.5 -l $QT_LIB/libQt5QuickWidgets.so.5 -l $QT_LIB/libQt5DesignerComponents.so.5" -AUTRES_OPTIONS="-i $fichierIcon -d $fichierDesktop $AUTRES_LIB --custom-apprun $WORK_DIR/AppRun --plugin qt" +AUTRES_OPTIONS="-i $fichierIcon -d $fichierDesktop $AUTRES_LIB --plugin qt"