Compiling Kicad on Debian Bullseye

With my new hobby, there came the desire to learn to build and design my own PCB. With that in mind, I began to use the open source ecad solution Kicad. Now I became interested in participating in this project, but, to compile the code you have endure a few challenges - you know, collecting the dependencies,installing them, choose the right branch whiche compiles down and so on. Here I want to show you my experience with that.

First, clone the gitlab repository:

git clone https://gitlab.com/kicad/code/kicad.git
git checkout 8.0

Then, you need to install a couple of dependencies I list them in a hopefully complete list

sudo apt-get install cmake libgl-dev libglew-dev libcurl4-openssl-dev ngspice xfonts-scalable libocct-data-exchange-dev
libocct-draw-dev libocct-foundation-dev libocct-modeling-algorithms-dev libocct-modeling-data-dev libocct-ocaf-dev
libocct-visualization-dev protobuf-compiler libprotobuf-dev swig python3 python3-pip libwxgtk3.0-gtk3-dev
unixodbc unixodbc-dev libsecret1

But cmake and wxwidgets both are too old under Debian Bullseye,so you need to install them separately…​

For cmake it is straightforward, you clone the repository and build the program from source:

git clone https://github.com/Kitware/CMake.git
cd CMake
./bootstrap && make && sudo make install

For wxwidgets its a bit harder, you clone the repository with:

git clone https://github.com/wxWidgets/wxWidgets.git
git checkout v3.2.4
cd wxWidgets/
git submodule update --init src/jpeg
git submodule update --init src/tiff
git submodule update --init src/stc/scintilla
git submodule update --init 3rdparty/catch
git submodule update --init 3rdparty/nanosvg
mkdir buildgtk
cd buildgtk/
../configure --with-gtk --prefix=/usr
make -j3
sudo make install

Now you are finally ready to build Kicad itself…​

git clone https://gitlab.com/kicad/code/kicad.git
git checkout 8.0
mkdir -p build/release
cmake  -DCMAKE_BUILD_TYPE=RelWithDebInfo -DKICAD_USE_EGL=ON -DKICAD_WAYLAND=OFF  ../../
make -j3