[cairo] Build Cairo for iOS iPhone platform

Peter TB Brett peter at peter-b.co.uk
Wed Mar 1 12:54:37 UTC 2017


On 27/02/2017 19:24, cairouser at yahoo.com wrote:
> We've successfully used cairo in an iOS app that was available in the
> appstore for several years. There is nothing in Apple appstore TOS that
> prevents one from using cairo (or any other such library), and we passed
> multiple appstore reviews without issues directly related to library use.
>
> However, cairo support for iOS was tenuous at best. In particular, there
> was never an official optimized pixman release (using ARM
> optimizations), ostensibly because it was designed for Android/Linux
> toolchain and there was no one interested in taking on a proper port to
> iOS toolchain. There was a one-off prebuilt set of ARM optimizations for
> a 32 bit platform, that we've used for a while.
>
> In addition, due to the way Quartz backend was built in older versions,
> it required a use of certain hacks to avoid referencing deprecated API.
> This was presumably remediet in later versions of cairo, unfortunately
> they had several other regressions and we never moved to newer version
> at that time.
>
> Since iOS now requires all applications to support 64 bit platform, and
> there is no corresponding optimized pixman version for 64 bit ARM (same
> issues as previously for 32 bit), we were only able to build a
> non-optimized 64 bit cairo/pixman combination for iOS. The resulting
> product performance was inadequate and stability suffered, so it was not
> made production - and application was subsequently withdrawn last year.
>
> I.e., in my experience, cairo can be built for iOS with non-trivial
> effort. The resulting library will be constrained in both performance
> and stability compared to other officially supported platform versions.

We also use Cairo in our LiveCode runtime environment for iOS apps, for 
its PDF output capabilities.  If using Cairo only for PDF output, the 
problems with pixman are moot.  We vendor the Cairo source code into our 
version control repository and use our own build system rather than the 
Cairo one, though.  I think I have already upstreamed all of the patches 
necessary for getting Cairo to build with the latest iOS and Mac SDKs.

                                           Peter

-- 
Dr Peter Brett <peter at peter-b.co.uk>


More information about the cairo mailing list