- 使用指南
- 数字绘画基础知识
- 参考手册
- 实例教程
- 常见问题解答
- 参与者手册
- 扩展包和第三方教程
- 其他
- 显示设置
- 日志查看器
- 数位板设置
- Automated Krita builds on CI matrix
- Brush GUI Design with Lager
- Building Krita from Source
- CMake Settings for Developers
- Enable static analyzer
- How to patch Qt
- Introduction to Hacking Krita
- The Krita Palette format KPL
- Krita SVG Extensions
- Modern C++ usage guidelines for the Krita codebase
- Developing Features
- Optimize Image Processing with XSIMD
- Optimizing tips and tools for Krita
- Google Summer of Code
- Advanced Merge Request Guide
- Python Developer Tools
- Introduction to Quality Assurance
- Making a release
- Reporting Bugs
- Strokes queue
- Testing Strategy
- Triaging Bugs
- Unittests in Krita
- 矢量图层
- 常规设置
- 颜料图层
- 图层组
- 克隆图层
- 文件图层
- 填充图层
- 滤镜图层
- 笔刷引擎
- 透明度蒙版
- 滤镜笔刷引擎
- 滤镜蒙版
- 裁剪工具
- 移动工具
- 变形工具
- 变形笔刷引擎
- 变形蒙版
- 网格与参考线
- 工作区
- 笔刷预设
- 色板
- 键盘快捷键
- 设置菜单
- 性能设置
- 笔尖
- 不透明度和流量
- 常用笔刷选项
- 多路笔刷工具
- 手绘笔刷工具
- 直线工具
- 曲线工具
- 辅助尺工具
- 图层
- 矩形选区工具
- 椭圆选区工具
- 多边形选区工具
- 手绘轮廓选区工具
- 相似颜色选区工具
- 相连颜色选区工具
- 曲线选区工具
- 磁性选区工具
- 形状选择工具
- 锚点编辑工具
- 工具菜单
- 动画时间轴
- 绘图纸外观
- 动画曲线
- 分镜头脚本
- 颜色
- 色域蒙版
- 美术拾色器
- 多功能拾色器
- 智能填色蒙版工具
- *.gih
- 像素笔刷引擎
- *.kra
- SeExpr
- SeExpr 脚本
- 渐变
- 颜色涂抹笔刷引擎
- 纹理
- 拾色器工具
- LUT 色彩管理
- 小型拾色器
- 有损和无损图像压缩
- *.bmp
- *.csv
- *.exr
- *.gbr
- *.gif
- *.heif 和 *.avif
- *.jpg
- *.jxl
- *.kpl
- *.ora
- .pbm、.pgm 和 *.ppm
- *.png
- *.psd
- *.svg
- *.tiff
- *.webp
- 数学运算
- 变暗
- HSX
- 变亮
- 颜色混合
- 负片
- 其他
- 二元逻辑
- 取模运算
- 二次方
- 鬃毛笔刷引擎
- 粉笔笔刷引擎
- 克隆笔刷引擎
- 曲线笔刷引擎
- 力学笔刷引擎
- 网格笔刷引擎
- 排线笔刷引擎
- MyPaint 笔刷引擎
- 粒子轨迹笔刷引擎
- 快速笔刷引擎
- 形状笔刷引擎
- 草图笔刷引擎
- 喷雾笔刷引擎
- 切线空间法线笔刷引擎
- 笔刷选项
- 锁定笔刷选项
- 蒙版笔刷
- 传感器
- 添加形状
- 动画
- 矢量图形排列
- 笔刷预设历史
- 色彩通道
- 颜色滑动条
- 图层显示方案
- 过渡色调混合器
- 直方图
- 导航器
- 图案
- 录像工具
- 参考图像
- 形状属性
- 图像版本快照
- 量化拾色器
- 操作流程
- 触摸屏辅助按钮
- 撤销历史
- 矢量图形库
- 宽色域拾色器
- 调整颜色/图像
- 艺术效果
- 模糊
- 边缘检测
- 浮雕
- 图像增强
- 映射
- 其他
- 小波分解
- 图层样式
- 选区蒙版
- 拆分透明度通道到蒙版
- 编辑菜单
- 文件菜单
- 帮助菜单
- 图像菜单
- 图层菜单
- 选择菜单
- 视图菜单
- 窗口菜单
- 作者档案设置
- 画布快捷键设置
- 隐藏面板模式设置
- 色彩管理设置
- 拾色器设置
- G’Mic 设置
- 弹出面板设置
- Python 插件管理器
- 笔尖
- 笔刷预设
- 图案
- 文字工具
- 渐变编辑工具
- 图案编辑工具
- 西文书法工具
- 矩形工具
- 椭圆工具
- 多边形工具
- 折线工具
- 手绘路径工具
- 力学笔刷工具
- 填充工具
- 闭合填充工具/圈涂
- 渐变工具
- 智能补丁工具
- 参考图像工具
- 测量工具
- 缩放工具
- 平移工具
- Building Krita with Docker on Linux
- Building krita on host Linux system (unsupported)
- Building Krita for Android
- Working on Krita Dependencies
- 渐变
- 多维网格
- 图案
- 网点
- 单纯形法噪点
Building Krita with Docker on Linux
This guide is useful when you are an advanced developer and want to build Krita with the same patched dependencies that are used for the AppImages. If you just want to hack on Krita, read the Build Krita from Source guide.
The Dockerfile is based on the official KDE build environment that is used on KDE CI for building official AppImage packages. This guide is valid for Ubuntu and Ubuntu-based Linux distributions.
Prerequisites
First make sure you have Docker installed
sudo apt install docker docker.io
Decide where you want to store your Docker images. All the docker images and containers are by default stored in a special docker-daemon controlled folder under /var directory. You might not have enough space there for building Krita (it needs about 10 GiB). In such a case it is recommended to move the docker images folder into another location, where there is enough space.
Stop docker service
sudo systemctl stop docker
Edit the config file:
On newer systems, like Ubuntu 18.04 and higher you need to open file /etc/docker/daemon.json and add the following json config options:
{ "data-root" : "/path/where/you/want/to/store/docker/images/" }
If you have older version of Ubuntu, e.g. Ubuntu 16.04, then you need to do the following:
echo 'DOCKER_OPTS="-g /path/where/you/want/to/store/docker/images/"' >> /etc/default/docker
Restart the docker service
sudo systemctl start docker
Second, make sure that you have python3 and python3-venv packages installed:
sudo apt install python3 python3-venv
python3-venv
package is used for bootstrapping the dependencies on the host system before building the docker image, so you need to have it preinstalled.
Downloading Krita sources
Then you need to download deps and Krita source tree. These steps are not included into the Dockerfile to save internal bandwidth
# create directory structure for container control directory git clone https://invent.kde.org/dkazakov/krita-docker-env krita-auto-1 cd krita-auto-1 mkdir persistent # copy/checkout Krita sources to 'persistent/krita' cp -r /path/to/sources/krita ./persistent/krita ## or ... # git clone kde:krita persistent/krita # "kde:krita" should be replaced with a link for cloning the repository, # such as "git@invent.kde.org:graphics/krita.git".
Downloading prebuilt Krita dependencies
# download the deps archive ./bin/bootstrap-deps.sh
备注
If you want to build and ASAN-capable build of Krita, then you should make sure that this script installs an ASAN-capable version of Qt. To do that, declare an environment variable on your host before bootstrapping the deps:
export KDECI_PACKAGE_ALIASES_YAML='{ ext_qt : ext_qt-asan }'
If you don’t want ASAN-capable, but just a debug-capable build of Qt, then change this variable to:
export KDECI_PACKAGE_ALIASES_YAML='{ ext_qt : ext_qt-debug }'
Build the docker image and run the container
./bin/build_image ./bin/run_container
Cleanup the dependencies
The dependencies are cached in ~/persistent/deps/
folder. It may occupy up to 4.7 GiB. If you happen to have problems with space, make sure you removed all the cached checkout:
# clean up about 2.4 GiB of the cached deps checkout rm -rf ./persistent/deps/_install
If you need more space, you can freely remove the entire deps cache (it will be automatically refetched on the next call to ./bin/bootstrap-deps.sh
)
# clean up everything rm -rf ./persistent/deps/
Enter the container and build Krita
# enter the docker container (the name will be # fetched automatically from '.container_name' file) ./bin/enter
… now you are inside the container with all the deps prepared …
# build Krita as usual # you should be in ~/appimage-workspace/krita-build/ ~/bin/run_cmake.sh ~/persistent/krita make -j8 install # start Krita ../krita.appdir/usr/bin/krita
备注
If you need to build an ASAN-capable build of Krita (and you have passed KDECI_PACKAGE_ALIASES_YAML
during the dependencies fetch phase), then pass -DECM_ENABLE_SANITIZERS=address
to CMake as well.
Building AppImage package for your version of Krita
If you want to build a portable package for your version of Krita, just enter the container and type:
~/bin/build_krita_appimage.sh
The built package will be copied to ./persistent/ folder.
By default, the package will be built in release mode. If you want to add debugging information, add –debug option to the command line:
~/bin/build_krita_appimage.sh --debug
Creating a full clone of the container
It is possible to copy the container with the entire environment, sources, build directory and QtCreator installation and configuration. After cloning, no rebuild of Krita is needed!
To copy container to ../krita-auto-2, just type in the host system
./bin/spawn-clone -d ../krita-auto-2
spawn-clone will make an image from the current container and create a new one out of it. This image will be cached for further usages. If you need to flush the cache, pass -f option to spawn-clone:
./bin/spawn-clone -f -d ../krita-auto-2
You can start several instances of spawn-clone on the same container concurrently (e.g. for building multiple merge requests). It has internal locking mechanism for resolving concurrency problems
Testing merge requests using container clones
To quickly build a merge request ‘123’ basing on the current state of the container type in the host system
./bin/spawn-clone -m 123 -be
The script will clone the container, checkout the merge request branch, build it and provide you a terminal for running Krita. The container will be created at ./clones/clone-mr-123 subfolder of the current container.
If you also want to build an AppImage, add –release-appimage option:
./bin/spawn-clone -m 123 --release-appimage -be
AppImage will be places at ./persistent subfolder of the clone. When finished with testing the merge request, you can remove the clone completely by running
./bin/discard-clone /clones/clone-mr-123
You can build multiple merge requests at once!
Updating dependencies in the docker
Sometimes dependencies in Krita change and building Krita or making the AppImage fails. To fix that, you need to update the dependencies.
备注
This method is slow, because you need to rebuild the whole docker, which includes rebuilding whole Krita.
Run those commands in the console in the host system. If you want to update the dependencies in a clone docker, just go to the clone directory where you see bin
and persistent
directories and run those commands there.
# remove old dependencies rm ./persistent/deps/_install # download new deps ./bin/bootstrap-deps.sh # remove the current container ./bin/remove_container # remove the image for the current container docker image remove krita-auto-1 # build image ./bin/build_image # run the container (it will create one) ./bin/run_container
After that you need to build Krita in the docker as usual.
备注
Don’t forget about setting KDECI_PACKAGE_ALIASES_YAML
if you need any special flavour of the Qt library installed.
Extra developer tools
QtCreator is usually installed into the docker image into ~/qtcreator/
folder. The fetching of the prebuilt QtCreator happens when you run ./bin/bootstrap-deps.sh
script. That is, if you skipped installing deps QtCreator will not be installed and you will have to download it manually from this location.
You may also try to dowload the official QtCreator installer from https://download.qt.io/official_releases/qtcreator/. In case you decide to use it, just enter the container and install it. Make sure you install it into ‘~/qtcreator’ directory without any version suffixes, then you will be able to run it directly from the host system using the script below:
# from the host ./bin/qtcreator
Stopping the container and cleaning up
When not in use you can stop the container. All your filesystem state is saved, but all the currently running processes are killed (just ensure you logout from all the terminals before stopping).
# 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
# remove the container sudo docker rm krita-auto-1 # remove the image sudo docker rmi krita-deps
Troubleshooting
Krita binary is not found after the first build
Either relogin to the container or just execute source ~/.devenv.inc
OpenGL doesn’t work on NVidia GPU with proprietary drivers
The docker run script automatically forwards the GPU devices into the container, but it doesn’t install the drivers for the GPU. You should install exactly the same version of the driver that is installed on your host system. Just run the following script when you are on host:
./bin/install_nvidia_drivers.sh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论