Building Fritzing 1.0.2 for Slackware 15

25 June 2024
When it comes to prototyping board layout Fritzing is the stand-out best of what is really a pretty bad bunch of programs, especially when compared to what is available for PCBs. It is great for placement of chips and track cuts on strep-board but it starts to become a pain when it comes to perf-board and discrete components, and some of its idiosyncrasies are downright distractive, but it is helpful in a little way when such help is needed.

Fritzing screenshot

Fritzing is unusual in being open-source but pre-compiled binaries are de-facto paid for. Whenever I've used Aisler which was a lot during Covid lockdown I always added a donation to the KiCAD project and the latter has improved a lot since I started using it back in early-2018, but as-is Fritzing has too many issues preventing me using it often enough for me to justify forking out for it. This is an update to the previous building guide since there have been many changes to the dependencies, as well as taking a different approach to getting the build procedure to pick them up.

Building Qt6

At time of writing the SlackBuild for Qt6 is for v6.4.2 but Fritzing requires at least v6.5.3. This snippet downloads the required tarballs and then modifies the build script for the later version of Qt, and some of this is based on a forum post about Slackware and Qt but I have misplaced the link. See the SlackBuild page for up-stream dependencies of Qt6 but these can all be installed via SboPkg.

wget https://slackbuilds.org/slackbuilds/15.0/libraries/qt6.tar.gz tar -xvf qt6.tar.gz cd qt6 wget https://download.qt.io/development_releases/prebuilt/libclang/libclang-release_130-based-linux-Ubuntu20.04-gcc9.3-x86_64.7z wget https://download.qt.io/official_releases/qt/6.5/6.5.3/single/qt-everywhere-src-6.5.3.tar.xz patch -p0 <<EOF --- qt6.SlackBuild.orig +++ qt6.SlackBuild @@ -26,7 +26,7 @@ PRGNAM=qt6 SRCNAM=qt-everywhere-src -VERSION=${VERSION:-6.5.2} +VERSION=${VERSION:-6.5.3} BSCLANG=libclang-release_130-based-linux-Ubuntu20.04-gcc9.3-x86_64 CCACHE=${CCACHE:-OFF} EXAMPLES=${EXAMPLES:-OFF} @@ -87,7 +87,6 @@ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -patch -p1 < $CWD/newer_protobuf_1.patch patch -p1 < $CWD/newer_protobuf_2.patch #Fix compile on -current/gcc13+ @@ -133,9 +132,6 @@ DESTDIR=$PKG cmake --install . --strip cd .. -rm -R $PKG/usr/lib$LIBDIRSUFFIX/cmake/Qt6/QtBuildInternals -rmdir $PKG/usr/lib$LIBDIRSUFFIX/cmake/Qt6/ios -rmdir $PKG/usr/lib$LIBDIRSUFFIX/cmake/Qt6/macos if [ -d "$PKG/usr/phrasebooks" ]; then mv $PKG/usr/phrasebooks $PKG/usr/share/$PRGNAM/ EOF

Once this is done run the SlackBuild script and install the resulting package in the usual way.

Building the dependencies

For all the code snippets below it is assumed the starting point is a directory such as ~/fritzing-src since the Fritzing build scripts in fritzing-app expect to find at least some of the packages one directory up. It also expects specific versions which in many cases are far from the latest available. This time round I found it easier to install most of the dependencies into /opt/fritzing-1.0.2 since qmake usually picks up the package config files, and for the packages it does not it is easier to do some manual installation than to hack around with Makefiles. Things like header files can be cleared out of /opt/fritzing-1.0.2 once the build procedure is complete.

libGit2

wget https://github.com/libgit2/libgit2/archive/refs/tags/v1.7.1.tar.gz tar -xvf v1.7.1.tar.gz cd libgit2-1.7.1 mkdir build cd build cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/opt/fritzing-1.0.2 .. make -j12 make install

QuaZIP

Examining the repository tags it looks like v6.5.3 does not actually exist so no idea why the Fritzing build scripts go looking for quazip-6.5.3-1.4. At time of writing the latest commit is 7f82903e5b4752c5d9ebc36bf8801123c705ad64 and it worked fine, so checkout that commit if things break.

git clone https://github.com/stachenov/quazip.git quazip-6.5.3-1.4 cd quazip-6.5.3-1.4 cmake -S . -B build -D QUAZIP_QT_MAJOR_VERSION=6 cmake --build build cmake --install build --prefix /opt/fritzing-1.0.2 cd /opt/fritzing-1.0.2/include ln -s QuaZip-Qt6-1.4/quazip

Ngspice

wget https://sourceforge.net/projects/ngspice/files/ng-spice-rework/old-releases/40/ngspice-40.tar.gz tar -xvf ngspice-40.tar.gz cd ngspice-40 ln -s src/include

SVG++

The svgpp package is header only so it does not need to be built, just placed somewhere the header can be picked up.

git clone https://github.com/svgpp/svgpp.git cp -r svgpp/include/svgpp /opt/fritzing-1.0.2/include cp -r svgpp/include/exboost /opt/fritzing-1.0.2/include

Clipper

This new dependency is an obscure package which hasn't been updated for almost a decade, and I only found out about it due to some comments in Github. The snippet below is based on the solution given there.

wget https://downloads.sourceforge.net/project/polyclipping/clipper_ver6.4.2.zip unzip clipper_ver6.4.2.zip -d Clipper cd Clipper/cpp cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/opt/fritzing-1.0.2 cmake --build ./build --target install cd /opt/fritzing-1.0.2/include ln -s polyclipping/clipper.hpp cd ../lib64 cp ../lib/libpolyclipping.so* .

OpenSSL

wget https://www.openssl.org/source/openssl-3.0.12.tar.gz tar -xvf openssl-3.0.12.tar.gz cd openssl-3.0.12 ./Configure --prefix=/opt/fritzing-1.0.2 make -j12 make -j12 install

Building & setting up Fritzing

At this point the shell enviornment needs to be setup so things like the correct versionn of Qt are picked up, then Fritzing itself can be downloaded and built. The shell snippets below will do these.

export PKG_CONFIG_PATH=/opt/fritzing-1.0.2/lib64/pkgconfig:$PKG_CONFIG_PATH export PKG_CONFIG_PATH=/opt/fritzing-1.0.2/share/pkgconfig:$PKG_CONFIG_PATH export PATH=/usr/lib64/qt6/bin:$PATH git clone https://github.com/fritzing/fritzing-app.git cd fritzing-app qmake make -j12 cp Fritzing /opt/fritzing-1.0.2

The parts directory that contains Frtizing components needs to be writable by the user, so clone it into ~/.local/share/Fritzing — this is one of the places Fritzing puts stuff anyway so it is as good as anywhere else.

mkdir -p ~/.local/share/Fritzing/fritzing-parts git clone https://github.com/fritzing/fritzing-parts.git ~/.local/share/Fritzing/fritzing-parts

Finally this snippet creates fritzing.sh which is a wrapper that starts Fritzing with the required parameters:

cat > /opt/fritzing-1.0.2/fritzing.sh <<EOF #!/bin/bash /opt/fritzing-1.0.2/Fritzing -f ~/.local/share/Fritzing/fritzing-parts 2>/dev/null EOF chmod +x /opt/fritzing-1.0.2/fritzing.sh

Fritzing file paths

For some reason Fritzing keeps files in several locations and to my knowledge none of these are configurable. I found this annoying as it makes it tricky to reset Fritzing to a clean state when things go wrong, which in the past has been more often than I am comfortable with. Getting rid of cached imported components is particularly irritating.

Remarks

The motive for building the latest Fritzing was needing to have it on the workstation at my “remote” office, as I was getting round to putting time into a prototyping board circuit that has been on my back-burner for some time. The old instructions were also suffering from bit-rot and with the extra dependencies it was better to rewrite rather than update. At the moment I have a preference for using prototyping board rather than PCBs but at the moment all my electronics projects are on a bit of a hiatus.