Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Cairo.jl for AWS Lambda #134

Closed
wants to merge 9 commits into from

Conversation

samoconnor
Copy link

@samoconnor samoconnor commented Apr 28, 2016

See #133

Amazon Linux on the Lambda sandbox meets some of Cairo.jl's dependancies with system libraries.
There is no way to install new system libraries (i.e. no root access and no yum).
freetype and fontconfig are installed as system libraries but the versions are too old for pango.

This PR allows Cairo.jl to use the system versions of libgobject, libffi, libpng and libpixman, while everything else is built form source.

The commits make one change at a time:

  • Remove runtime = false for libraries that are required at runtime (see ldd output in Building Cairo.jl for AWS Lambda #133).
  • remove gettext (nothing depends on it)
  • Add harfbuzz (required by pango)
  • Update libfontconfig version. (and don't try to build libfontconfig against expat).
  • add option JULIA_BINDEPS_DISABLE_SYSTEM_PACKAGE_MANAGERS
  • add option JULIA_BINDEPS_IGNORE_SYSTEM_FONT_LIBS
  • split dependancies into two groups (otherwise no @checked_lib statements are generated in deps.jl).

The resulting deps.jl contains this:

@checked_lib _jl_libgobject "/usr/lib64/libgobject-2.0.so"
@checked_lib _jl_libpango "/var/task/julia/v0.4/Cairo/deps/usr/lib/libpango-1.0.so"
@checked_lib _jl_libpangocairo "/var/task/julia/v0.4/Cairo/deps/usr/lib/libpangocairo-1.0.so"
@checked_lib _jl_libcairo "/var/task/julia/v0.4/Cairo/deps/usr/lib/libcairo.so"

@tkelman
Copy link
Contributor

tkelman commented Apr 28, 2016

is harfbuzz needed everywhere? will need to add package manager sources for it if so, and provide a windows binary source.

the validate hook should just check for required versions or symbols rather than paths and environment variables.

@lobingera
Copy link
Contributor

@tkelman; i'm not an pango expert, but their web-page claims:

Pango is designed to be modular; the core Pango layout engine can be used with different font backends. There are three basic backends, with multiple options for rendering with each.

  • Client side fonts using the FreeType and fontconfig libraries, using HarfBuzz for complex-text handling. Rendering can be with with Cairo or Xft libraries, or directly to an in-memory buffer with no additional libraries.
  • Native fonts on Microsoft Windows using Uniscribe for complex-text handling. Rendering can be done via Cairo or directly using the native Win32 API.
  • Native fonts on MacOS X using CoreText for complex-text handling, rendering via Cairo.

so there seems to be a propability to setup a native system without harfbuzz

@tkelman
Copy link
Contributor

tkelman commented Apr 28, 2016

Not sure. We get all these binaries from winrpm, all the windows-specific BuildProcess lines can likely be deleted since I don't think they've been used in 2+ years. I turned on AppVeyor since it was easy and the package currently works on Windows, better to keep it that way automatically while tweaking BinDeps. The opensuse build service that winrpm downloads from has the cross-compiled libraries including harfbuzz, so that just gets downloaded and seems to work fine. May need to adjust the winrpm provides lines if harfbuzz is going to be added as a separate library_dependency is all.

@samoconnor
Copy link
Author

the validate hook should just check for required versions or symbols rather than paths and environment variables.

But how would we know what version of fontconfig to check for?

If fontconfig version x is installed on my system already, then the pango that is installed by yum install pango will probably work fine with fontconfig version x. However, the pango version installed by Autoconf might require fontconfig version y. There's no way that all the interdependent versions can be kept in sync all the time across platforms and distributions.

In this case I need a way to say "BinDeps should ignore system libraries A and B".

@tkelman
Copy link
Contributor

tkelman commented Apr 28, 2016

The library group functionality is supposed to be preventing that mixed-source scenario of trying to use some libraries from the system and some from source. If it's not doing so that sounds like it may be a BinDeps bug, or a misusage here.

@tkelman
Copy link
Contributor

tkelman commented Apr 28, 2016

JULIA_BINDEPS_DISABLE_SYSTEM_PACKAGE_MANAGERS seems reasonable to me (though it's getting awfully long, maybe drop the SYSTEM part to shorten it up a bit?) but would be better-suited to implement in BinDeps rather than in every package that uses it.

const png_version = "1.5.14"

provides(Sources,
@compat Dict(
URI("http://www.cairographics.org/releases/pixman-0.28.2.tar.gz") => pixman,
URI("http://www.cairographics.org/releases/cairo-1.12.16.tar.xz") => cairo,
URI("http://download.savannah.gnu.org/releases/freetype/freetype-2.4.11.tar.gz") => freetype,
URI("http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.10.2.tar.gz") => fontconfig,
URI("http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.2.tar.gz") => gettext,
URI("https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.2.6.tar.bz2") => harfbuzz,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use HTTPS everywhere possible, or nowhere.

@giordano
Copy link
Contributor

giordano commented Sep 7, 2019

Probably also this one is not necessary after #292

@davidanthoff
Copy link
Contributor

Yeah, I think this PR should be closed. If it is still needed it would need a thorough update, but most likely it is just no longer relevant.

@timholy timholy closed this Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants