Skip to content

Commit

Permalink
[Cairo] v1.18.0 (JuliaPackaging#7454)
Browse files Browse the repository at this point in the history
* [Cairo] v1.18.0

* Update build_tarballs.jl

* Update build_tarballs.jl

* Switch to meson

* Disable tests

* add nipc_rmid_deferred_release fix

* Drop excess args

* disable directwrite fonts

* see if we can get away with less configuring

* simplify build script

* add back fix

* use gcc for all builds

* fix backtrace error

* Rework cross file for meson

* freebsd is fixed

* Update build_tarballs.jl

* Update build_tarball

* Update build_tarballs.jl

* Update build_tarballs.jl

* Update build_tarballs.jl

* fix commit hash

* Update build_tarballs.jl

* Update build_tarballs.jl

* Further meson tweaks

* Fix script for mac

* Reactivate dependencies

* Fix for windows

* Drop lzo for mac

* Freetype fix
  • Loading branch information
jeremiahpslewis authored and amontoison committed Nov 27, 2023
1 parent 0fa7fe9 commit 7ceedf3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 57 deletions.
84 changes: 38 additions & 46 deletions C/Cairo/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,59 @@
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder
name = "Cairo"
version = v"1.16.0"
version = v"1.18.0"

sources = [
ArchiveSource("https://www.cairographics.org/releases/cairo-$(version).tar.xz",
"5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331"),
DirectorySource("./bundled"),
GitSource("https://gitlab.freedesktop.org/cairo/cairo.git",
"3909090108bb2db55330e3eb148aebe664735363"),
]

version = v"1.16.1" # <-- This version number is a lie to build for the experimental platforms

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/cairo-*/
cd $WORKSPACE/srcdir/cairo
if [[ "${target}" == *-mingw* ]]; then
# Link against libssp to fix errors like
# /opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld: .libs/cairo-output-stream.o: in function `memcpy':
# /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/include/string.h:202: undefined reference to `__memcpy_chk'
# /opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld: .libs/cairo-win32-font.o: in function `memcpy':
# /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/include/string.h:202: undefined reference to `__memcpy_chk'
# /opt/x86_64-w64-mingw32/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld: .libs/cairo-pdf-interchange.o: in function `strcat':
# /opt/x86_64-w64-mingw32/x86_64-w64-mingw32/sys-root/include/string.h:234: undefined reference to `__strcat_chk'
atomic_patch -p1 ../patches/mingw-libssp.patch
# autoreconf needs gtkdocize, install it
apk update
apk add gtk-doc
autoreconf -fiv
# Add nipc_rmid_deferred_release = false for non linux builds to avoid running test
if [[ "${target}" != x86_64-linux-* ]]; then
sed -i -e "s~cmake_defaults = .*~cmake_defaults = false\nipc_rmid_deferred_release = false~" ${MESON_TARGET_TOOLCHAIN}
elif [[ "${target}" == "${MACHTYPE}" ]]; then
# Remove system libexpat to avoid confusion
rm /usr/lib/libexpat.so*
fi
# Because `zlib` doesn't have a proper `.pc` file, configure fails to find.
export CPPFLAGS="-I${includedir}"
if [[ "${target}" == *-freebsd* ]]; then
# Fix the error: undefined reference to `backtrace_symbols'
sed -i -e "s~c_link_args = .*~c_link_args = ['-L${includedir}', '-lexecinfo']~" ${MESON_TARGET_TOOLCHAIN}
sed -i -e "s~cpp_link_args = .*~cpp_link_args = ['-L${libdir}', '-lexecinfo']~" ${MESON_TARGET_TOOLCHAIN}
fi
mkdir output && cd output/
# Delete old misleading libtool files
rm -f ${prefix}/lib/*.la
meson .. --cross-file=${MESON_TARGET_TOOLCHAIN} \
-Dfreetype=enabled \
-Dtee=enabled \
-Dpng=enabled \
-Dzlib=enabled \
-Dglib=enabled \
-Ddefault_library=shared \
-Dtests=disabled \
-Ddwrite=disabled
if [[ "${target}" == *-apple-* ]]; then
BACKEND_OPTIONS="--enable-quartz --enable-quartz-image --disable-xcb --disable-xlib"
elif [[ "${target}" == *-mingw* ]]; then
BACKEND_OPTIONS="--enable-win32 --disable-xcb --disable-xlib"
elif [[ "${target}" == *-linux-* ]] || [[ "${target}" == *freebsd* ]]; then
BACKEND_OPTIONS="--enable-xlib --enable-xcb --enable-xlib-xcb"
if [[ "${target}" == *apple* ]]; then
# Fix the error: undefined reference to `backtrace_symbols'
sed -i -e "s~HAVE_CXX11_ATOMIC_PRIMITIVES~HAVE_OS_ATOMIC_OPS~" config.h
echo "#define SIZEOF_VOID_P 8" >> config.h
echo "#define HAVE_UINT64_T 1" >> config.h
echo "#define HAVE_FT_SVG_DOCUMENT 1" >> config.h
fi
./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target} \
--disable-static \
--enable-ft \
--enable-tee \
--enable-svg \
--enable-ps \
--enable-pdf \
--enable-gobject \
--disable-dependency-tracking \
${BACKEND_OPTIONS}
make -j${nproc}
make install
ninja -j${nproc}
ninja install
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = filter!(p -> arch(p) != "armv6l", supported_platforms(; experimental=true))
platforms = supported_platforms()

# The products that we will ensure are always built
products = [
Expand All @@ -83,11 +73,13 @@ dependencies = [
Dependency("Pixman_jll"),
Dependency("libpng_jll"),
Dependency("Fontconfig_jll"),
Dependency("FreeType2_jll"; compat="2.10.4"),
Dependency("Bzip2_jll", v"1.0.8"; compat="1.0.8"),
Dependency("FreeType2_jll"; compat="2.13.1"),
Dependency("Bzip2_jll"; compat="1.0.8"),
Dependency("Xorg_libXext_jll"; platforms=linux_freebsd),
Dependency("Xorg_libXrender_jll"; platforms=linux_freebsd),
Dependency("LZO_jll"),
# Build with LZO errors on macOS:
# /workspace/destdir/include/lzo/lzodefs.h:2197:1: error: 'lzo_cta__3' declared as an array with a negative size
Dependency("LZO_jll"; platforms=filter(!Sys.isapple, platforms)),
Dependency("Zlib_jll"),
# libcairo needs libssp on Windows, which is provided by CSL, but not in all versions of
# Julia. Note that above we're copying libssp to libdir for the versions of Julia where
Expand Down
11 changes: 0 additions & 11 deletions C/Cairo/bundled/patches/mingw-libssp.patch

This file was deleted.

0 comments on commit 7ceedf3

Please sign in to comment.