- 使用指南
- 数字绘画基础知识
- 参考手册
- 实例教程
- 常见问题解答
- 参与者手册
- 扩展包和第三方教程
- 其他
- 显示设置
- 日志查看器
- 数位板设置
- 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
- 渐变
- 多维网格
- 图案
- 网点
- 单纯形法噪点
Working on Krita Dependencies
Sometimes it happens that you need to patch/fix some of Krita dependencies. In this case you have to build your own version of the dependency instead of using the prebuilt package.
This manual describes the build process for the Linux host system using the docker environment. The process of building deps on Windows, MacOS and Android is almost the same. If the command differs on other systems, you will see a note about that inline. If you are not familiar with the docker-based build process, please check the docker environment manual: Building Krita with Docker on Linux
警告
Buillding the Linux deps on the host system without the docker environment is not supported and is not going to be supported. It is almost impossible to do.
Building the Android deps on the host system without using docker is possible, but still not supported. You will need to consult the Dockerfile for Kirta’s Android builder image to set up proper versions of the deps.
Building and modifying a single dependency
Prerequisites
The manual expects that you do already have a working docker environment with the prebuild deps installed. See Building Krita with Docker for details.
Setting up folders
First you need to set up folders structure, initialize Python’s virtual environment and install python modules into that:
mkdir /home/appimage/appimage-workspace/root cd /home/appimage/appimage-workspace/root git clone https://invent.kde.org/dkazakov/krita-deps-management.git git clone https://invent.kde.org/dkazakov/ci-utilities.git krita-deps-management/ci-utilities python3 -m venv PythonEnv source ./PythonEnv/bin/activate pip install -r krita-deps-management/requirements.txt
If you used prebuilt deps, you might want to reuse the packages cache from the host system. Just create a symlink for it:
ln -s ~/persistent/deps/cache /home/appimage/appimage-workspace/root/cache
Setting up the environement
Now you need to create the development environment:
python krita-deps-management/tools/setup-env.py -r ./ -v PythonEnv/ -s /home/appimage/appimage-workspace/deps/usr
This line sets the environment scripts in the current folder (-r ./
) and configures the “shared install folder” to coincide with the folder where prebuilt deps are preinstalled by the container initialization scripts (-s /home/appimage/appimage-workspace/deps/usr
)
备注
If you are setting up the Android environment, pass --android-abi <targe-arg>
option to this script (where <target-arg>
is one of x86_64
, armeabi-v7a
or arm64-v8a
)
The script has generated an environment file for you. Just source it now:
source /home/appimage/appimage-workspace/root/base-env
Next time you enter the docker container, just repeat this “source” line and it will activate the environment for you.
If you are developing for Android or MacOS, you should also set up the toolchain file for the build:
# for Android export KDECI_EXTRA_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=/home/appimage/appimage-workspace/root/krita-deps-management/tools/android-toolchain.cmake" # for MacOS export KDECI_EXTRA_CMAKE_ARGS="-DCMAKE_TOOLCHAIN_FILE=/home/appimage/appimage-workspace/root/krita-deps-management/tools/macos-toolchain.cmake"
You should manually set this variable every time you enter the container. It is neceesary because the toolchain file for building Krita itself differs. If you need to build Krita in the same environment, you should change the toolchain file name to the one with “-krita” suffix, i.e. android-toolchain-krita.cmake
Building the dependency
To build a single dependency, just enter its subfolder and issue the build command:
cd krita-deps-management/ext_qt/ python -u ../ci-utilities/run-ci-build.py --project ext_qt --branch master --platform Linux -e env --skip-dependencies-fetch
Make sure you change the “project” and “platform” arguments of the command. You can try replacing --project ext_qt
with --project $(basename $(pwd))
if you are on Linux.
The possible strings for “platform” option are:
Linux
Windows
MacOS
Android/x86_64
Android/armeabi-v7a
Android/arm64-v8a
The script will (hopefully) build the dependency for you and leave you two files in the dependency subfolder:
krita-deps-management/ext_qt/env
krita-deps-management/ext_qt/env_deactivate
You can source the first file to activate environment for building this very subproject. When switching to another subproject, don’t forget to deactivate the environment with the second script.
备注
Sourcing env
and base-env
scripts will also set up two special variables for you that will help you determine which environment you are in:
KDECI_ENV_ACTIVATION_SCRIPT
KDECI_ENV_DEACTIVATION_SCRIPT
Hence, to deactivate the current environement you can just call:
source $KDECI_ENV_DEACTIVATION_SCRIPT
After the project is built at least once, you can edit its sources and do incremental rebuilds manually :
cd krita-deps-management/ext_qt # activate the environment source ./env # go to the sources directory pushd _build/ext_qt-prefix/src/ext_qt ## ... patch the sources as much as you need ... # go to the build directory popd pushd _build/ext_qt-prefix/src/ext_qt-build # build and install the project as usual make -j8 install # on Windows and MacOS you might need to use # Ninja instead: ## ninja -j8 install # after the work is done, deactivate the per-project environment source ./env_deactivate # alternatively, use the environment variable for that # source $KDECI_ENV_DEACTIVATION_SCRIPT
Building all packages in isolated environments
When testing dependency build scripts you might need to test if each package can be built independently in an isolated encironment. In such a case, the “shared install folder” method will not work. Instead, you needs to use “publish to cache” method. With this method, each subproject is built in an isolated environment, with only minimally necessary depenencies present. Each subproject is then packaged and “uploaded” into the package cache. By the end of the build process the local cache is “forcefully” populated with the locally built packages, which are newer than the ones in the registry. These local packages will later be used for building Krita itself.
This method works almost the same as the previous one, with a few minor differences.
Firstly, you need to skip installing the prebuilt dependencies when building the docker image. To do that, pass -s
(or --skip-deps
) option to build_image
script:
./bin/build-image -s
This will create a container image without any prebuilt deps installed.
Then run the container and follow the folders setup process as described above in Setting up folders section.
When folders are set up, generate the envidonment without the -s
option. It will disable the “shared install feature”:
python krita-deps-management/tools/setup-env.py -r ./ -v PythonEnv/ source /home/appimage/appimage-workspace/root/base-env
备注
If you are setting up the Android environment, don’t forget to pass --android-abi <targe-arg>
option to the script (where <target-arg>
is one of x86_64
, armeabi-v7a
or arm64-v8a
)
Set up KDECI_EXTRA_CMAKE_ARGS
if you are on MacOS or Android.
Make sure your pacakges cache is clean:
rm -rf /home/appimage/appimage-workspace/root/cache/*.{tar,json}
Run the build of all the packages:
cd krita-deps-management python -u ../ci-utilities/seed-package-registry.py --platform Linux --seed-file latest/krita-deps.yml --publish-to-cache --missing-only
If some build has failed, fix it and then just rerun this command. Thanks to --missing-only
the script will skip the subprojects that has been successfully built.
When the build process fails, you can manually rebuild the failing project by running run-ci-build.py
script manually in the corresponding folder.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论