Create and install a helper script to spawn a development shell
This commit is contained in:
@@ -28,6 +28,7 @@ set (QT_VERSION "qt-everywhere-opensource-src-5.4.2")
|
||||
set (QT_SOURCE_DIR "${CMAKE_BINARY_DIR}/qt-build/qt-everywhere-opensource-src-5.4.2")
|
||||
set (QT_KIT_PREFIX "${CMAKE_BINARY_DIR}/qt-api-build")
|
||||
set (QT_KIT_SOURCE_DIR "${QT_KIT_PREFIX}/qt-everywhere-opensource-src-ubuntu")
|
||||
set (QT_KIT_INSTALL_PREFIX "/usr/ubuntu-sdk-dev")
|
||||
set (QT_BUILD_DIR "${CMAKE_BINARY_DIR}/qt-build/build")
|
||||
set (QT_INSTALL_DIR "${CMAKE_BINARY_DIR}/qt")
|
||||
|
||||
@@ -152,7 +153,7 @@ ExternalProject_Add(${QT_VERSION}-api
|
||||
DOWNLOAD_COMMAND sh -c "cd ${QT_KIT_SOURCE_DIR} && ${CMAKE_SOURCE_DIR}/get_qt_sources.py"
|
||||
UPDATE_COMMAND sh -c "exit 0" #nothing to update
|
||||
PATCH_COMMAND sh -c "cp ${CMAKE_SOURCE_DIR}/desktop_kit_qt.pro ${QT_KIT_SOURCE_DIR}/qt.pro && cp ${CMAKE_SOURCE_DIR}/desktop_kit_configure ${QT_KIT_SOURCE_DIR}/configure"
|
||||
CONFIGURE_COMMAND sh -c "${QT_KIT_SOURCE_DIR}/configure -prefix /usr/ubuntu-sdk-dev `cat ${CMAKE_SOURCE_DIR}/kit_config`"
|
||||
CONFIGURE_COMMAND sh -c "${QT_KIT_SOURCE_DIR}/configure -prefix ${QT_KIT_INSTALL_PREFIX} `cat ${CMAKE_SOURCE_DIR}/kit_config`"
|
||||
BUILD_COMMAND sh -c "make ${GENERATED_MAKE_FLAGS}"
|
||||
INSTALL_COMMAND sh -c "${QT_KIT_INSTALL_SCRIPT}"
|
||||
)
|
||||
@@ -169,3 +170,5 @@ ExternalProject_Add(${QT_VERSION}-extras
|
||||
BUILD_COMMAND sh -c "cp ${EXTRAS_PREFIX}/ubuntu-sdk-qmake-extras/*.prf ${QT_KIT_PREFIX}/qt/usr/ubuntu-sdk-dev/mkspecs/features"
|
||||
INSTALL_COMMAND sh -c "cd ${CMAKE_BINARY_DIR} && ${CMAKE_SOURCE_DIR}/create_sdk.sh"
|
||||
)
|
||||
|
||||
configure_file(${CMAKE_SOURCE_DIR}/ubuntu-sdk-shell.in ${QT_KIT_PREFIX}/qt/usr/ubuntu-sdk-dev/bin/ubuntu-sdk-shell @ONLY)
|
||||
|
||||
42
ubuntu-sdk-shell.in
Executable file
42
ubuntu-sdk-shell.in
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash -i
|
||||
#
|
||||
# Copyright (C) 2015 Canonical Ltd.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation; version 3.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This script spawns a new Bash shell with all the environment variables needed
|
||||
# to run apps based on a specific Ubuntu SDK installation, as well as use the
|
||||
# dev tools from it.
|
||||
|
||||
NAME='ubuntu-sdk-dev'
|
||||
INSTALL_PREFIX='@QT_KIT_INSTALL_PREFIX@'
|
||||
|
||||
export PATH=${INSTALL_PREFIX}/bin${PATH:+:$PATH}
|
||||
export LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
|
||||
export QML2_IMPORT_PATH=${INSTALL_PREFIX}/qml${QML2_IMPORT_PATH:+:$QML2_IMPORT_PATH}
|
||||
export UBUNTU_UI_TOOLKIT_THEMES_PATH=${INSTALL_PREFIX}/qml${UBUNTU_UI_TOOLKIT_THEMES_PATH:+:$UBUNTU_UI_TOOLKIT_THEMES_PATH}
|
||||
export PYTHONPATH=${INSTALL_PREFIX}/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}
|
||||
|
||||
TEMP_FILE=`mktemp -t bashrc.XXXXXXXX`
|
||||
echo source $HOME/.bashrc >> $TEMP_FILE
|
||||
echo PS1=\'[$NAME] $PS1\' >> $TEMP_FILE
|
||||
SHELL_OPTIONS="--init-file $TEMP_FILE"
|
||||
|
||||
echo Entering $NAME shell.
|
||||
bash $SHELL_OPTIONS
|
||||
echo Leaving $NAME shell. Have a nice day!
|
||||
|
||||
if test ! -z "$TEMP_FILE"
|
||||
then
|
||||
rm $TEMP_FILE
|
||||
fi
|
||||
Reference in New Issue
Block a user