Skip to content

deps: compile each dependency as universal binary independently

Ivan Yossi requested to merge ivany/krita:new_buildscript into master

What this MR does: Change fat-binary creation from the entire tree to be created for each package individually This speeds up compilation but helps specially specific package rebuilds. This wasn't a problem when the dev env was single ARCH, but since I moved to a universal build to properly test changes which made any dependency change a time consuming task to rebuilt the tree.

The deps created should perform the same as before. Not all dependencies can be compiled as multi-arch those cases –such as openssl– that rely on tailored assembly code, or some packages were the ARCH flags were improperly escaped and didn't produced correct output (if they finished at all) or every meson reliant dependency; a special macro was created to compile each arch independently and create the fat-binaries before installing. (About meson: From what I could gather and the multiple tests made, meson does not support the creation of fat-binaries).

For testing purposes here is the link to a krita.dmg produced with the dependencies build modified. krita-5.2_new_universal.dmg

The biggest changes are the drop of some meson building projects (on apple) in favor of automake/CMake alternatives this happens for:

  • libtheora (CMake)
  • harfbuzz (CMake)
  • fribidi (CMake)
  • zlib (Apple used autotools project, changed to use CMake)

NOTES:

  • ext_ocio updated to 2.2.1 as it has a fix to allow building as multiarch
  • kis_ExternalProject_Add_macos: is a new macro to create universal binaries from 2 independent archs. This in essence does the same we used to do for the entire tree, but only limited for the current package

below is commit message

Before this commit to create an universal build we compiled the entire tree once for each architecture, using lipo to create the fat-binary in a final step iterating over the entire install directory. This was troublesome and inefficient as any dependency rebuild needed the entire tree to be recompiled to avoid invalidating the tree (having some libs with a missing arch)

This patch creates valid build manager options to instruct multi-arch compile instructions for supported builders (cmake and automake) and provides builder/packages without multi-arch support a local procedure to consolidate fat-bin from two built trees.

specifically:

  • correctly escapes CMAKE_OSX_ARCHITECTURES to pass to cmake and automake configure builders
  • creates a macro helper to compile twice ext packages without support for multiple arch compile using a bash script to handle lipo step
  • removes deprecated code to handle entire dep tree universalization
  • add rebuild command to osxbuild to start rebuilds of given deps

I tested this patch compiles and installs krita on my system

Merge request reports