[reposted from kde-devel] Building KDE statically

Volker Krause vkrause at kde.org
Sat Mar 2 10:20:43 GMT 2019


On Saturday, 2 March 2019 00:23:38 CET Jonathan Schultz wrote:
> If anyone is interested, here is a brief report on something I have been
> working on in my spare time.
> 
> TLDR: Here are some scripts to build KDE frameworks and okular statically
> using gcc/musl and cross-building for mingw:
> https://github.com/jschultz/kde-static Look in the file patch-kde.sh to see
> the interesting stuff.

Interesting, thanks for sharing this! Static builds are also interesting for 
deployment by application bundles (such as APKs on Android), so I'd very much 
like to see the necessary changes to go upstream eventually :)

[...]
> Most of the patches are simply to make CMake handle static dependencies. A
> few deal with ad hoc issues that arose out of static building. The most
> complicated was linking okular's plugins statically, which involved a bit
> of build hacking, but nothing too dreadful (IMHO).

Regarding the transitive dependency issue, I think the cleaner and easier to 
use way is to not add them conditionally to each consuming module, but let the 
CMake config files of the module bringing in that transitive dependency search 
for them. Ie. like https://phabricator.kde.org/
R174:085ac943d0c00dd1d88650ab27c737b709870d9b, but possibly conditional for 
static builds.

[...]
> I also put in some cross-building stuff. Since kdesrc-build seems not to do
> a good job with host applications required for the building process, I just
> pre-built those and put the executables in the repository. Not all of
> frameworks cross-builds, but enough to link okular does.

Most of them should cross-build, but not all of them follow the canonical 
approach with KF5_HOST_TOOLING yet. The Yocto recipes for KF5 (https://
phabricator.kde.org/source/yocto-meta-kf5/browse/master/recipes-kf5/) might 
contain useful hints on how to cross-compile a given framework.

Regards,
Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190302/1641a78b/attachment.sig>


More information about the Kde-frameworks-devel mailing list