Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b91b70d4 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Update docker build scripts

parent 88d97c3f
......@@ -18,22 +18,23 @@ developers already have al least one clone of Krita source tree).
./bin/bootstrap-deps.sh
# mount/copy/chechout Krita sources to 'persistent/krita'
mkdir -p persistent/krita
sudo mount --bind ../../ ./persistent/krita
cp -r /path/to/sources/krita ./persistent/krita
```
## Build the docker image and run the container
```bash
./bin/build_image krita-deps
./bin/run_container krita-deps krita-build
./bin/run_container krita-deps krita-master
```
## Enter the container and build Krita
```bash
# enter the docker container
./bin/enter_container krita-build
# enter the docker container (the name will be
# fetched automatically from '.container_name' file)
./bin/enter
# ... now your are inside the container with all the deps prepared ...
......@@ -49,27 +50,20 @@ krita
## Extra developer tools
If you want to develop Krita, you might want to install at least some
developer tools into the container, e.g. GDB, Valgring, ccmake and QtCreator.
To do that, execute the following from yout **host** console:
To install QtCreator, enter container and start the installer, downloaded while
fetching dependencies. Make sure you install it into '~/qtcreator' directory
without any version suffixes, then you will be able to use the script below:
```bash
sudo docker exec -ti -u root krita-build apt install gdb
sudo docker exec -ti -u root krita-build apt install valgrind
sudo docker exec -ti -u root krita-build apt install cmake-curses-gui
# inside the container
cd ~/persistent
wget http://master.qt.io/archive/online_installers/3.0/qt-unified-linux-x64-3.0.4-online.run
./qt-unified-linux-x64-3.0.4-online.run
# when going through the setup wizard select not to install any
# extra Qt libraries, install QtCreator only!
./persistent/qt-creator-opensource-linux-x86_64-4.6.2.run
```
# to start QtCreator without the conflicts to with Krita's Qt paths, type
# in your **host** console:
sudo docker exec -ti krita-build /home/appimage//Qt/Tools/QtCreator/bin/qtcreator
To start QtCreator:
```bash
# from the host
./bin/qtcreator
```
## Stopping the container and cleaning up
......@@ -79,14 +73,18 @@ all the currently running processes are killed (just ensure you logout from all
terminals before stopping).
```bash
sudo docker stop krita-build
# stop the container
./bin/stop
# start the container
./bin/start
```
If you don't need your container/image anymore, you can delete them from the docker
```bash
# remove the container
sudo docker rm krita-build
sudo docker rm krita-master
# remove the image
sudo docker rmi krita-deps
......
......@@ -11,3 +11,13 @@ if [ ! -f ./persistent/krita-appimage-deps.tar ]; then
)
fi
creator_major=4.6
creator_minor=2
creator_file=qt-creator-opensource-linux-x86_64-${creator_major}.${creator_minor}.run
if [ ! -f ./persistent/${creator_file} ]; then
(
cd ./persistent/
wget http://download.qt.io/official_releases/qtcreator/${creator_major}/${creator_major}.${creator_minor}/${creator_file} || exit 1
chmod a+x ${creator_file}
)
fi
#!/bin/bash
if [ -d ./persistent/krita ]; then
for i in 'bin default-home'; do
if [ ! -d $i ]
mkdir $i
fi
done
cp persistent/krita/build-tools/docker/bin/* ./bin/
cp persistent/krita/build-tools/docker/default-home/* ./default-home/
cp persistent/krita/build-tools/docker/Dockerfile ./
cp persistent/krita/build-tools/docker/README.md ./
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -ti ${container_name} sh -c "cd /home/appimage && /bin/bash -l"
#!/bin/bash
function findContainerName {
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
container_file=`${DIR}/find_up ./ -name .container_name`
if [ ! -z ${container_file} ]; then
cat ${container_file}
fi
}
function parseContainerArgs {
container_name=
if [ "$#" -ne 1 ]; then
if [ "$#" -eq 0 ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
container_name=$(findContainerName)
fi
if [ -z ${container_name} ]; then
echo "Usage: $0 CONTAINER_NAME" >&2
exit 1
fi
else
container_name=$1
fi
echo ${container_name}
}
#!/bin/bash
set -e
path="$1"
shift 1
while [[ $path != / ]];
do
find "$path" -maxdepth 1 -mindepth 1 "$@"
# Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)"
path="$(readlink -f "$path"/..)"
done
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
if [ ! -e /proc/driver/nvidia/version ]; then
echo "Cannot find NVIDIA bestion file: /proc/driver/nvidia/version"
exit 1
fi
nvidia_version=$(cat /proc/driver/nvidia/version | head -n 1 | awk '{ print $8 }')
driver_file=NVIDIA-Linux-x86_64-${nvidia_version}.run
driver_url=http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_version}/${driver_file}
if [ ! -f persistent/${driver_file} ]; then
(
cd persistent
wget http://download.nvidia.com/XFree86/Linux-x86_64/${nvidia_version}/${driver_file} || exit 1
chmod a+x ${driver_file}
)
fi
if [ -f persistent/${driver_file} ]; then
sudo docker exec -ti -u root ${container_name} /home/appimage/persistent/${driver_file} -a -N --ui=none --no-kernel-module -s
else
echo "Cannot find the driver file: ${driver_file}"
exit 1
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -ti ${container_name} /bin/bash -c 'source /home/appimage/devenv.inc; /home/appimage/qtcreator/bin/qtcreator.sh'
......@@ -5,6 +5,11 @@ if [ "$#" -ne 2 ]; then
exit 1
fi
NVIDIA_OPTS=
if [ -e /dev/nvidiactl ]; then
NVIDIA_OPTS+="--device /dev/nvidia0 --device /dev/nvidiactl --device /dev/nvidia-uvm"
fi
sudo docker run -P -t -d \
-v $(pwd)/persistent/:/home/appimage/persistent/:rw \
-v /tmp/.X11-unix/:/tmp/.X11-unix \
......@@ -16,6 +21,11 @@ sudo docker run -P -t -d \
--security-opt seccomp=unconfined \
--device /dev/dri \
--device /dev/snd \
-p127.0.0.1:2022:22 \
$NVIDIA_OPTS \
--name $2 \
$1
$1 || exit 1
if [ ! -f .container_name ]; then
echo $2 > .container_name
fi
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker start ${container_name}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker stop ${container_name}
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${DIR}/find_default_container_file.inc
container_name=$(parseContainerArgs $*)
if [ -z ${container_name} ]; then
exit 1
fi
sudo docker exec -user root -ti ${container_name} sh -c "cd /home/appimage && /bin/bash -l"
......@@ -21,6 +21,6 @@ prepend PKG_CONFIG_PATH $DEPSDIR/lib/pkgconfig
prepend CMAKE_PREFIX_PATH $DEPSDIR
#prepend PYTHONPATH $DEPSDIR/lib/python3.5/
#prepend PYTHONPATH $DEPSDIR/sip
prepend PYTHONPATH $DEPSDIR/sip
#prepend PYQT_SIP_DIR_OVERRIDE $DEPSDIR/share/sip
......@@ -4,5 +4,5 @@ cmake -DCMAKE_INSTALL_PREFIX=${KRITADIR} \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING=TRUE \
-DHIDE_SAFE_ASSERTS=FALSE \
-DPYQT_SIP_DIR_OVERRIDE=~/appimage-workspace/deps/usr/share/sip
-DPYQT_SIP_DIR_OVERRIDE=~/appimage-workspace/deps/usr/share/sip \
$@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment