https://community.kde.org/api.php?action=feedcontributions&user=Wrobelda&feedformat=atomKDE Community Wiki - User contributions [en]2024-03-28T15:09:32ZUser contributionsMediaWiki 1.40.2https://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Icon_Workflow_Tips&diff=90353Guidelines and HOWTOs/Icon Workflow Tips2020-10-04T18:02:54Z<p>Wrobelda: Alo replace with spaces between property and its value</p>
<hr />
<div>== Making icons ==<br />
<br />
Make sure you have read https://hig.kde.org/style/icons/index.html<br />
<br />
=== Applications ===<br />
<br />
Don't use proprietary software like Adobe Illustrator, Gravit Designer, or Figma. All of our icons are made with Inkscape, but as long as your SVG editor is free, open-source, compatible with Inkscape and compatible with the Qt SVG renderer, it should be OK to use.<br />
<br />
=== Canvas ===<br />
<br />
Make sure you always use a canvas that matches the size you're using for the icon (e.g., 48x48 px instead of 210x297 mm). In Inkscape, you can change the canvas size by going to <menuchoice>File -> Document Properties...</menuchoice> or <keycap>Ctrl + Shift + D</keycap><br />
<br />
You should also make sure that the scale is set to 1.0 instead of anything else, like 0.26459.<br />
<br />
=== Grid ===<br />
<br />
A grid can be extremely useful for making icons that appear sharp instead of blurry or faded. When making icons, a grid with 1 px of space between each line is generally ideal. In Inkscape, you can modify the grid settings by going to <menuchoice>File -> Document Properties... -> Grids</menuchoice>. You can toggle the grid on and off with <keycap>Shift + 3</keycap> (US Keyboard layout) or <keycap>#</keycap>.<br />
<br />
If you are making strokes with the Line tool in Inkscape (<keycap>Shift + F6</keycap>), it is useful to use a spacing of 0.5 px and a major grid line every 2 lines. Strokes are centered on the points where you create them, so they would appear between pixels if you used a 1px grid spacing.<br />
<br />
=== Drawing Techniques ===<br />
<br />
==== General Tips ====<br />
<br />
* Always convert strokes to paths. Strokes don't always show up correctly in various SVG renderers, including the Qt SVG renderer. In Inkscape, the shortcut to convert a stroke to a path is <keycap>Ctrl + Alt + C</keycap>.<br />
* Avoid clipping, and instead use Path->Intersection, as it may not render correctly in the Qt SVG renderer<br />
<br />
==== Diagonal lines ====<br />
<br />
The best way to get a 1px thick pixel-perfect diagonal line is to use strokes, line up the endpoints with the grid diagonally, place endpoints in the center of pixels, and enable square caps. Avoid snapping the sides of the line to the grid, although it is acceptable with some difficulty to make shapes.<br />
<br />
See the pictures below: <br />
[[File:Diagonal 1px line style.png|center|frame|Left: wrong, Right: correct]]<br />
The image above at 1x size:<br />
[[File:Diagonal 1px line style 100%.png|left|none|The image above at 1x size]]<br />
<br />
* Notice that the incorrect style looks thicker and fuzzier than the vertical and horizontal lines while the correct style is more crisp and similar in thickness to the vertical and horizontal lines.<br />
<br />
=== Learning Resources ===<br />
<br />
* Logos By Nick (YouTube Channel): https://www.youtube.com/channel/UCEQXp_fcqwPcqrzNtWJ1w9w/playlists<br />
<br />
== SVG optimization ==<br />
<br />
In general, SVGs should be optimized and automatically formatted. This makes them compact, easier to read, and easier to manually edit (when necessary). There are multiple methods that can be used to optimize an SVG.<br />
<br />
=== Inkscape: Optimized SVG format ===<br />
<br />
This option does not strip embedded stylesheets, but saving in Inkscape always adds hardcoded colors to modified parts of the SVG. Remember to fix the hardcoded colors.<br />
<br />
<menuchoice>File -> Save As...</menuchoice> or <keycap>Ctrl + Shift + S</keycap><br />
<br />
Set the file type to <menuchoice>Optimized SVG (*.svg)</menuchoice><br />
<br />
Use these settings:<br />
<gallery><br />
Inkscape Optimized SVG dialog - Options page.png|Options<br />
Inkscape Optimized SVG dialog - SVG Output page.png|SVG Output<br />
Inkscape Optimized SVG dialog - IDs page.png|IDs<br />
</gallery><br />
<br />
=== Scour ===<br />
<br />
* https://github.com/scour-project/scour<br />
<br />
<code>scour</code> is available in many Linux distribution repositories. The package name is usually <code>scour</code> or <code>python-scour</code>.<br />
<br />
Put this somewhere that will be loaded by your shell:<br />
<br />
{{Input|<syntaxhighlight lang="Bash"><br />
# For optimizing SVGs in the Breeze icon theme<br />
function scour-icon {<br />
# Use this for icons from breeze-icons<br />
scour --set-precision=8 --enable-viewboxing --enable-comment-stripping --remove-descriptive-elements --create-groups --strip-xml-space --strip-xml-prolog --nindent=4 $1 output.svg<br />
mv output.svg $1<br />
}<br />
<br />
# For optimizing SVGs in the the Plasma theme<br />
function scour-theme {<br />
scour --set-precision=8 --enable-viewboxing --enable-comment-stripping --remove-descriptive-elements --strip-xml-space --strip-xml-prolog --nindent=4 $1 output.svg<br />
mv output.svg $1<br />
}<br />
</syntaxhighlight>}}<br />
<br />
Usage:<br />
<br />
{{Input|1=<nowiki><br />
cd [path to directory containing icon]<br />
scour-icon [icon name]<br />
</nowiki>}}<br />
<br />
=== SVG Cleaner ===<br />
<br />
* https://github.com/RazrFalcon/SVGCleaner<br />
* https://github.com/RazrFalcon/svgcleaner-gui<br />
<br />
Available in fewer distros, but it has a GUI if you prefer that. The package name is usually <code>svgcleaner</code> (for the CLI tool) or <code>svgcleaner-gui</code> (for the GUI). Always double-check the positions of your gradients in Inkscape if you use this program. It will always strip embedded stylesheets, so if your SVG is supposed to have stylesheets, add those last. Do not use it for desktop themes.<br />
<br />
Usage:<br />
<br />
{{Input|1=<nowiki><br />
svgcleaner icon-name.svg icon-name.svg --indent=4 --allow-bigger-file<br />
</nowiki>}}<br />
<br />
=== SVGO ===<br />
<br />
* https://github.com/svg/svgo<br />
<br />
Currently available in no distro repositories, but you can install it from Node Package Manager (<code>npm</code>) with this:<br />
<br />
{{Input|1=<nowiki><br />
sudo npm install -g svgo<br />
</nowiki>}}<br />
<br />
SVGO can be set to preserve stylesheets, but it will still strip <code>type="text/css"</code>, which is wrong. This command will strip stylesheets, so add those last. Do not use it for desktop themes.<br />
<br />
Usage:<br />
<br />
{{Input|1=<nowiki><br />
svgo --pretty icon-name.svg<br />
</nowiki>}}<br />
<br />
=== Misc comments about SVG optimizers ===<br />
<br />
If you combine them, you can get a more thorough cleaning. I usually use SVG Cleaner and then Scour for icons. Scour doesn't do as good of a job for color icons, which often require more cleaning to get the size down. However, it's nice when you're editing existing monochrome icons because it doesn't strip the stylesheets.<br />
<br />
== Embedding stylesheets in SVGs ==<br />
<br />
Put this somewhere that will be loaded by your shell:<br />
<br />
{{Input|<syntaxhighlight lang="Bash"><br />
#These will replace hardcoded colors with the appropriate class and currentColor fill for stylesheet compatibility<br />
# Made for people who do Breeze 1st and Breeze Dark 2nd<br />
# You still need to add stylesheets<br />
alias sed-Text="sed --follow-symlinks -i 's/fill=\"#232629\"/class=\"ColorScheme-Text\" fill=\"currentColor\"/'"<br />
alias sed-Background="sed --follow-symlinks -i 's/fill=\"#eff0f1\"/class=\"ColorScheme-Background\" fill=\"currentColor\"/'"<br />
alias sed-ViewBackground="sed --follow-symlinks -i 's/fill=\"#fcfcfc\"/class=\"ColorScheme-ViewBackground\" fill=\"currentColor\"/'"<br />
alias sed-Highlight="sed --follow-symlinks -i 's/fill=\"#3daee9\"/class=\"ColorScheme-Highlight\" fill=\"currentColor\"/'"<br />
alias sed-PositiveText="sed --follow-symlinks -i 's/fill=\"#27ae60\"/class=\"ColorScheme-PositiveText\" fill=\"currentColor\"/'"<br />
alias sed-NeutralText="sed --follow-symlinks -i 's/fill=\"#f67400\"/class=\"ColorScheme-NeutralText\" fill=\"currentColor\"/'"<br />
alias sed-NegativeText="sed --follow-symlinks -i 's/fill=\"#da4453\"/class=\"ColorScheme-NegativeText\" fill=\"currentColor\"/'"<br />
<br />
# Convert Breeze icon with stylesheet to Breeze Dark. ColorScheme-Text only<br />
alias sed-breeze-dark="sed --follow-symlinks -i 's/color:\s\{0,\}#232629/color:#eff0f1/'"<br />
# Convert Breeze Dark icon with stylesheet to Breeze. ColorScheme-Text only<br />
alias sed-breeze="sed --follow-symlinks -i 's/color:\s\{0,\}#eff0f1/color:#232629/'"<br />
</syntaxhighlight>}}<br />
<br />
Usage:<br />
<br />
{{Input|1=<nowiki><br />
sed-Text an-icon.svg<br />
sed-Text *wild*cards*work*<br />
</nowiki>}}<br />
<br />
=== Stylesheets ===<br />
<br />
Only include the color classes you will actually use.<br />
<br />
Most monochrome icons will only need this much:<br />
<br />
{{Input|<syntaxhighlight lang="XML"><br />
<style type="text/css" id="current-color-scheme"><br />
.ColorScheme-Text {<br />
color:#232629;<br />
}<br />
</style><br />
</syntaxhighlight>}}<br />
<br />
==== Breeze ====<br />
<br />
{{Input|<syntaxhighlight lang="XML"><br />
<style type="text/css" id="current-color-scheme"><br />
.ColorScheme-Text {<br />
color:#232629;<br />
}<br />
.ColorScheme-Background {<br />
color:#eff0f1;<br />
}<br />
.ColorScheme-ViewBackground {<br />
color:#fcfcfc;<br />
}<br />
.ColorScheme-Highlight {<br />
color:#3daee9;<br />
}<br />
.ColorScheme-PositiveText {<br />
color:#27ae60;<br />
}<br />
.ColorScheme-NeutralText {<br />
color:#f67400;<br />
}<br />
.ColorScheme-NegativeText {<br />
color:#da4453;<br />
}<br />
</style><br />
</syntaxhighlight>}}<br />
<br />
==== Breeze Dark ====<br />
<br />
{{Input|<syntaxhighlight lang="XML"><br />
<style type="text/css" id="current-color-scheme"><br />
.ColorScheme-Text {<br />
color:#eff0f1;<br />
}<br />
.ColorScheme-Background {<br />
color:#31363b;<br />
}<br />
.ColorScheme-ViewBackground {<br />
color:#232629;<br />
}<br />
.ColorScheme-Highlight {<br />
color:#3daee9;<br />
}<br />
.ColorScheme-PositiveText {<br />
color:#27ae60;<br />
}<br />
.ColorScheme-NeutralText {<br />
color:#f67400;<br />
}<br />
.ColorScheme-NegativeText {<br />
color:#da4453;<br />
}<br />
</style><br />
</syntaxhighlight>}}<br />
<br />
The only differences are Text, Background, and ViewBackground.<br />
<br />
For background information, see http://notmart.org/blog/2016/05/icon-colors/<br />
<br />
== Using Ikona for optimization and stylesheet injection ==<br />
<br />
[https://invent.kde.org/kde/ikona Ikona] offers a command-line utility called <code>ikona-cli</code> that can optimize and inject stylesheets into your icon.<br />
<br />
Usage for injecting stylesheets (note that commands can change based on locale):<br />
<br />
Injects the Breeze (Normal) stylesheet and replaces colors:<br />
{{Input|1=<nowiki><br />
ikona-cli class --mode light input.svg output.svg<br />
</nowiki>}}<br />
<br />
Injects the Breeze Dark stylesheet and replaces colors:<br />
{{Input|1=<nowiki><br />
ikona-cli class --mode dark input.svg output.svg<br />
</nowiki>}}<br />
<br />
Optimize your icon:<br />
{{Input|1=<nowiki><br />
ikona-cli optimize input.svg output.svg<br />
</nowiki>}}<br />
<br />
== Icon compilation images ==<br />
<br />
<code>montage</code> can be used to make compilations of all your icons quickly. The package name is usually <code>ImageMagick</code> or <code>imagemagick</code>.<br />
<br />
Put this somewhere that will be loaded by your shell:<br />
<br />
{{Input|<syntaxhighlight lang="Bash"><br />
alias montage-breeze="montage -density 96x96 -fill '#232629' -label '%t' -background '#eff0f1'" # Background color<br />
alias montage-breeze2="montage -density 96x96 -fill '#232629' -label '%t' -background '#fcfcfc'" # ViewBackground color<br />
alias montage-breeze-dark="montage -density 96x96 -fill '#eff0f1' -label '%t' -background '#31363b'" # Background color<br />
alias montage-breeze-dark2="montage -density 96x96 -fill '#eff0f1' -label '%t' -background '#232629'" # ViewBackground color<br />
</syntaxhighlight>}}<br />
<br />
Usage:<br />
<br />
{{Input|<syntaxhighlight lang="Bash"><br />
montage-breeze an-icon-here.svg ../an-icon-up-there.svg ../*/*wild*cards*work* montage-breeze-Background.png # The PNG at the end is the image that the command will create<br />
</syntaxhighlight>}}</div>Wrobeldahttps://community.kde.org/index.php?title=Mac&diff=90260Mac2020-09-17T22:01:13Z<p>Wrobelda: /* Application Bundles */</p>
<hr />
<div>== Application Bundles ==<br />
<br />
Several KDE applications have downloads with application bundles for Mac OS X available.<br />
<br />
* [https://www.digikam.org/download/binary/#MacOS digiKam]<br />
<br />
* [https://kate-editor.org/get-it/ Kate & KWrite]<br />
<br />
* [https://krita.org/en/download/krita-desktop/ Krita]<br />
<br />
* [http://edu.kde.org/marble/download.php Marble Virtual Globe]<br />
<br />
* [https://kmymoney.org/download.html KMyMoney]<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-mac #kde-mac] on Freenode<br />
<br />
* Mailing list: [mailto:kde-mac@kde.org kde-mac@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-mac subscribe], [http://lists.kde.org/?l=kde-mac&r=1&w=2 archives])<br />
<br />
* Forums: http://forum.kde.org/viewforum.php?f=60<br />
<br />
== Development & Alternative Installation Methods ==<br />
* [[Mac/MacPorts_Fink_Homebrew|Installing KDE software via MacPorts/Fink/Homebrew]].<br />
* [[Guidelines_and_HOWTOs/Build_from_source/Mac|Build from source]].<br />
<br />
__NOTOC__</div>Wrobeldahttps://community.kde.org/index.php?title=Mac&diff=90259Mac2020-09-17T22:01:05Z<p>Wrobelda: /* Application Bundles */</p>
<hr />
<div>== Application Bundles ==<br />
<br />
Several KDE applications have downloads with application bundles for Mac OS X available.<br />
<br />
* [https://www.digikam.org/download/binary/#MacOS digiKam]<br />
<br />
* [https://kate-editor.org/get-it/ Kate & KWrite]<br />
<br />
* [https://krita.org/en/download/krita-desktop/ Krita]<br />
<br />
* [http://edu.kde.org/marble/download.php Marble Virtual Globe]<br />
<br />
* [https://kmymoney.org/download.html KMyMoney<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-mac #kde-mac] on Freenode<br />
<br />
* Mailing list: [mailto:kde-mac@kde.org kde-mac@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-mac subscribe], [http://lists.kde.org/?l=kde-mac&r=1&w=2 archives])<br />
<br />
* Forums: http://forum.kde.org/viewforum.php?f=60<br />
<br />
== Development & Alternative Installation Methods ==<br />
* [[Mac/MacPorts_Fink_Homebrew|Installing KDE software via MacPorts/Fink/Homebrew]].<br />
* [[Guidelines_and_HOWTOs/Build_from_source/Mac|Build from source]].<br />
<br />
__NOTOC__</div>Wrobeldahttps://community.kde.org/index.php?title=KMyMoney&diff=90159KMyMoney2020-09-10T03:01:21Z<p>Wrobelda: Point to GitLab wiki</p>
<hr />
<div>This is the community page for the KMyMoney project.<br />
<br />
<br />
== Development guidelines ==<br />
<br />
Please refer to [https://invent.kde.org/office/kmymoney/-/wikis/home#installation KDE GitLab Wiki].<br />
<br />
== Blocking issues ==<br />
<br />
No blocking issues at the moment<br />
<br />
== Krazy warnings ==<br />
<br />
Also, here you have the KrazyEBN report, which reports common issues on the code. [http://www.englishbreakfastnetwork.org/krazy/reports/extragear/office/kmymoney/index.html Krazy Report] <br />
<br />
<br />
== Issues ==<br />
<br />
Look in [https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=kmymoney4&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=keywords&type0-0-0=noop&value0-0-0= bugs.kde.org for unresolved kmymoney4 issues]<br />
<br />
== Mailing list ==<br />
<br />
https://mail.kde.org/mailman/listinfo/kmymoney-devel. Use it to discuss issues related to the port to KDE4. <br />
<br />
== Coordination ==<br />
<br />
Alvaro Soliverez is coordinating the KDE4 effort. You can reach me at asoliverez at gmail.com or on IRC under Hei_ku in the #kmymoney channel. Alternatively, you can contact Thomas Baumgart on the developers list. <br />
<br />
== People involved ==<br />
<br />
*conet <br />
*asoliverez <br />
*tbaumgart aka ipwizard <br />
*fvilas <br />
*tonyb<br />
*ostroffj<br />
<br />
(Contact the coordinator if you are willing to contribute) <br />
<br />
<br />
==New Features==<br />
* [[KMyMoney/Frameworks|Porting to frameworks]]<br />
* [[KMyMoney/Features/Plan46|Feature Plan for 4.6]]<br />
* [[KMyMoney/Features/Future|Future releases]]<br />
* [[KMyMoney/Features/Tags|Tags]]<br />
* [[KMyMoney/PlayingWithAlkValue|Playing with AlkValue]]<br />
<br />
==Donations==<br />
<br />
The project currently has no costs, and therefore has not setup a unified way to collect donations.<br />
Each individual developer provides a way to receive donations, which will be used project-related or for leisure (which, in turn, helps the project. After all, a happy developer writes better code, right?).<br />
<br />
<br />
'''Thomas Baumgart:'''<br />
<br />
Amazon wishlists (in different countries):<br />
<br />
* Germany http://www.amazon.de/exec/obidos/registry/1T19RN6RY4ABL/ref=wl_s_3/028-8003588-2510945<br />
* US https://www.amazon.com/gp/registry/wishlist/16YBVTHXIEQTA/<br />
* UK http://www.amazon.co.uk/gp/registry/20HV5VJTTY5H0<br />
* France http://www.amazon.fr/gp/registry/3C6RM5PN3X2KS<br />
<br />
<br />
'''Alvaro Soliverez:'''<br />
* Amazon's wishlist: http://www.amazon.com/gp/registry/registry.html?ie=UTF8&type=wishlist&id=2ELFUD3RDHHKH<br />
* PayPal donate button at http://soliverez.com.ar<br />
<br />
<br />
'''Fernando Vilas:'''<br />
<br />
<br />
'''Cristian Onet:'''<br />
* PayPal donate button at http://cheepee.homedns.org/~cristi/donate.html<br />
<br />
'''Tony Bloomfield:'''</div>Wrobeldahttps://community.kde.org/index.php?title=Craft&diff=88464Craft2020-06-10T18:33:48Z<p>Wrobelda: Updated git repo</p>
<hr />
<div>Craft is an open source meta build system and package manager. It manages dependencies and builds libraries and applications from source, on ''Windows'', ''Mac'', ''Linux'' and ''FreeBSD''.<br />
<br />
== Setting up Craft ==<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows Start crafting on Windows]<br />
<br />
[https://community.kde.org/Craft/Linux Start crafting on Linux]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Mac#Installation_using_Craft Start crafting on Mac]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/FreeBSD Start crafting on FreeBSD]<br />
<br />
== Common Craft commands ==<br />
<br />
====== Searching for a package ======<br />
craft --search packagename<br />
<br />
====== Installing a package (and dependencies) ======<br />
craft packagename<br />
<br />
====== Uninstalling a package ======<br />
craft --unmerge packagename<br />
<br />
====== Updating a package ======<br />
craft -i packagename<br />
<br />
====== Switching to the source directory of a package ======<br />
cs packagename<br />
<br />
====== Switching to the build directory of a package ======<br />
cb packagename<br />
<br />
====== Compiling a package ====== <br />
if you just modified the source code and want to test-compile:<br />
craft --compile packagename<br />
<br />
====== Creating an installer ======<br />
<code>.dmg</code> bundle, <code>.exe</code> setup, ... for a specific package:<br />
craft --package packagename<br />
The option <code>Packager/PackageType</code> in <tt>CraftSettings.ini</tt> controls which type of installer is created<br />
<br />
==== Developing with Craft ====<br />
<br />
====== Installing a library ======<br />
When developing on a specific application, you may want to develop on its library as well. <br />
craft -i --no-cache <somelib><br />
<code>--no-cache</code> also disables the cache for all missing/outdated dependencies.<br />
====== Testing new changes ======<br />
For the applications to run with changes to the source of the package:<br />
craft --compile --install --qmerge <somelib><br />
<br />
===== Examples =====<br />
<br />
====== Updating Craft itself ======<br />
craft -i craft<br />
<br />
====== Updating the blueprints ======<br />
craft -i craft-blueprints-kde<br />
<br />
== Adding new blueprints ==<br />
<br />
Blueprints are stored in separate repositories. At the moment there are these repositories:<br />
* git@invent.kde.org:packaging/craft-blueprints-kde.git (enabled by default)<br />
<br/><br />
To navigate to this repository on your local file system:<br />
cs craft-blueprints-kde<br />
<br />
Open a file browser in that folder and start adding new recipes by copying from existing ones. <br />
<br />
Note that the name of the package folder needs to match the blueprint name. An example would be <code>kdegraphics-mobipocket\kdegraphics-mobipocket.py</code><br />
<br />
== Advanced tips ==<br />
<br />
=== Hardcode versions of packages ===<br />
Packages are by-default installed from the cache. To build a non default version (or to build from master)<br />
<pre> craft --set version=some_version packagename</pre><br />
<br />
Here, replace <code>some_version</code> with the branch name of the source git repository of the package (like <code>master</code>) or version number (for eg: 0.57.0, 0.58.0).<br />
Alternatively ,edit <tt>$CraftRoot/etc/BlueprintSettings.ini</tt> and add:<br />
<br />
<pre> [category/packagename]<br />
version = branch<br />
</pre><br />
<br />
====== Examples ======<br />
<br />
For example, to install master branch of khtml, the line to be appended should look like:<br />
<br />
[frameworks/khtml]<br />
version = master<br />
<br />
To change the version of all packages of a category, like <code>libs/qt5</code> add<br />
<br />
[libs/qt5]<br />
version = 5.9.3<br />
<br />
==Using Craft with Qt Creator==<br />
<br />
===Windows===<br />
To compile from within Qt Creator, I need to set up a kit.<br />
This is an example for mingw64.<br />
* Add a cmake if none is set: C:\CraftRoot\dev-utils\cmake\bin\cmake.exe<br />
* Add a debugger: C:\CraftRoot\mingw64\bin\gdb.exe<br />
* Add a C++ compiler and a C compiler. Both: C:\CraftRoot\mingw64\bin\gcc.exe<br />
** Ensure that the ABI is correctly set<br />
* Add a Qt: C:\CraftRoot\bin\qmake.exe<br />
* Add a kit with all of the above<br />
* Edit the Environment:<br />
** '''PATH=$(PATH);C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin\; C:\CraftRoot\mingw64\bin'''<br />
* Use the kit on a project<br />
<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\CraftRoot)<br />
<br />
===MacOS===<br />
To be able to use Craft libs in your cmake project from QtCreator follow these steps:<br />
* If the QtVersion used by Craft is not already registered in QtC, then create a new QtVersion by pointing it to the qmake used by Craft<br />
* Create a new kit by duplicating an existing one or creating a new one from scratch<br />
* Setup properties of the kit (for from scratch kit):<br />
** Set cmake binary to the one used by Craft<br />
** Set debugger binary to the one used by Craft<br />
** Set C++ and C compiler to the one used by Craft<br />
** Select the correct QtVersion<br />
** Ensure abi is correct<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};/Volumes/Projects/Developers/Craft)<br />
* Edit the Environment:<br />
** '''PATH=$(PATH):~/CraftRoot/bin:~/CraftRoot/dev-utils/bin/'''<br />
** '''QT_PLUGIN_PATH=~/CraftRoot/bin/plugins'''<br />
* Apply, and now use this Kit for your cmake project<br />
<br />
== Debugging a standalone app with symbols ==<br />
Craft by default uses RelWithDebInfo build type. As such, each library and executable is compiled with the release symbols stripped from the main file and saved separately in a corresponding .pdb file on Windows and .dSYM package on Mac. <br />
<br />
Those symbols will not be included in a final redistributable package generated by craft (--package option). However, if PackageDebugSymbols is enabled in CraftSettings.ini, a separate archive will be created will all the debug symbols combined.<br />
<br />
If an issue you're trying to debug is specific to a packaged app only, you can use Qt Creator's Debug -> Start and Debug External Application option to run the packaged app and automatically attach to it:<br />
<br />
* In "Local Executable" provide a path to executable file inside the .app container, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/archive/Applications/KDE/kmymoney.app/Contents/MacOS/kmymoney<br />
* In "Debug information" provide a path to a folder containing the debug symbols package (kmymoney.app.dSYM) generated by craft, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/image-RelWithDebInfo-master/Applications/KDE <br />
* check "Break at main" if it's your initial setup to make sure everything works as expected<br />
* Optionally add the Source Paths Mapping (Preferences -> Debugger) if your local source code location doesn't match the one used to generate the package debugged, resulting in the main() break showing a disassembled code.<br />
<br />
== Troubleshooting ==<br />
<br />
If a package fails to build, you'll be greeted with something like:<br />
<br />
...<br />
craft warning: while running make cmd: jom<br />
craft warning: Action: compile for libs/qt5/qtbase FAILED<br />
*** Craft all failed: all of libs/qtbase failed after 0:07:25 ***<br />
craft error: fatal error: package libs/qtbase all failed<br />
<br />
In order to figure out ''what'' failed, grep the command line output ''above'' for errors.<br />
<br />
Or have a look at the log file located in <tt>$HOME/.craft</tt> (<tt>%USERPROFILE%\.craft</tt> on Windows) which will contain much more details.<br />
<br />
Search for "error", or "error:" in the file.<br />
<br />
== News ==<br />
[https://the2ring.blogspot.de/search/label/Craft Blog]<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-windows #kde-craft] on freenode (join via web chat: http://webchat.freenode.net/?channels=kde-craft)<br />
<br />
* [https://bugs.kde.org/enter_bug.cgi?product=Craft Report bugs]<br />
<br />
* Mailing list: [mailto:kde-windows@kde.org kde-windows@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-windows subscribe], [http://lists.kde.org/?l=kde-windows&r=1&w=2 archives])</div>Wrobeldahttps://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Build_from_source/Windows&diff=88426Guidelines and HOWTOs/Build from source/Windows2020-06-09T18:18:17Z<p>Wrobelda: List MSVC components required</p>
<hr />
<div>''Craft'' is a tool to build the sources and its third-party requirements. It is the '''easy''' way to build software.<br />
<br />
== Setting up craft ==<br />
=== Installing python ===<br />
While Craft is capable of installing an embedded Python version sufficient for most packages, we recommend a full installation of Python. The current version is 3.7. [https://www.python.org/downloads/ Download Python 3.6+] <br />
<br />
Note that some packages may still depend on Python2.7, so if you see following error make sure to install it and update CraftSettings.ini file:<br />
<br />
DEBUG Craft was unable to locate: python2.7, in None<br />
CRITICAL Please have a look on C:\CraftRoot\etc\CraftSettings.ini and make sure that<br />
[Paths]<br />
PYTHON27<br />
Points to a valid Python installation.<br />
<br />
<br />
<br />
=== Setting up a powershell ===<br />
Powershell is required to be at least version 5.0. <br />
If you're running Windows 10 you most probably won't need to update Powershell.<br />
<br />
You can check the version by invocating <tt>$PSVersionTable.PSVersion</tt> in a Powershell terminal.<br />
<br />
In case you need a newer one, we recommend<br />
[https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6 Powershell Core].<br />
<br />
The latest version of the standard powershell can be found [https://www.microsoft.com/en-us/download/details.aspx?id=50395 here].<br />
<br />
=== Setting up a compiler ===<br />
Currently, Craft supports both the MinGW and Microsoft Visual Studio (msvc) compiler.<br />
While MinGW can be installed by Craft, [https://www.visualstudio.com/ Visual Studio] must be installed independently by the user.<br />
<br />
For Visual Studio, make sure the following components are selected at the minimum:<br />
* MSVC build tools<br />
* Windows SDK<br />
* C++ CMake tools for Windows<br />
* C++ Clang tools for Windows<br />
<br />
=== Direct X SDK (only for MinGW setups) ===<br />
If you are using the MinGW compiler, in order to compile the Qt5 ''qtbase'' package you will also need to install the [https://www.microsoft.com/en-us/download/details.aspx?id=6812 Microsoft DirectX SDK]. Make sure to open a new command line window after the installation for the environment variables to be set.<br />
<br />
=== (Optional) Enable development mode ===<br />
Windows 10 supports the creation of symbolic links, but only if the development mode is activated.<br />
Allowing symbolic links allows faster (much faster) extraction of archives.<br />
[https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development Enable development mode]<br />
<br />
=== Installing Craft===<br />
# [https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell?view=powershell-6 Start a PowerShell environment] (Do not use PowerShell ISE, it doesn't work very well with python). It might be required to run it [https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell?view=powershell-6#with-administrative-privileges-run-as-administrator as administrator].<br />
# Allow execution of powershell scripts by executing the following command:<br />
#:<pre>Set-ExecutionPolicy -Scope CurrentUser RemoteSigned</pre><br />
# Install Craft and follow the instructions by executing the following command:<br />
#: <pre>iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1'))</pre><br />
# Consider adding exception for the entire craft root directory to your antivirus' exceptions, otherwise build of some packages can fail (example: build of <code>kde/frameworks/tier2/kdoctools</code> when AVG is used).<br />
<br />
<br />
Note: For Microsoft Visual Studio compiler, it's necessary to have VCTOOLSREDISTDIR environment variable pointing to:<br />
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Redist\MSVC\xx.xx.xxxxx" for MSVS 2017 and <br />
VCINSTALLDIR environment pointing to "C:\Program Files (x86)\Microsoft Visual Studio\2015\Community\VC\" for MSVS 2015.<br />
<br />
=== Using the stock Qt SDK===<br />
This will skip all Qt packages and use the official Qt builds instead.<br />
It will work fine for most CMake based recipes but definitely cause problems with QMake based projects.<br />
You will of course also miss all patches we usually apply to Qt.<br />
This is only recommended when you know what you are doing and you won't get support for in our channel.<br />
<br />
To activate the SDK mode adapt the [QtSDK] section in your etc/CraftSettings.ini to something like:<br />
[QtSDK]<br />
## Whether to use prebuild Qt binaries.<br />
Enabled = True<br />
## The path to the Qt sdk.<br />
Path = C:\Qt<br />
## The version of Qt.<br />
Version = 5.9<br />
## The compiler version, if you are not sure what to use, have a look at the directory set in QtSDK/Path.<br />
## The compiler must be of the same type as General/KDECOMPILER.<br />
## If you are using mingw please make sure you have installed the mingw using the Qt installer.<br />
Compiler = msvc2017_64<br />
<br />
== Using Craft ==<br />
To use Craft you need to start a Powershell window, point that to <tt>KDEROOT\craft </tt> and run the initalization script. For example:<br />
<br />
C:\CraftRoot\craft\craftenv.ps1<br />
<br />
This tells Craft about your environment settings (e.g. paths). It will load your configuration from <tt>CraftRoot\etc\CraftSettings.ini</tt>. If there are any error messages Craft will not work as expected. The output should look similar to this one (of course with your paths):<br />
<br />
PS C:\CraftRoot\craft>.\craftenv.ps1<br />
Craft : C:\CraftRoot<br />
Version : master<br />
ABI : windows-msvc2017_64-cl<br />
Download directory : C:\CraftRoot\download<br />
<br />
Then [https://community.kde.org/Craft start crafting]<br />
<br />
== Troubleshooting ==<br />
<br />
If craft seems stalled for prolonged period of time, you may want need hit Enter in the Powershell terminal to give it a nudge.</div>Wrobeldahttps://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Build_from_source/Windows&diff=88214Guidelines and HOWTOs/Build from source/Windows2020-05-11T01:20:18Z<p>Wrobelda: /* Using Craft */</p>
<hr />
<div>''Craft'' is a tool to build the sources and its third-party requirements. It is the '''easy''' way to build software.<br />
<br />
== Setting up craft ==<br />
=== Installing python ===<br />
While Craft is capable of installing an embedded Python version sufficient for most packages, we recommend a full installation of Python. The current version is 3.7. [https://www.python.org/downloads/ Download Python 3.6+] <br />
<br />
Note that some packages may still depend on Python2.7, so if you see following error make sure to install it and update CraftSettings.ini file:<br />
<br />
DEBUG Craft was unable to locate: python2.7, in None<br />
CRITICAL Please have a look on C:\CraftRoot\etc\CraftSettings.ini and make sure that<br />
[Paths]<br />
PYTHON27<br />
Points to a valid Python installation.<br />
<br />
<br />
<br />
=== Setting up a powershell ===<br />
Powershell is required to be at least version 5.0. <br />
If you're running Windows 10 you most probably won't need to update Powershell.<br />
<br />
You can check the version by invocating <tt>$PSVersionTable.PSVersion</tt> in a Powershell terminal.<br />
<br />
In case you need a newer one, we recommend<br />
[https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6 Powershell Core].<br />
<br />
The latest version of the standard powershell can be found [https://www.microsoft.com/en-us/download/details.aspx?id=50395 here].<br />
<br />
=== Setting up a compiler ===<br />
Currently, Craft supports both the MinGW and Microsoft Visual Studio (msvc) compiler.<br />
While MinGW can be installed by Craft, [https://www.visualstudio.com/ Visual Studio] must be installed independently by the user.<br />
<br />
=== Direct X SDK (only for MinGW setups) ===<br />
If you are using the MinGW compiler, in order to compile the Qt5 ''qtbase'' package you will also need to install the [https://www.microsoft.com/en-us/download/details.aspx?id=6812 Microsoft DirectX SDK]. Make sure to open a new command line window after the installation for the environment variables to be set.<br />
<br />
=== (Optional) Enable development mode ===<br />
Windows 10 supports the creation of symbolic links, but only if the development mode is activated.<br />
Allowing symbolic links allows faster (much faster) extraction of archives.<br />
[https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development Enable development mode]<br />
<br />
=== Installing Craft===<br />
# [https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell?view=powershell-6 Start a PowerShell environment] (Do not use PowerShell ISE, it doesn't work very well with python). It might be required to run it [https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell?view=powershell-6#with-administrative-privileges-run-as-administrator as administrator].<br />
# Allow execution of powershell scripts by executing the following command:<br />
#:<pre>Set-ExecutionPolicy -Scope CurrentUser RemoteSigned</pre><br />
# Install Craft and follow the instructions by executing the following command:<br />
#: <pre>iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1'))</pre><br />
# Consider adding exception for the entire craft root directory to your antivirus' exceptions, otherwise build of some packages can fail (example: build of <code>kde/frameworks/tier2/kdoctools</code> when AVG is used).<br />
<br />
<br />
Note: For Microsoft Visual Studio compiler, it's necessary to have VCTOOLSREDISTDIR environment variable pointing to:<br />
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Redist\MSVC\xx.xx.xxxxx" for MSVS 2017 and <br />
VCINSTALLDIR environment pointing to "C:\Program Files (x86)\Microsoft Visual Studio\2015\Community\VC\" for MSVS 2015.<br />
<br />
=== Using the stock Qt SDK===<br />
This will skip all Qt packages and use the official Qt builds instead.<br />
It will work fine for most CMake based recipes but definitely cause problems with QMake based projects.<br />
You will of course also miss all patches we usually apply to Qt.<br />
This is only recommended when you know what you are doing and you won't get support for in our channel.<br />
<br />
To activate the SDK mode adapt the [QtSDK] section in your etc/CraftSettings.ini to something like:<br />
[QtSDK]<br />
## Whether to use prebuild Qt binaries.<br />
Enabled = True<br />
## The path to the Qt sdk.<br />
Path = C:\Qt<br />
## The version of Qt.<br />
Version = 5.9<br />
## The compiler version, if you are not sure what to use, have a look at the directory set in QtSDK/Path.<br />
## The compiler must be of the same type as General/KDECOMPILER.<br />
## If you are using mingw please make sure you have installed the mingw using the Qt installer.<br />
Compiler = msvc2017_64<br />
<br />
== Using Craft ==<br />
To use Craft you need to start a Powershell window, point that to <tt>KDEROOT\craft </tt> and run the initalization script. For example:<br />
<br />
C:\CraftRoot\craft\craftenv.ps1<br />
<br />
This tells Craft about your environment settings (e.g. paths). It will load your configuration from <tt>CraftRoot\etc\CraftSettings.ini</tt>. If there are any error messages Craft will not work as expected. The output should look similar to this one (of course with your paths):<br />
<br />
PS C:\CraftRoot\craft>.\craftenv.ps1<br />
Craft : C:\CraftRoot<br />
Version : master<br />
ABI : windows-msvc2017_64-cl<br />
Download directory : C:\CraftRoot\download<br />
<br />
Then [https://community.kde.org/Craft start crafting]<br />
<br />
== Troubleshooting ==<br />
<br />
If craft seems stalled for prolonged period of time, you may want need hit Enter in the Powershell terminal to give it a nudge.</div>Wrobeldahttps://community.kde.org/index.php?title=Craft&diff=88203Craft2020-05-09T01:16:46Z<p>Wrobelda: /* Debugging a standalone app with symbols */</p>
<hr />
<div>Craft is an open source meta build system and package manager. It manages dependencies and builds libraries and applications from source, on ''Windows'', ''Mac'', ''Linux'' and ''FreeBSD''.<br />
<br />
== Setting up Craft ==<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows Start crafting on Windows]<br />
<br />
[https://community.kde.org/Craft/Linux Start crafting on Linux]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Mac#Installation_using_Craft Start crafting on Mac]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/FreeBSD Start crafting on FreeBSD]<br />
<br />
== Common Craft commands ==<br />
<br />
====== Searching for a package ======<br />
craft --search packagename<br />
<br />
====== Installing a package (and dependencies) ======<br />
craft packagename<br />
<br />
====== Uninstalling a package ======<br />
craft --unmerge packagename<br />
<br />
====== Updating a package ======<br />
craft -i packagename<br />
<br />
====== Switching to the source directory of a package ======<br />
cs packagename<br />
<br />
====== Switching to the build directory of a package ======<br />
cb packagename<br />
<br />
====== Compiling a package ====== <br />
if you just modified the source code and want to test-compile:<br />
craft --compile packagename<br />
<br />
====== Creating an installer ======<br />
<code>.dmg</code> bundle, <code>.exe</code> setup, ... for a specific package:<br />
craft --package packagename<br />
The option <code>Packager/PackageType</code> in <tt>CraftSettings.ini</tt> controls which type of installer is created<br />
<br />
==== Developing with Craft ====<br />
<br />
====== Installing a library ======<br />
When developing on a specific application, you may want to develop on its library as well. <br />
craft -i --no-cache <somelib><br />
<code>--no-cache</code> also disables the cache for all missing/outdated dependencies.<br />
====== Testing new changes ======<br />
For the applications to run with changes to the source of the package:<br />
craft --compile --install --qmerge <somelib><br />
<br />
===== Examples =====<br />
<br />
====== Updating Craft itself ======<br />
craft -i craft<br />
<br />
====== Updating the blueprints ======<br />
craft -i craft-blueprints-kde<br />
<br />
== Adding new blueprints ==<br />
<br />
Blueprints are stored in separate repositories. At the moment there are these repositories:<br />
* https://cgit.kde.org/craft-blueprints-kde.git/tree/ (enabled by default)<br />
<br/><br />
To navigate to this repository on your local file system:<br />
cs craft-blueprints-kde<br />
<br />
Open a file browser in that folder and start adding new recipes by copying from existing ones. <br />
<br />
Note that the name of the package folder needs to match the blueprint name. An example would be <code>kdegraphics-mobipocket\kdegraphics-mobipocket.py</code><br />
<br />
== Advanced tips ==<br />
<br />
=== Hardcode versions of packages ===<br />
Packages are by-default installed from the cache. To build a non default version (or to build from master)<br />
<pre> craft --set version=some_version packagename</pre><br />
<br />
Here, replace <code>some_version</code> with the branch name of the source git repository of the package (like <code>master</code>) or version number (for eg: 0.57.0, 0.58.0).<br />
Alternatively ,edit <tt>$CraftRoot/etc/BlueprintSettings.ini</tt> and add:<br />
<br />
<pre> [category/packagename]<br />
version = branch<br />
</pre><br />
<br />
====== Examples ======<br />
<br />
For example, to install master branch of khtml, the line to be appended should look like:<br />
<br />
[frameworks/khtml]<br />
version = master<br />
<br />
To change the version of all packages of a category, like <code>libs/qt5</code> add<br />
<br />
[libs/qt5]<br />
version = 5.9.3<br />
<br />
==Using Craft with Qt Creator==<br />
<br />
===Windows===<br />
To compile from within Qt Creator, I need to set up a kit.<br />
This is an example for mingw64.<br />
* Add a cmake if none is set: C:\CraftRoot\dev-utils\cmake\bin\cmake.exe<br />
* Add a debugger: C:\CraftRoot\mingw64\bin\gdb.exe<br />
* Add a C++ compiler and a C compiler. Both: C:\CraftRoot\mingw64\bin\gcc.exe<br />
** Ensure that the ABI is correctly set<br />
* Add a Qt: C:\CraftRoot\bin\qmake.exe<br />
* Add a kit with all of the above<br />
* Edit the Environment:<br />
** '''PATH=$(PATH);C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin\; C:\CraftRoot\mingw64\bin'''<br />
* Use the kit on a project<br />
<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\CraftRoot)<br />
<br />
===MacOS===<br />
To be able to use Craft libs in your cmake project from QtCreator follow these steps:<br />
* If the QtVersion used by Craft is not already registered in QtC, then create a new QtVersion by pointing it to the qmake used by Craft<br />
* Create a new kit by duplicating an existing one or creating a new one from scratch<br />
* Setup properties of the kit (for from scratch kit):<br />
** Set cmake binary to the one used by Craft<br />
** Set debugger binary to the one used by Craft<br />
** Set C++ and C compiler to the one used by Craft<br />
** Select the correct QtVersion<br />
** Ensure abi is correct<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};/Volumes/Projects/Developers/Craft)<br />
* Edit the Environment:<br />
** '''PATH=$(PATH):~/CraftRoot/bin:~/CraftRoot/dev-utils/bin/'''<br />
** '''QT_PLUGIN_PATH=~/CraftRoot/bin/plugins'''<br />
* Apply, and now use this Kit for your cmake project<br />
<br />
== Debugging a standalone app with symbols ==<br />
Craft by default uses RelWithDebInfo build type. As such, each library and executable is compiled with the release symbols stripped from the main file and saved separately in a corresponding .pdb file on Windows and .dSYM package on Mac. <br />
<br />
Those symbols will not be included in a final redistributable package generated by craft (--package option). However, if PackageDebugSymbols is enabled in CraftSettings.ini, a separate archive will be created will all the debug symbols combined.<br />
<br />
If an issue you're trying to debug is specific to a packaged app only, you can use Qt Creator's Debug -> Start and Debug External Application option to run the packaged app and automatically attach to it:<br />
<br />
* In "Local Executable" provide a path to executable file inside the .app container, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/archive/Applications/KDE/kmymoney.app/Contents/MacOS/kmymoney<br />
* In "Debug information" provide a path to a folder containing the debug symbols package (kmymoney.app.dSYM) generated by craft, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/image-RelWithDebInfo-master/Applications/KDE <br />
* check "Break at main" if it's your initial setup to make sure everything works as expected<br />
* Optionally add the Source Paths Mapping (Preferences -> Debugger) if your local source code location doesn't match the one used to generate the package debugged, resulting in the main() break showing a disassembled code.<br />
<br />
== Troubleshooting ==<br />
<br />
If a package fails to build, you'll be greeted with something like:<br />
<br />
...<br />
craft warning: while running make cmd: jom<br />
craft warning: Action: compile for libs/qt5/qtbase FAILED<br />
*** Craft all failed: all of libs/qtbase failed after 0:07:25 ***<br />
craft error: fatal error: package libs/qtbase all failed<br />
<br />
In order to figure out ''what'' failed, grep the command line output ''above'' for errors.<br />
<br />
Or have a look at the log file located in <tt>$HOME/.craft</tt> (<tt>%USERPROFILE%\.craft</tt> on Windows) which will contain much more details.<br />
<br />
Search for "error", or "error:" in the file.<br />
<br />
== News ==<br />
[https://the2ring.blogspot.de/search/label/Craft Blog]<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-windows #kde-craft] on freenode (join via web chat: http://webchat.freenode.net/?channels=kde-craft)<br />
<br />
* [https://bugs.kde.org/enter_bug.cgi?product=Craft Report bugs]<br />
<br />
* Mailing list: [mailto:kde-windows@kde.org kde-windows@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-windows subscribe], [http://lists.kde.org/?l=kde-windows&r=1&w=2 archives])</div>Wrobeldahttps://community.kde.org/index.php?title=Craft&diff=88202Craft2020-05-09T00:44:26Z<p>Wrobelda: /* Debugging standalone app with symbols */</p>
<hr />
<div>Craft is an open source meta build system and package manager. It manages dependencies and builds libraries and applications from source, on ''Windows'', ''Mac'', ''Linux'' and ''FreeBSD''.<br />
<br />
== Setting up Craft ==<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows Start crafting on Windows]<br />
<br />
[https://community.kde.org/Craft/Linux Start crafting on Linux]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Mac#Installation_using_Craft Start crafting on Mac]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/FreeBSD Start crafting on FreeBSD]<br />
<br />
== Common Craft commands ==<br />
<br />
====== Searching for a package ======<br />
craft --search packagename<br />
<br />
====== Installing a package (and dependencies) ======<br />
craft packagename<br />
<br />
====== Uninstalling a package ======<br />
craft --unmerge packagename<br />
<br />
====== Updating a package ======<br />
craft -i packagename<br />
<br />
====== Switching to the source directory of a package ======<br />
cs packagename<br />
<br />
====== Switching to the build directory of a package ======<br />
cb packagename<br />
<br />
====== Compiling a package ====== <br />
if you just modified the source code and want to test-compile:<br />
craft --compile packagename<br />
<br />
====== Creating an installer ======<br />
<code>.dmg</code> bundle, <code>.exe</code> setup, ... for a specific package:<br />
craft --package packagename<br />
The option <code>Packager/PackageType</code> in <tt>CraftSettings.ini</tt> controls which type of installer is created<br />
<br />
==== Developing with Craft ====<br />
<br />
====== Installing a library ======<br />
When developing on a specific application, you may want to develop on its library as well. <br />
craft -i --no-cache <somelib><br />
<code>--no-cache</code> also disables the cache for all missing/outdated dependencies.<br />
====== Testing new changes ======<br />
For the applications to run with changes to the source of the package:<br />
craft --compile --install --qmerge <somelib><br />
<br />
===== Examples =====<br />
<br />
====== Updating Craft itself ======<br />
craft -i craft<br />
<br />
====== Updating the blueprints ======<br />
craft -i craft-blueprints-kde<br />
<br />
== Adding new blueprints ==<br />
<br />
Blueprints are stored in separate repositories. At the moment there are these repositories:<br />
* https://cgit.kde.org/craft-blueprints-kde.git/tree/ (enabled by default)<br />
<br/><br />
To navigate to this repository on your local file system:<br />
cs craft-blueprints-kde<br />
<br />
Open a file browser in that folder and start adding new recipes by copying from existing ones. <br />
<br />
Note that the name of the package folder needs to match the blueprint name. An example would be <code>kdegraphics-mobipocket\kdegraphics-mobipocket.py</code><br />
<br />
== Advanced tips ==<br />
<br />
=== Hardcode versions of packages ===<br />
Packages are by-default installed from the cache. To build a non default version (or to build from master)<br />
<pre> craft --set version=some_version packagename</pre><br />
<br />
Here, replace <code>some_version</code> with the branch name of the source git repository of the package (like <code>master</code>) or version number (for eg: 0.57.0, 0.58.0).<br />
Alternatively ,edit <tt>$CraftRoot/etc/BlueprintSettings.ini</tt> and add:<br />
<br />
<pre> [category/packagename]<br />
version = branch<br />
</pre><br />
<br />
====== Examples ======<br />
<br />
For example, to install master branch of khtml, the line to be appended should look like:<br />
<br />
[frameworks/khtml]<br />
version = master<br />
<br />
To change the version of all packages of a category, like <code>libs/qt5</code> add<br />
<br />
[libs/qt5]<br />
version = 5.9.3<br />
<br />
==Using Craft with Qt Creator==<br />
<br />
===Windows===<br />
To compile from within Qt Creator, I need to set up a kit.<br />
This is an example for mingw64.<br />
* Add a cmake if none is set: C:\CraftRoot\dev-utils\cmake\bin\cmake.exe<br />
* Add a debugger: C:\CraftRoot\mingw64\bin\gdb.exe<br />
* Add a C++ compiler and a C compiler. Both: C:\CraftRoot\mingw64\bin\gcc.exe<br />
** Ensure that the ABI is correctly set<br />
* Add a Qt: C:\CraftRoot\bin\qmake.exe<br />
* Add a kit with all of the above<br />
* Edit the Environment:<br />
** '''PATH=$(PATH);C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin\; C:\CraftRoot\mingw64\bin'''<br />
* Use the kit on a project<br />
<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\CraftRoot)<br />
<br />
===MacOS===<br />
To be able to use Craft libs in your cmake project from QtCreator follow these steps:<br />
* If the QtVersion used by Craft is not already registered in QtC, then create a new QtVersion by pointing it to the qmake used by Craft<br />
* Create a new kit by duplicating an existing one or creating a new one from scratch<br />
* Setup properties of the kit (for from scratch kit):<br />
** Set cmake binary to the one used by Craft<br />
** Set debugger binary to the one used by Craft<br />
** Set C++ and C compiler to the one used by Craft<br />
** Select the correct QtVersion<br />
** Ensure abi is correct<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};/Volumes/Projects/Developers/Craft)<br />
* Edit the Environment:<br />
** '''PATH=$(PATH):~/CraftRoot/bin:~/CraftRoot/dev-utils/bin/'''<br />
** '''QT_PLUGIN_PATH=~/CraftRoot/bin/plugins'''<br />
* Apply, and now use this Kit for your cmake project<br />
<br />
== Debugging a standalone app with symbols ==<br />
Craft by default uses RelWithDebInfo build type. As such, each library and executable is compiled with the release symbols stripped from the main file and saved separately in a corresponding .pdb file on Windows and .dSYM package on Mac. <br />
<br />
Those symbols will not be included in a final redistributable package generated by craft (--package option). However, if PackageDebugSymbols is enabled in CraftSettings.ini, a separate archive will be created will all the debug symbols combined.<br />
<br />
If an issue you're trying to debug is specific to a packaged app only, you can use Qt Creator's Debug -> Start and Debug External Application option to run the packaged app and automatically attach to it:<br />
<br />
* In "Local Executable" provide a path to executable file inside the .app container, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/archive/Applications/KDE/kmymoney.app/Contents/MacOS/kmymoney<br />
* In "Debug information" provide a path to debug symbols package generate by craft, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/image-RelWithDebInfo-master/Applications/KDE<br />
* check "Break at main" if it's your initial setup to make sure everything works as expected<br />
* Optionally add the Source Paths Mapping (Preferences -> Debugger) if your local source code location doesn't match the one used to generate the package debugged, resulting in the main() break showing a disassembled code.<br />
<br />
== Troubleshooting ==<br />
<br />
If a package fails to build, you'll be greeted with something like:<br />
<br />
...<br />
craft warning: while running make cmd: jom<br />
craft warning: Action: compile for libs/qt5/qtbase FAILED<br />
*** Craft all failed: all of libs/qtbase failed after 0:07:25 ***<br />
craft error: fatal error: package libs/qtbase all failed<br />
<br />
In order to figure out ''what'' failed, grep the command line output ''above'' for errors.<br />
<br />
Or have a look at the log file located in <tt>$HOME/.craft</tt> (<tt>%USERPROFILE%\.craft</tt> on Windows) which will contain much more details.<br />
<br />
Search for "error", or "error:" in the file.<br />
<br />
== News ==<br />
[https://the2ring.blogspot.de/search/label/Craft Blog]<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-windows #kde-craft] on freenode (join via web chat: http://webchat.freenode.net/?channels=kde-craft)<br />
<br />
* [https://bugs.kde.org/enter_bug.cgi?product=Craft Report bugs]<br />
<br />
* Mailing list: [mailto:kde-windows@kde.org kde-windows@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-windows subscribe], [http://lists.kde.org/?l=kde-windows&r=1&w=2 archives])</div>Wrobeldahttps://community.kde.org/index.php?title=Craft&diff=88201Craft2020-05-09T00:38:48Z<p>Wrobelda: /* Debugging standalone app with symbols */</p>
<hr />
<div>Craft is an open source meta build system and package manager. It manages dependencies and builds libraries and applications from source, on ''Windows'', ''Mac'', ''Linux'' and ''FreeBSD''.<br />
<br />
== Setting up Craft ==<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows Start crafting on Windows]<br />
<br />
[https://community.kde.org/Craft/Linux Start crafting on Linux]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Mac#Installation_using_Craft Start crafting on Mac]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/FreeBSD Start crafting on FreeBSD]<br />
<br />
== Common Craft commands ==<br />
<br />
====== Searching for a package ======<br />
craft --search packagename<br />
<br />
====== Installing a package (and dependencies) ======<br />
craft packagename<br />
<br />
====== Uninstalling a package ======<br />
craft --unmerge packagename<br />
<br />
====== Updating a package ======<br />
craft -i packagename<br />
<br />
====== Switching to the source directory of a package ======<br />
cs packagename<br />
<br />
====== Switching to the build directory of a package ======<br />
cb packagename<br />
<br />
====== Compiling a package ====== <br />
if you just modified the source code and want to test-compile:<br />
craft --compile packagename<br />
<br />
====== Creating an installer ======<br />
<code>.dmg</code> bundle, <code>.exe</code> setup, ... for a specific package:<br />
craft --package packagename<br />
The option <code>Packager/PackageType</code> in <tt>CraftSettings.ini</tt> controls which type of installer is created<br />
<br />
==== Developing with Craft ====<br />
<br />
====== Installing a library ======<br />
When developing on a specific application, you may want to develop on its library as well. <br />
craft -i --no-cache <somelib><br />
<code>--no-cache</code> also disables the cache for all missing/outdated dependencies.<br />
====== Testing new changes ======<br />
For the applications to run with changes to the source of the package:<br />
craft --compile --install --qmerge <somelib><br />
<br />
===== Examples =====<br />
<br />
====== Updating Craft itself ======<br />
craft -i craft<br />
<br />
====== Updating the blueprints ======<br />
craft -i craft-blueprints-kde<br />
<br />
== Adding new blueprints ==<br />
<br />
Blueprints are stored in separate repositories. At the moment there are these repositories:<br />
* https://cgit.kde.org/craft-blueprints-kde.git/tree/ (enabled by default)<br />
<br/><br />
To navigate to this repository on your local file system:<br />
cs craft-blueprints-kde<br />
<br />
Open a file browser in that folder and start adding new recipes by copying from existing ones. <br />
<br />
Note that the name of the package folder needs to match the blueprint name. An example would be <code>kdegraphics-mobipocket\kdegraphics-mobipocket.py</code><br />
<br />
== Advanced tips ==<br />
<br />
=== Hardcode versions of packages ===<br />
Packages are by-default installed from the cache. To build a non default version (or to build from master)<br />
<pre> craft --set version=some_version packagename</pre><br />
<br />
Here, replace <code>some_version</code> with the branch name of the source git repository of the package (like <code>master</code>) or version number (for eg: 0.57.0, 0.58.0).<br />
Alternatively ,edit <tt>$CraftRoot/etc/BlueprintSettings.ini</tt> and add:<br />
<br />
<pre> [category/packagename]<br />
version = branch<br />
</pre><br />
<br />
====== Examples ======<br />
<br />
For example, to install master branch of khtml, the line to be appended should look like:<br />
<br />
[frameworks/khtml]<br />
version = master<br />
<br />
To change the version of all packages of a category, like <code>libs/qt5</code> add<br />
<br />
[libs/qt5]<br />
version = 5.9.3<br />
<br />
==Using Craft with Qt Creator==<br />
<br />
===Windows===<br />
To compile from within Qt Creator, I need to set up a kit.<br />
This is an example for mingw64.<br />
* Add a cmake if none is set: C:\CraftRoot\dev-utils\cmake\bin\cmake.exe<br />
* Add a debugger: C:\CraftRoot\mingw64\bin\gdb.exe<br />
* Add a C++ compiler and a C compiler. Both: C:\CraftRoot\mingw64\bin\gcc.exe<br />
** Ensure that the ABI is correctly set<br />
* Add a Qt: C:\CraftRoot\bin\qmake.exe<br />
* Add a kit with all of the above<br />
* Edit the Environment:<br />
** '''PATH=$(PATH);C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin\; C:\CraftRoot\mingw64\bin'''<br />
* Use the kit on a project<br />
<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\CraftRoot)<br />
<br />
===MacOS===<br />
To be able to use Craft libs in your cmake project from QtCreator follow these steps:<br />
* If the QtVersion used by Craft is not already registered in QtC, then create a new QtVersion by pointing it to the qmake used by Craft<br />
* Create a new kit by duplicating an existing one or creating a new one from scratch<br />
* Setup properties of the kit (for from scratch kit):<br />
** Set cmake binary to the one used by Craft<br />
** Set debugger binary to the one used by Craft<br />
** Set C++ and C compiler to the one used by Craft<br />
** Select the correct QtVersion<br />
** Ensure abi is correct<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};/Volumes/Projects/Developers/Craft)<br />
* Edit the Environment:<br />
** '''PATH=$(PATH):~/CraftRoot/bin:~/CraftRoot/dev-utils/bin/'''<br />
** '''QT_PLUGIN_PATH=~/CraftRoot/bin/plugins'''<br />
* Apply, and now use this Kit for your cmake project<br />
<br />
== Debugging standalone app with symbols ==<br />
Craft by default uses RelWithDebInfo build type. As such, each library and executable is compiled with the release symbols stripped from the main file and saved separately in a corresponding .pdb file on Windows and .dSYM package on Mac. <br />
<br />
Those symbols will not be included in a final redistributable package generated by craft (--package option). However, if PackageDebugSymbols is enabled in CraftSettings.ini, a separate archive will be created will all the debug symbols combined.<br />
<br />
If an issue you're trying to debug is specific to a packaged app only, you can use Qt Creator's Debug -> Start and Debug External Application option to run the packaged app and automatically attach to it:<br />
<br />
* In "Local Executable" provide a path to executable file inside the .app container, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/archive/Applications/KDE/kmymoney.app/Contents/MacOS/kmymoney<br />
* In "Debug information" provide a path to debug symbols package generate by craft, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/image-RelWithDebInfo-master/Applications/KDE<br />
* check "Break at main" if it's your initial setup to make sure everything works as expected<br />
* Optionally add the Source Paths Mapping (Preferences -> Debugger) if your local source location doesn't match the one used to generate the package debugged.<br />
<br />
== Troubleshooting ==<br />
<br />
If a package fails to build, you'll be greeted with something like:<br />
<br />
...<br />
craft warning: while running make cmd: jom<br />
craft warning: Action: compile for libs/qt5/qtbase FAILED<br />
*** Craft all failed: all of libs/qtbase failed after 0:07:25 ***<br />
craft error: fatal error: package libs/qtbase all failed<br />
<br />
In order to figure out ''what'' failed, grep the command line output ''above'' for errors.<br />
<br />
Or have a look at the log file located in <tt>$HOME/.craft</tt> (<tt>%USERPROFILE%\.craft</tt> on Windows) which will contain much more details.<br />
<br />
Search for "error", or "error:" in the file.<br />
<br />
== News ==<br />
[https://the2ring.blogspot.de/search/label/Craft Blog]<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-windows #kde-craft] on freenode (join via web chat: http://webchat.freenode.net/?channels=kde-craft)<br />
<br />
* [https://bugs.kde.org/enter_bug.cgi?product=Craft Report bugs]<br />
<br />
* Mailing list: [mailto:kde-windows@kde.org kde-windows@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-windows subscribe], [http://lists.kde.org/?l=kde-windows&r=1&w=2 archives])</div>Wrobeldahttps://community.kde.org/index.php?title=Craft&diff=88200Craft2020-05-09T00:33:43Z<p>Wrobelda: </p>
<hr />
<div>Craft is an open source meta build system and package manager. It manages dependencies and builds libraries and applications from source, on ''Windows'', ''Mac'', ''Linux'' and ''FreeBSD''.<br />
<br />
== Setting up Craft ==<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows Start crafting on Windows]<br />
<br />
[https://community.kde.org/Craft/Linux Start crafting on Linux]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Mac#Installation_using_Craft Start crafting on Mac]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/FreeBSD Start crafting on FreeBSD]<br />
<br />
== Common Craft commands ==<br />
<br />
====== Searching for a package ======<br />
craft --search packagename<br />
<br />
====== Installing a package (and dependencies) ======<br />
craft packagename<br />
<br />
====== Uninstalling a package ======<br />
craft --unmerge packagename<br />
<br />
====== Updating a package ======<br />
craft -i packagename<br />
<br />
====== Switching to the source directory of a package ======<br />
cs packagename<br />
<br />
====== Switching to the build directory of a package ======<br />
cb packagename<br />
<br />
====== Compiling a package ====== <br />
if you just modified the source code and want to test-compile:<br />
craft --compile packagename<br />
<br />
====== Creating an installer ======<br />
<code>.dmg</code> bundle, <code>.exe</code> setup, ... for a specific package:<br />
craft --package packagename<br />
The option <code>Packager/PackageType</code> in <tt>CraftSettings.ini</tt> controls which type of installer is created<br />
<br />
==== Developing with Craft ====<br />
<br />
====== Installing a library ======<br />
When developing on a specific application, you may want to develop on its library as well. <br />
craft -i --no-cache <somelib><br />
<code>--no-cache</code> also disables the cache for all missing/outdated dependencies.<br />
====== Testing new changes ======<br />
For the applications to run with changes to the source of the package:<br />
craft --compile --install --qmerge <somelib><br />
<br />
===== Examples =====<br />
<br />
====== Updating Craft itself ======<br />
craft -i craft<br />
<br />
====== Updating the blueprints ======<br />
craft -i craft-blueprints-kde<br />
<br />
== Adding new blueprints ==<br />
<br />
Blueprints are stored in separate repositories. At the moment there are these repositories:<br />
* https://cgit.kde.org/craft-blueprints-kde.git/tree/ (enabled by default)<br />
<br/><br />
To navigate to this repository on your local file system:<br />
cs craft-blueprints-kde<br />
<br />
Open a file browser in that folder and start adding new recipes by copying from existing ones. <br />
<br />
Note that the name of the package folder needs to match the blueprint name. An example would be <code>kdegraphics-mobipocket\kdegraphics-mobipocket.py</code><br />
<br />
== Advanced tips ==<br />
<br />
=== Hardcode versions of packages ===<br />
Packages are by-default installed from the cache. To build a non default version (or to build from master)<br />
<pre> craft --set version=some_version packagename</pre><br />
<br />
Here, replace <code>some_version</code> with the branch name of the source git repository of the package (like <code>master</code>) or version number (for eg: 0.57.0, 0.58.0).<br />
Alternatively ,edit <tt>$CraftRoot/etc/BlueprintSettings.ini</tt> and add:<br />
<br />
<pre> [category/packagename]<br />
version = branch<br />
</pre><br />
<br />
====== Examples ======<br />
<br />
For example, to install master branch of khtml, the line to be appended should look like:<br />
<br />
[frameworks/khtml]<br />
version = master<br />
<br />
To change the version of all packages of a category, like <code>libs/qt5</code> add<br />
<br />
[libs/qt5]<br />
version = 5.9.3<br />
<br />
==Using Craft with Qt Creator==<br />
<br />
===Windows===<br />
To compile from within Qt Creator, I need to set up a kit.<br />
This is an example for mingw64.<br />
* Add a cmake if none is set: C:\CraftRoot\dev-utils\cmake\bin\cmake.exe<br />
* Add a debugger: C:\CraftRoot\mingw64\bin\gdb.exe<br />
* Add a C++ compiler and a C compiler. Both: C:\CraftRoot\mingw64\bin\gcc.exe<br />
** Ensure that the ABI is correctly set<br />
* Add a Qt: C:\CraftRoot\bin\qmake.exe<br />
* Add a kit with all of the above<br />
* Edit the Environment:<br />
** '''PATH=$(PATH);C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin\; C:\CraftRoot\mingw64\bin'''<br />
* Use the kit on a project<br />
<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\CraftRoot)<br />
<br />
===MacOS===<br />
To be able to use Craft libs in your cmake project from QtCreator follow these steps:<br />
* If the QtVersion used by Craft is not already registered in QtC, then create a new QtVersion by pointing it to the qmake used by Craft<br />
* Create a new kit by duplicating an existing one or creating a new one from scratch<br />
* Setup properties of the kit (for from scratch kit):<br />
** Set cmake binary to the one used by Craft<br />
** Set debugger binary to the one used by Craft<br />
** Set C++ and C compiler to the one used by Craft<br />
** Select the correct QtVersion<br />
** Ensure abi is correct<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};/Volumes/Projects/Developers/Craft)<br />
* Edit the Environment:<br />
** '''PATH=$(PATH):~/CraftRoot/bin:~/CraftRoot/dev-utils/bin/'''<br />
** '''QT_PLUGIN_PATH=~/CraftRoot/bin/plugins'''<br />
* Apply, and now use this Kit for your cmake project<br />
<br />
== Debugging standalone app with symbols ==<br />
Craft by default uses RelWithDebInfo build type. As such, each library and executable is compiled with the release symbols stripped from the main file and saved separately in a corresponding .pdb file on Windows and .dSYM package on Mac. <br />
<br />
Those symbols will not be included in a final redistributable package generated by craft (--package option). However, if PackageDebugSymbols is enabled in CraftSettings.ini, a separate archive will be created will all the debug symbols combined.<br />
<br />
If an issue you're trying to debug is specific to a packaged app only, you can use Qt Creator's Debug -> Start and Debug External Application option to run the external app (the packaged one) and attach to it:<br />
<br />
* In "Local Executable" provide a path to executable file inside the .app container, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/archive/Applications/KDE/kmymoney.app/Contents/MacOS/kmymoney<br />
* In "Debug information" provide a path to debug symbols package generate by craft, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/image-RelWithDebInfo-master/Applications/KDE<br />
<br />
== Troubleshooting ==<br />
<br />
If a package fails to build, you'll be greeted with something like:<br />
<br />
...<br />
craft warning: while running make cmd: jom<br />
craft warning: Action: compile for libs/qt5/qtbase FAILED<br />
*** Craft all failed: all of libs/qtbase failed after 0:07:25 ***<br />
craft error: fatal error: package libs/qtbase all failed<br />
<br />
In order to figure out ''what'' failed, grep the command line output ''above'' for errors.<br />
<br />
Or have a look at the log file located in <tt>$HOME/.craft</tt> (<tt>%USERPROFILE%\.craft</tt> on Windows) which will contain much more details.<br />
<br />
Search for "error", or "error:" in the file.<br />
<br />
== News ==<br />
[https://the2ring.blogspot.de/search/label/Craft Blog]<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-windows #kde-craft] on freenode (join via web chat: http://webchat.freenode.net/?channels=kde-craft)<br />
<br />
* [https://bugs.kde.org/enter_bug.cgi?product=Craft Report bugs]<br />
<br />
* Mailing list: [mailto:kde-windows@kde.org kde-windows@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-windows subscribe], [http://lists.kde.org/?l=kde-windows&r=1&w=2 archives])</div>Wrobeldahttps://community.kde.org/index.php?title=Craft&diff=88199Craft2020-05-09T00:31:26Z<p>Wrobelda: /* Using Craft with Qt Creator */</p>
<hr />
<div>Craft is an open source meta build system and package manager. It manages dependencies and builds libraries and applications from source, on ''Windows'', ''Mac'', ''Linux'' and ''FreeBSD''.<br />
<br />
== Setting up Craft ==<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Windows Start crafting on Windows]<br />
<br />
[https://community.kde.org/Craft/Linux Start crafting on Linux]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/Mac#Installation_using_Craft Start crafting on Mac]<br />
<br />
[https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source/FreeBSD Start crafting on FreeBSD]<br />
<br />
== Common Craft commands ==<br />
<br />
====== Searching for a package ======<br />
craft --search packagename<br />
<br />
====== Installing a package (and dependencies) ======<br />
craft packagename<br />
<br />
====== Uninstalling a package ======<br />
craft --unmerge packagename<br />
<br />
====== Updating a package ======<br />
craft -i packagename<br />
<br />
====== Switching to the source directory of a package ======<br />
cs packagename<br />
<br />
====== Switching to the build directory of a package ======<br />
cb packagename<br />
<br />
====== Compiling a package ====== <br />
if you just modified the source code and want to test-compile:<br />
craft --compile packagename<br />
<br />
====== Creating an installer ======<br />
<code>.dmg</code> bundle, <code>.exe</code> setup, ... for a specific package:<br />
craft --package packagename<br />
The option <code>Packager/PackageType</code> in <tt>CraftSettings.ini</tt> controls which type of installer is created<br />
<br />
==== Developing with Craft ====<br />
<br />
====== Installing a library ======<br />
When developing on a specific application, you may want to develop on its library as well. <br />
craft -i --no-cache <somelib><br />
<code>--no-cache</code> also disables the cache for all missing/outdated dependencies.<br />
====== Testing new changes ======<br />
For the applications to run with changes to the source of the package:<br />
craft --compile --install --qmerge <somelib><br />
<br />
===== Examples =====<br />
<br />
====== Updating Craft itself ======<br />
craft -i craft<br />
<br />
====== Updating the blueprints ======<br />
craft -i craft-blueprints-kde<br />
<br />
== Adding new blueprints ==<br />
<br />
Blueprints are stored in separate repositories. At the moment there are these repositories:<br />
* https://cgit.kde.org/craft-blueprints-kde.git/tree/ (enabled by default)<br />
<br/><br />
To navigate to this repository on your local file system:<br />
cs craft-blueprints-kde<br />
<br />
Open a file browser in that folder and start adding new recipes by copying from existing ones. <br />
<br />
Note that the name of the package folder needs to match the blueprint name. An example would be <code>kdegraphics-mobipocket\kdegraphics-mobipocket.py</code><br />
<br />
== Advanced tips ==<br />
<br />
=== Hardcode versions of packages ===<br />
Packages are by-default installed from the cache. To build a non default version (or to build from master)<br />
<pre> craft --set version=some_version packagename</pre><br />
<br />
Here, replace <code>some_version</code> with the branch name of the source git repository of the package (like <code>master</code>) or version number (for eg: 0.57.0, 0.58.0).<br />
Alternatively ,edit <tt>$CraftRoot/etc/BlueprintSettings.ini</tt> and add:<br />
<br />
<pre> [category/packagename]<br />
version = branch<br />
</pre><br />
<br />
====== Examples ======<br />
<br />
For example, to install master branch of khtml, the line to be appended should look like:<br />
<br />
[frameworks/khtml]<br />
version = master<br />
<br />
To change the version of all packages of a category, like <code>libs/qt5</code> add<br />
<br />
[libs/qt5]<br />
version = 5.9.3<br />
<br />
==Using Craft with Qt Creator==<br />
<br />
===Windows===<br />
To compile from within Qt Creator, I need to set up a kit.<br />
This is an example for mingw64.<br />
* Add a cmake if none is set: C:\CraftRoot\dev-utils\cmake\bin\cmake.exe<br />
* Add a debugger: C:\CraftRoot\mingw64\bin\gdb.exe<br />
* Add a C++ compiler and a C compiler. Both: C:\CraftRoot\mingw64\bin\gcc.exe<br />
** Ensure that the ABI is correctly set<br />
* Add a Qt: C:\CraftRoot\bin\qmake.exe<br />
* Add a kit with all of the above<br />
* Edit the Environment:<br />
** '''PATH=$(PATH);C:\CraftRoot\bin;C:\CraftRoot\dev-utils\bin\; C:\CraftRoot\mingw64\bin'''<br />
* Use the kit on a project<br />
<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};C:\CraftRoot)<br />
<br />
===MacOS===<br />
To be able to use Craft libs in your cmake project from QtCreator follow these steps:<br />
* If the QtVersion used by Craft is not already registered in QtC, then create a new QtVersion by pointing it to the qmake used by Craft<br />
* Create a new kit by duplicating an existing one or creating a new one from scratch<br />
* Setup properties of the kit (for from scratch kit):<br />
** Set cmake binary to the one used by Craft<br />
** Set debugger binary to the one used by Craft<br />
** Set C++ and C compiler to the one used by Craft<br />
** Select the correct QtVersion<br />
** Ensure abi is correct<br />
* Setup cmake configuration (all case):<br />
** Extend CMAKE_PREFIX_PATH, add the Craft prefix path (ie: CMAKE_PREFIX_PATH:STRING=%{Qt:QT_INSTALL_PREFIX};/Volumes/Projects/Developers/Craft)<br />
* Edit the Environment:<br />
** '''PATH=$(PATH):~/CraftRoot/bin:~/CraftRoot/dev-utils/bin/'''<br />
** '''QT_PLUGIN_PATH=~/CraftRoot/bin/plugins'''<br />
* Apply, and now use this Kit for your cmake project<br />
<br />
===Debugging standalone app with symbols===<br />
Craft by default uses RelWithDebInfo build type. As such, each library and executable is compiled with the release symbols stripped from the main file and saved separately in a corresponding .pdb file on Windows and .dSYM package on Mac. <br />
<br />
Those symbols will not be included in a final redistributable package generated by craft (--package option). However, if PackageDebugSymbols is enabled in CraftSettings.ini, a separate archive will be created will all the debug symbols combined.<br />
<br />
If an issue you're trying to debug is specific to a packaged app only, you can use Debug -> Start Debugger option to run the external app (the packaged one) and attach to it:<br />
<br />
* In "Local Executable" provide a path to executable file inside the .app container, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/archive/Applications/KDE/kmymoney.app/Contents/MacOS/kmymoney<br />
* In "Debug information" provide a path to debug symbols package generate by craft, e.g. /Volumes/External/CraftRoot/build/extragear/kmymoney/image-RelWithDebInfo-master/Applications/KDE<br />
<br />
== Troubleshooting ==<br />
<br />
If a package fails to build, you'll be greeted with something like:<br />
<br />
...<br />
craft warning: while running make cmd: jom<br />
craft warning: Action: compile for libs/qt5/qtbase FAILED<br />
*** Craft all failed: all of libs/qtbase failed after 0:07:25 ***<br />
craft error: fatal error: package libs/qtbase all failed<br />
<br />
In order to figure out ''what'' failed, grep the command line output ''above'' for errors.<br />
<br />
Or have a look at the log file located in <tt>$HOME/.craft</tt> (<tt>%USERPROFILE%\.craft</tt> on Windows) which will contain much more details.<br />
<br />
Search for "error", or "error:" in the file.<br />
<br />
== News ==<br />
[https://the2ring.blogspot.de/search/label/Craft Blog]<br />
<br />
== Getting in Touch ==<br />
<br />
* IRC: [irc://irc.freenode.net/kde-windows #kde-craft] on freenode (join via web chat: http://webchat.freenode.net/?channels=kde-craft)<br />
<br />
* [https://bugs.kde.org/enter_bug.cgi?product=Craft Report bugs]<br />
<br />
* Mailing list: [mailto:kde-windows@kde.org kde-windows@kde.org] ([https://mail.kde.org/mailman/listinfo/kde-windows subscribe], [http://lists.kde.org/?l=kde-windows&r=1&w=2 archives])</div>Wrobeldahttps://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Build_from_source/Mac&diff=87891Guidelines and HOWTOs/Build from source/Mac2020-03-26T20:27:40Z<p>Wrobelda: Add macOS filesystem case-sensitivity information</p>
<hr />
<div>== Overview ==<br />
<br />
Several methods of building KDE / KF5 on Mac are available, and it is not firmly established, yet, which one is "best". The two main approaches are using either a "stock" version of Qt, or a "patched" Qt. The latter has several patches meant to make KF5-applications work better on Mac. It also follows the file system layout of KDE on Linux, which should mean that KDE applications will be more likely to work correctly, without adjustments.<br />
<br />
There is some hope that the required patches will eventually become available in official Qt packages, but this is not the case as of this writing. The main drawback with this is that Qt has to be compiled on your computer, adding hours to your setup time. The main advantage is that most things can be expected to work out of the box.<br />
<br />
== Installation using patched version of Qt and MacPorts ==<br />
<br />
* [https://guide.macports.org/#installing.macports Install Macports]<br />
** Note: If you have an existing installation of MacPorts ''and'' installed ports that depend on Qt, see [https://mail.kde.org/pipermail/kde-mac/2017-June/005280.html this mail].<br />
* Install git, if you don't have it yet:<br />
sudo port install git <br />
* Get the ports tree for patched qt and frameworks:<br />
# We assume you're doing this in your home directory<br />
cd ~<br />
git clone https://github.com/mkae/macstrop.git<br />
# create index<br />
cd macstrop<br />
portindex<br />
* [https://guide.macports.org/chunked/development.local-repositories.html Register the new ports with Macports]. To do so, edit ${prefix}/etc/macports/sources.conf, where prefix is the root path of your MacPorts installation (/opt/local by default). Add the following line ''above'' any other path specifications (thus making sure it will take precedence):<br />
file:///Users/YourUserName/macstrop<br />
<br />
It is recommended that you build the patched Qt before any frameworks, in order to make extra sure all dependencies are resolved, correctly:<br />
sudo port install qt5-kde<br />
<br />
You can now start building frameworks or applications (if already packaged), using e.g.<br />
sudo port install kf5-parts<br />
sudo port install kf5-kate<br />
sudo port install kf5-frameworkintegration # will get the most common frameworks in one go<br />
<br />
Many ports have additional variants, such as "+docs" for handbooks / API documentation:<br />
sudo port install kf5-kate +docs<br />
port variants kf5-kate # list available variants<br />
port notes kf5-kate # show any notes<br />
<br />
== Installation using Craft ==<br />
<br />
* Install [https://www.python.org/downloads/ Python 3]<br />
* Install [https://developer.apple.com/xcode/ XCode] (at least developper command-line tools suffice):<br />
xcode-select --install<br />
<br />
=== Install Craft ===<br />
curl https://raw.githubusercontent.com/KDE/craft/master/setup/CraftBootstrap.py -o setup.py && python3 setup.py --prefix ~/CraftRoot<br />
<br />
'''Note''': At the time of this writing, with a fresh installation of Python 3.7 or 3.8, this command will fail with "certificate verify failed: unable to get local issuer certificate". To fix this, run the following, ''once'':<br />
/Applications/Python[Version]/Install/Certificates.command<br />
<br />
=== Using craft ===<br />
* Every time you want to use craft in a new shell, you need to set up the craft environment, first:<br />
source ~/CraftRoot/craft/craftenv.sh<br />
<br />
* In this shell, now craft is usable, e.g. to build Kate with all dependencies:<br />
craft kate<br />
<br />
=== Case sensitive filesystem considerations ===<br />
<br />
When building craft packages on case-sensitive filesystem, you will see errors in packages referencing some of the KF5 libraries:<br />
fatal error: 'sonnet/highlighter.h' file not found<br />
<br />
This is a known upstream issue: https://bugs.kde.org/show_bug.cgi?id=419167<br />
<br />
The workaround for now is either to create and mount a case-insensitive disk image for craft usage or to manually create symlinks as needed.</div>Wrobeldahttps://community.kde.org/index.php?title=Guidelines_and_HOWTOs/Build_from_source/Windows&diff=87890Guidelines and HOWTOs/Build from source/Windows2020-03-26T20:21:01Z<p>Wrobelda: Add python27 info</p>
<hr />
<div>''Craft'' is a tool to build the sources and its third-party requirements. It is the '''easy''' way to build software.<br />
<br />
== Setting up craft ==<br />
=== Installing python ===<br />
While Craft is capable of installing an embedded Python version sufficient for most packages, we recommend a full installation of Python. The current version is 3.7. [https://www.python.org/downloads/ Download Python 3.6+] <br />
<br />
Note that some packages may still depend on Python2.7, so if you see following error make sure to install it and update CraftSettings.ini file:<br />
<br />
DEBUG Craft was unable to locate: python2.7, in None<br />
CRITICAL Please have a look on C:\CraftRoot\etc\CraftSettings.ini and make sure that<br />
[Paths]<br />
PYTHON27<br />
Points to a valid Python installation.<br />
<br />
<br />
<br />
=== Setting up a powershell ===<br />
Powershell is required to be at least version 5.0. <br />
If you're running Windows 10 you most probably won't need to update Powershell.<br />
<br />
You can check the version by invocating <tt>$PSVersionTable.PSVersion</tt> in a Powershell terminal.<br />
<br />
In case you need a newer one, we recommend<br />
[https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6 Powershell Core].<br />
<br />
The latest version of the standard powershell can be found [https://www.microsoft.com/en-us/download/details.aspx?id=50395 here].<br />
<br />
=== Setting up a compiler ===<br />
Currently, Craft supports both the MinGW and Microsoft Visual Studio (msvc) compiler.<br />
While MinGW can be installed by Craft, [https://www.visualstudio.com/ Visual Studio] must be installed independently by the user.<br />
<br />
=== Direct X SDK (only for MinGW setups) ===<br />
If you are using the MinGW compiler, in order to compile the Qt5 ''qtbase'' package you will also need to install the [https://www.microsoft.com/en-us/download/details.aspx?id=6812 Microsoft DirectX SDK]. Make sure to open a new command line window after the installation for the environment variables to be set.<br />
<br />
=== (Optional) Enable development mode ===<br />
Windows 10 supports the creation of symbolic links, but only if the development mode is activated.<br />
Allowing symbolic links allows faster (much faster) extraction of archives.<br />
[https://docs.microsoft.com/en-us/windows/uwp/get-started/enable-your-device-for-development Enable development mode]<br />
<br />
=== Installing Craft===<br />
# [https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell?view=powershell-6 Start a PowerShell environment] (Do not use PowerShell ISE, it doesn't work very well with python). It might be required to run it [https://docs.microsoft.com/en-us/powershell/scripting/setup/starting-windows-powershell?view=powershell-6#with-administrative-privileges-run-as-administrator as administrator].<br />
# Allow execution of powershell scripts by executing the following command:<br />
#:<pre>Set-ExecutionPolicy -Scope CurrentUser RemoteSigned</pre><br />
# Install Craft and follow the instructions by executing the following command:<br />
#: <pre>iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/KDE/craft/master/setup/install_craft.ps1'))</pre><br />
# Consider adding exception for the entire craft root directory to your antivirus' exceptions, otherwise build of some packages can fail (example: build of <code>kde/frameworks/tier2/kdoctools</code> when AVG is used).<br />
<br />
<br />
Note: For Microsoft Visual Studio compiler, it's necessary to have VCTOOLSREDISTDIR environment variable pointing to:<br />
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Redist\MSVC\xx.xx.xxxxx" for MSVS 2017 and <br />
VCINSTALLDIR environment pointing to "C:\Program Files (x86)\Microsoft Visual Studio\2015\Community\VC\" for MSVS 2015.<br />
<br />
=== Using the stock Qt SDK===<br />
This will skip all Qt packages and use the official Qt builds instead.<br />
It will work fine for most CMake based recipes but definitely cause problems with QMake based projects.<br />
You will of course also miss all patches we usually apply to Qt.<br />
This is only recommended when you know what you are doing and you won't get support for in our channel.<br />
<br />
To activate the SDK mode adapt the [QtSDK] section in your etc/kdesettings.ini to something like:<br />
[QtSDK]<br />
## Whether to use prebuild Qt binaries.<br />
Enabled = True<br />
## The path to the Qt sdk.<br />
Path = C:\Qt<br />
## The version of Qt.<br />
Version = 5.9<br />
## The compiler version, if you are not sure what to use, have a look at the directory set in QtSDK/Path.<br />
## The compiler must be of the same type as General/KDECOMPILER.<br />
## If you are using mingw please make sure you have installed the mingw using the Qt installer.<br />
Compiler = msvc2017_64<br />
<br />
== Using Craft ==<br />
To use Craft you need to start a Powershell window, point that to <tt>KDEROOT\craft </tt> and run the initalization script. For example:<br />
<br />
C:\CraftRoot\craft\craftenv.ps1<br />
<br />
This tells Craft about your environment settings (e.g. paths). It will load your configuration from <tt>CraftRoot\etc\CraftSettings.ini</tt>. If there are any error messages Craft will not work as expected. The output should look similar to this one (of course with your paths):<br />
<br />
PS C:\CraftRoot\craft>.\craftenv.ps1<br />
Craft : C:\CraftRoot<br />
Version : master<br />
ABI : windows-msvc2017_64-cl<br />
Download directory : C:\CraftRoot\download<br />
<br />
Then [https://community.kde.org/Craft start crafting]</div>Wrobelda