- 使用指南
- 数字绘画基础知识
- 参考手册
- 实例教程
- 常见问题解答
- 参与者手册
- 扩展包和第三方教程
- 其他
- 显示设置
- 日志查看器
- 数位板设置
- 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 on host Linux system (unsupported)
注意
Building on the host Linux system without docker is now deprecated and considered unsupported. Do that on your own risk!
Preparing your development environment
The most convenient layout is as follows:
$HOME/kritadev/krita – the source code
$HOME/kritadev/build – the location where you compile krita
$HOME/kritadev/install – the location where you install krita to and run krita from
we will call the “kritadev” folder your build root.
Note: type in what’s shown after ‘>’ in the following commands
you@yourcomputer:~>cd you@yourcomputer:~>mkdir kritadev you@yourcomputer:~/>cd kritadev you@yourcomputer:~/kritadev> mkdir build you@yourcomputer:~/kritadev> mkdir install
Getting the Source Code
Open a terminal and enter the build root. Clone Krita from kde’s git infrastructure (not github):
you@yourcomputer:~/kritadev> git clone https://invent.kde.org/graphics/krita.git
Configuring the Build
you@yourcomputer:~/kritadev> cd build
Krita uses cmake (https://cmake.org) to define how Krita is built on various platforms. You first need to run cmake to generate the build system, in the kritadevs/build
directory, then run make to make Krita, then run make install to install krita.
you@yourcomputer:~/kritadev/build>cmake ../krita \ -DCMAKE_INSTALL_PREFIX=$HOME/kritadev/install \ -DCMAKE_BUILD_TYPE=Debug \ -DKRITA_DEVS=ON
Unless you have installed all the dependencies Krita needs, on first running cmake, cmake will complain about missing dependencies. For instance:
-- The following RECOMMENDED packages have not been found: * GSL, <https://www.gnu.org/software/gsl/> Required by Krita's Transform tool.
This is not an error, and you can fix this by installing the missing package using your distribution’s package manager. Do not download these packages manually from the source website and build them manually. Do use your distribution’s package manager to find the right packages.
For example, for Ubuntu, you can start with:
you@yourcomputer:~/kritadev/build>apt-get build-dep krita
Which will install all the dependencies of the version of Krita in the repositories. You might need to enable the deb-src repositories by editing /etc/apt/sources.list (see https://help.ubuntu.com/community/Repositories/CommandLine) or, if you’re using the KDE Plasma desktop, enabling them in the Settings of the Discover application.
However, the development version might use different dependencies, to find these, you can use apt-cache search
:
you@yourcomputer:~/kritadev/build>apt-cache search quazip libquazip-dev - C++ wrapper for ZIP/UNZIP (development files, Qt4 build) libquazip-doc - C++ wrapper for ZIP/UNZIP (documentation) libquazip-headers - C++ wrapper for ZIP/UNZIP (development header files) libquazip1 - C++ wrapper for ZIP/UNZIP (Qt4 build) libquazip5-1 - C++ wrapper for ZIP/UNZIP (Qt5 build) libquazip5-dev - C++ wrapper for ZIP/UNZIP (development files, Qt5 build) libquazip5-headers - C++ wrapper for ZIP/UNZIP (development header files, Qt5 build)
You will want to get the ‘dev’ library here, because you’re doing dev, and then Krita is using Qt5, so select that one. If this doesn’t help, check the Ubuntu packages search.
If all dependencies have been installed, cmake will output something like this:
-- Configuring done -- Generating done -- Build files have been written to: /home/boud/dev/b-krita
警告
There is one run-time package that you need to install. CMake will not warn about it missing. That is the Qt5 SQLite database driver package. On Ubuntu this is named libqt5sql5-sqlite, the name might be different on other distributions. You need this to be able to start Krita after you have built and installed Krita! This is only needed if you build the master (5.0) branch of Krita.
Until that is shown, cmake has not succeeded and you cannot build Krita. When this is shown, you can build Krita:
you@yourcomputer:~/kritadev/build> make
You can speed this up by enabling multithreading. To do so, you first figure out how many threads your processor can handle:
cat /proc/cpuinfo | grep processor | wc -l
Then, add the resulting number with -j (for ‘Jobs’) at the end, so for example:
you@yourcomputer:~/kritadev/build> make -j4
Installing
When the build has fully succeeded, you can install:
you@yourcomputer:~/kritadev/build> make install
And when that is complete, you can run Krita:
you@yourcomputer:~/kritadev/build>../install/bin/krita
Running Krita
You do not have to set environment variables in order to run Krita.
you@yourcomputer:~> cd ~/kritadev/ you@yourcomputer:~> ./install/bin/krita
Updating
Now, Krita is in constant development, so you will want to update your build from time to time. Maybe a cool feature got in, or a bug was fixed, or you just want the latest source.
First, we get the new source from the git repository:
you@yourcomputer:~> cd ~/kritadev/krita/ you@yourcomputer:~/kritadev/krita> git pull
If you want to get the code from a specific branch, you will need to checkout
that branch first:
you@yourcomputer:~/kritadev/krita> git checkout <name of the branch> you@yourcomputer:~/kritadev/krita> git pull
Then, we build again:
you@yourcomputer:~/kritadev/krita> cd ~/kritadev/build/ you@yourcomputer:~/kritadev/build> make install
If you update daily, you might want to automate these command by making your own minimal bash script.
Trouble Shooting
The recent development version might break, or sometime be just unusable. Experimental changes are made daily.
This will affect your productivity if you don’t know how to ‘go back in time’ (for example, your favorite brush doesn’t work anymore).
But if you know how to do it, no issue can really affect you, because you know how to come back to a previous state.
To travel the source in time we need to read the timeline history. The terminal tool for it is git log
.
you@yourcomputer:~> cd ~/kritadev/krita/ you@yourcomputer:~/kritadev/krita> git log
With git log, you can consult all the last changes to the code, the ‘commit’. What we’re interested in is the long identification number, the ‘git hash’ (such as cca5819b19e0da3434192c5b352285b987a48796
). You can scroll the git log
, copy the ID number then quit(letter Q on keyboard). Then time-travel in your source directory:
you@yourcomputer:~/kritadev/krita> git checkout cca5819b19e0da3434192c5b352285b987a48796 you@yourcomputer:~/kritadev/krita> git pull
And, we build again:
you@yourcomputer:~/kritadev/krita> cd ~/kritadev/build/ you@yourcomputer:~/kritadev/build> make install
To update again to the actual and ‘fresh from a minute ago’ source-code named master
, simply ask git to come back to it with git checkout
then pull
to update :
you@yourcomputer:~/kritadev/krita> git checkout master you@yourcomputer:~/kritadev/krita> git pull
Common problems
Outside of the source being unstable, there’s the following common problems:
The most common problem is a missing dependency. Install it. A missing dependency is not an “error” that you need to report to the other Krita developers.
A dependency can also be too old. CMake will report when the version of a dependency is too old. That is also not an “error”. You might need to update your Linux installation to a newer version.
You can also have a successful build, then update your linux installation, and then find that Krita no longer builds. A library got updated, and you need to remove the
CMakeCache.txt
file in your build dir and run cmake again.Sometimes, changes in Krita’s source code from git revision to git revision make it necessary to make your installation and/or build dir empty and build from scratch. One example is where a plugin is removed from Krita; the plugin will be in your install dir, and won’t get updated when Krita’s internals change.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论