Saturday, January 24, 2026

Upgrading Quickbar from SFOS 3 to SFOS 5 #3

So yesterday we found out that an sfdk command line "eats" the debota-sailfishos.pro file. So the next best lead, is to take a closer look at sfdk from github ; this nifty little utility comes in the sailfishos-qtcreator repo. Under the src/tools/sfdk folder we have all the code. But, surprise! There is nothing there. In fact, sfdk issues a qmake command, which in turn is just forwarded to mb2, the original MeeGo (!) build command. Awesome, if you allow me, this kind of legacy archeology is what makes software development so much fun, right? ;)

After taking a closer look at mb2 (it's in the SDK vm, under /usr/bin), I hit somewhat of hint. Al line 2303 (whev!) of mb2, we see:

# 1. Allows to pass extra arguments to qmake
# 2. Enables shadow build by adding path prefix to the project file, or
# 2.1 passing project directory path if the project file was not passed
# 3. Populates variable cache used by Qt Creator to augment its project model

well this actually matches our behavior! So lets try to dump the arguments passed by patching our mb2; and with help of echo , the right place:  

            for arg in "$@"; do
                if [[ $arg == *.pro && -f $src_dir/$arg ]]; then
                    args+=("$src_dir/$arg")
                    pro_passed=1
                else
                    args+=("$arg")
                fi
            done 

becomes:

            for arg in "$@"; do
                echo " ARGUMENT $arg"
                if [[ $arg == *.pro && -f $src_dir/$arg ]]; then
                    args+=("$src_dir/$arg")
                    pro_passed=1
                else
                    args+=("$arg")
                fi
            done
 
and then launching:

<sdk_install_path>/SailfishOS/bin/sfdk -c target=SailfishOS-5.0.0.62-aarch64 qmake /home/tone/checkouts/svn/debota/debota-sailfish.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug 

we can see that indeed there's no .pro file there. Also, a bit below in the mb2 file, we can see :

SRC_DIR=$(quote "${OPT_SRC_DIR:-$PWD}") 

which basically sets a SRC_DIR for a wrapper file (apparently issued then by mb2) via heredoc.  But where is our .pro file reference gone? We will need to  check the arguments passed to mb2 for this. And when looking into that, it appears clear that something is off somewhere. In fact, on line 4893 of mb2, we have  

Now this is interesting. The -p is not present on the command line. It seems to be what we are after; but there's a notice about the option being deprecated. In fact, `mb2 --help` yields a confirmation of this. So this indeed can only mean that building a specific project file is deprecated. As SUS as this sounds; it might just be the case. Might want to check it out. So off to github again; from there a git blame sdk-setup/src/mb2 will give us some hints. And indeed it seems the change in question was meant to remove support of the -p command line option. However, while looking up the changes with gitk on the mb2 file, I noticed this:

"project file selection is done by qmake call inside the .spec file" 

qmake takes extra arguments. In fact, after adding (hint from the spectacle mer documentation (!) :

QMakeOptions: debota-sailfish.pro

to the spec file, the build continues, yay! To the next error:

Project ERROR: contentaction5 development package not found 
And this is progress, even tho small! I think I know what the issue is here; the version of the package might have changed. But since it's time to call it a day, its going to be a problem for another time! :) 

No comments: