Jump to content

User:Nmariusp: Difference between revisions

From KDE Community Wiki
Nmariusp (talk | contribs)
Nmariusp (talk | contribs)
Reorder page
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
== How to install kde-builder ==
My procedure about how I use [[User:Nmariusp/Qt_Creator|Qt Creator]]


=== How to install kde-builder fast ===
My procedure about how I use [[User:Nmariusp/Clion|JetBrains CLion]]


<pre>
[[User:Nmariusp/Easy|I know how to program using C++. Can I do a KDE MR in less than 2 hours?]]
mkdir -p ~/kde/src
cd ~/kde/src
git clone https://invent.kde.org/sdk/kde-builder.git
cd kde-builder
# Make sure that you have Python >= 3.9.
# Install Python packages from your OS. E.g. on Kubuntu 23.10:
sudo apt install python3-dbus python3-promise python3-yaml python3-setproctitle
./kde-builder --initial-setup
mv ~/.config/kdesrc-buildrc .
# Edit the file ./kdesrc-buildrc as needed.
 
# kde-builder is installed.
# Use ./kde-builder instead of ./kdesrc-build. The command lines are the same.


./kde-builder kconfig
[[User:Nmariusp/More|Advanced topics about how to start programming for KDE]]
./kde-builder kcalc
./kde-builder --run kcalc
# Run kcalc with the KDE theme that is used by your KDE Plasma desktop.
./kde-builder plasma-integration
./kde-builder --run kcalc
./kde-builder frameworks
</pre>


=== How to install kde-builder on KDE neon User Edition ===
== How I install kde-builder ==


Install kde-builder.
<pre>
<pre>
sudo add-apt-repository ppa:deadsnakes/ppa
# Edit the file ~/.config/kde-builder.yaml as needed.
sudo apt update
# In ~/.config/kde-builder.yaml , in the "global:" section:
sudo apt install python3.11
#  cmake-options: >
#    -DCMAKE_BUILD_TYPE=Debug
#    -DBUILD_PYTHON_BINDINGS=OFF
# In ~/.config/kde-builder.yaml , at the end of the "global:" section:
#  ignore-projects:
#    - gpgme
#    - breeze-icons # From time to time, I build breeze-icons. E.g. once per week.
#    - qcoro


python3.11 -m pip install --user pipenv
# kde-builder is installed.
# Restart the computer in order for the PATH environment variable to contain the directory "~/.local/bin".
# Use kde-builder instead of kdesrc-build. The command lines are the same.
# Make sure that the directory "~/.local/bin" is in $PATH.
echo $PATH
which pipenv
# Should say "~/.local/bin/pipenv".


# For building from source code the Python module dbus-python.
kde-builder kconfig
sudo apt install pkgconf cmake libdbus-1-dev libglib2.0-dev python3.11-dev
kde-builder kcalc
 
kde-builder --run kcalc
 
# Run kcalc with the KDE theme that is used by your KDE Plasma desktop.
cd ~/.local/share
kde-builder plasma-integration
git clone https://invent.kde.org/sdk/kde-builder.git
kde-builder --run kcalc
 
# Run kcalc with most KDE so library files from ~/kde/usr, not from /usr.
cd ~/.local/share/kde-builder
# See https://www.youtube.com/watch?v=Xjb09xBIcPU
pipenv install
kde-builder frameworks
 
kde-builder --run kcalc
kate ~/.local/bin/kde-builder
 
#!/bin/bash
 
cd ~/.local/share/kde-builder
pipenv run python kde-builder $@
 
chmod u+x ~/.local/bin/kde-builder
 
# etc. See https://invent.kde.org/sdk/kde-builder
</pre>
</pre>


=== Qt 6 installed using Qt online installer ===
== More topics ==


The homepage of the Qt Framework is https://www.qt.io . Go to this web page, create an online account. https://www.qt.io/download-open-source > "Download the Qt Online Installer" > Linux > "Qt Online Installer for Linux (64-bit)" > download a file named e.g. qt-unified-linux-x64-4.6.1-online.run into the directory e.g. "~/Downloads".
=== How to write the entire verbose STDOUT and STDERR of kdesrc-build to a file ===


<pre>
<pre>
ls -la ~/Downloads # The downloaded file needs to hace the "executable" chmod bit set.
script -eq -c "kdesrc-build kconfig --no-src --no-include-dependencies --refresh-build --debug" ~/a.txt ;  sed -i $'s/\033\[[0-9]\+m//g' ~/a.txt
chmod +x ~/Downloads/qt-unified-linux-x64-4.6.1-online.run
~/Downloads/qt-unified-linux-x64-4.6.1-online.run
</pre>
</pre>


Login using your Qt online account. Next > check the checkbox "I have read and agree to the terms and conditions of using OpenSource Qt", check the checkbox "I'm an individual and do not use Qt for any company" > Next > Next > enable "Help us improve" > Next > Custom installation, notice that the install directory is "~/Qt" > Next. Install the latest version of Qt6 and the latest version of the Qt Creator integrated development environment (IDE). There are some Qt6 components that are not used by KDE and can be left out when installing Qt6 e.g. WebAssembly, Android, Sources, Qt Quick 3D, Qt 3D, "Quick: 3D Physics", "Qt debug Information Files".
The <code>sed</code> part removes the terminal ANSI color escape codes.


In the KDE Plasma app launcher you now have the application "Qt Maintenance Tool".
<code>script -eq -c "command" ~/a.txt</code> is better than <code>command |& tee ~/a.txt</code> because kdesrc-build behaves differently if it is run in a user interactive terminal session (<code>isatty</code>).


Set up kde-builder from scratch as usual.
If using <code>tee</code>, part of the output of kdesrc-build will not be written to file. E.g. the output of the <code>cmake</code> step, the final part of the <code>make -j</code> step, the final part of the <code>make install</code> step.


Edit the file kdesrc-buildrc to look like:
[[User:Nmariusp/Start|How to start programming for KDE]]
 
<pre>
global
...
    qt-install-dir  ~/Qt/6.6.0/gcc_64 # Where to install Qt6 if kdesrc-build supplies it
    libname lib
...
end global
</pre>
 
Make gpgme build:
 
<pre>
sudo su
mkdir -p /home/qt/work
chown -R username:username /home/qt/work
ln -s /home/username/Qt/6.6.0/gcc_64 /home/qt/work/install
ls -la /home/qt/work
</pre>

Latest revision as of 09:52, 31 May 2025

My procedure about how I use Qt Creator

My procedure about how I use JetBrains CLion

I know how to program using C++. Can I do a KDE MR in less than 2 hours?

Advanced topics about how to start programming for KDE

How I install kde-builder

Install kde-builder.

# Edit the file ~/.config/kde-builder.yaml as needed.
# In ~/.config/kde-builder.yaml , in the "global:" section:
#  cmake-options: >
#    -DCMAKE_BUILD_TYPE=Debug
#    -DBUILD_PYTHON_BINDINGS=OFF
# In ~/.config/kde-builder.yaml , at the end of the "global:" section:
#  ignore-projects:
#    - gpgme
#    - breeze-icons # From time to time, I build breeze-icons. E.g. once per week.
#    - qcoro

# kde-builder is installed.
# Use kde-builder instead of kdesrc-build. The command lines are the same.

kde-builder kconfig
kde-builder kcalc
kde-builder --run kcalc
# Run kcalc with the KDE theme that is used by your KDE Plasma desktop.
kde-builder plasma-integration
kde-builder --run kcalc
# Run kcalc with most KDE so library files from ~/kde/usr, not from /usr.
# See https://www.youtube.com/watch?v=Xjb09xBIcPU
kde-builder frameworks
kde-builder --run kcalc

More topics

How to write the entire verbose STDOUT and STDERR of kdesrc-build to a file

script -eq -c "kdesrc-build kconfig --no-src --no-include-dependencies --refresh-build --debug" ~/a.txt ;  sed -i $'s/\033\[[0-9]\+m//g' ~/a.txt

The sed part removes the terminal ANSI color escape codes.

script -eq -c "command" ~/a.txt is better than command |& tee ~/a.txt because kdesrc-build behaves differently if it is run in a user interactive terminal session (isatty).

If using tee, part of the output of kdesrc-build will not be written to file. E.g. the output of the cmake step, the final part of the make -j step, the final part of the make install step.

How to start programming for KDE