Compiling via command line SFDK


I want to port some SDL2 stuff written in C to SailfishOS using command line tools. Should be possible with SFDK and Scratchbox 2.

Despite heavy searching the SailfishOS docs and the internet I have found nothing about CLI compiling.

It would be great if somebody knew of a tutorial or some docs.

I think this could help you at least a little:

In order to use sfdk build, you have to have the target architecture set with sfdk config --global --push target SailfishOS- and the accompanying rpm/app-name.spec file which then does all the leg work.

You can drop into the build target shell with sfdk build-shell and manually gcc your way or whatever it is you need to do. Installing packages into the target should be done via the spec file, but you can use sfdk build-shell --maintain and use zypper to install packages.

One nugget: I was stuck with pkgconfig(liblzma) for example and couldn’t figure out how to find out the package name to install manually. Turns out that can be found out with zypper search --provides liblzma.

1 Like

Thanks. Could be more detailed. I will try my best to run gcc via SFDK.

You could have also just written zypper in "pkgconfig(liblzma)"

1 Like

Ah. The string had to be quoted (or escaped). Should have been obvious… Thank you :slight_smile: