diff --git a/.gitignore b/.gitignore index d08c4c7..076d83b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /demo/rust/Cargo.lock /demo/rust/target/ +/docker_home/ /tests/rust_*/Cargo.lock /tests/rust_*/target/ diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..1c8dc38 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,26 @@ +# Dockerfile for a development environment for rust_qt_binding_generator +FROM kdeneon/plasma:dev-stable + +USER root + +RUN apt-get update && apt-get dist-upgrade -y + +# build dependencies and many extra qml modules +RUN apt-get install -y --no-install-recommends \ + qtcreator rustc cargo ninja-build cmake g++ extra-cmake-modules \ + kdesdk-scripts \ + qtdeclarative5-dev-tools qtdeclarative5-dev qtquickcontrols2-5-dev \ + libqt5charts5-dev libqt5svg5-dev \ + qtdeclarative5-render2d-plugin \ + qt5-doc qtbase5-doc qtcharts5-doc qtcreator-doc qtquickcontrols2-5-doc \ + qtquickcontrols5-doc qtsvg5-doc qttools5-doc + +RUN apt-get install -y --no-install-recommends \ + qtquickcontrols2-5-examples + +# these are extra +# RUN apt-get install -y --no-install-recommends qbs-doc qml-module-org-kde-activities qml-module-org-kde-analitza qml-module-org-kde-bluezqt qml-module-org-kde-draganddrop qml-module-org-kde-extensionplugin qml-module-org-kde-games-core qml-module-org-kde-kaccounts qml-module-org-kde-kconfig qml-module-org-kde-kcoreaddons qml-module-org-kde-kholidays qml-module-org-kde-kio qml-module-org-kde-kirigami qml-module-org-kde-kirigami2 qml-module-org-kde-kquickcontrols qml-module-org-kde-kquickcontrolsaddons qml-module-org-kde-kwindowsystem qml-module-org-kde-newstuff qml-module-org-kde-people qml-module-org-kde-purpose qml-module-org-kde-runnermodel qml-module-org-kde-solid qml-module-org-kde-telepathy qml-module-qt-labs-calendar qml-module-qt-labs-folderlistmodel qml-module-qt-labs-platform qml-module-qt-labs-settings qml-module-qt-labs-sharedimage qml-module-qt-websockets qml-module-qt3d qml-module-qtaudioengine qml-module-qtbluetooth qml-module-qtcharts qml-module-qtfeedback qml-module-qtgraphicaleffects qml-module-qtgstreamer qml-module-qtlocation qml-module-qtmultimedia qml-module-qtnfc qml-module-qtpositioning qml-module-qtpurchasing qml-module-qtqml-models2 qml-module-qtqml-statemachine qml-module-qtquick-controls qml-module-qtquick-controls-styles-breeze qml-module-qtquick-controls2 qml-module-qtquick-dialogs qml-module-qtquick-extras qml-module-qtquick-layouts qml-module-qtquick-localstorage qml-module-qtquick-particles2 qml-module-qtquick-privatewidgets qml-module-qtquick-scene2d qml-module-qtquick-scene3d qml-module-qtquick-sharedimage qml-module-qtquick-templates2 qml-module-qtquick-virtualkeyboard qml-module-qtquick-window2 qml-module-qtquick-xmllistmodel qml-module-qtquick2 qml-module-qtsensors qml-module-qtsysteminfo qml-module-qttest qml-module-qtwayland-compositor qml-module-qtwebchannel qml-module-qtwebengine qml-module-qtwebkit qml-module-qtwebsockets qml-module-qtwebview qt-at-spi-doc qt3d5-doc qtconnectivity5-doc qtgraphicaleffects5-doc qtgstreamer-doc qtiplot-doc qtlocation5-doc qtmultimedia5-doc qtnetworkauth5-doc qtpim5-doc qtpositioning5-doc qtscript5-doc qtsensors5-doc qtserialport5-doc qtspeech5-doc qtwayland5-doc qtwebchannel-doc qtwebchannel5-doc qtwebengine5-doc qtwebkit5-doc qtwebkit5-examples-doc qtwebsockets5-doc qtwebview5-doc qtx11extras5-doc qtxmlpatterns5-doc + +USER neon + +CMD ["/bin/bash", "-l"] diff --git a/docker/docker-bash-session.sh b/docker/docker-bash-session.sh new file mode 100755 index 0000000..df86729 --- /dev/null +++ b/docker/docker-bash-session.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# exit on first error +set -o errexit +# exit when undefined var is used +set -o nounset +# exit with error code of right-most command in a pipe +set -o pipefail + +# This script opens a bash session in docker for the Dockerfile in this folder. + +readonly image_name=rust_qt_binding_generator_dev +readonly docker_file_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +readonly src_dir=$(dirname "$docker_file_dir") +readonly docker_home_dir="$src_dir/docker_home" + +# create the docker image +docker build -t "$image_name" "$docker_file_dir" + +# create a working directory +if [ ! -a "$docker_home_dir" ]; then + mkdir -p "$docker_home_dir"/rust_qt_binding_generator +fi + +# give the docker application access to X +xhost +si:localuser:"$USER" + +# start a docker session with the source code and a dedicated home directory +docker run --rm -v "$docker_home_dir":/home/neon \ + -v "$src_dir":/home/neon/rust_qt_binding_generator \ + -v /tmp/.X11-unix:/tmp/.X11-unix \ + -e DISPLAY="$DISPLAY" \ + -e XDG_CURRENT_DESKTOP="$XDG_CURRENT_DESKTOP" \ + -ti "$image_name" bash + +# --network none \