Skip to content

Commit

Permalink
xcairo: Build the full Cairo and declare conflicts with the main pack…
Browse files Browse the repository at this point in the history
…age.

This seems to be necessary, unfortunately, to avoid strange crashes.
  • Loading branch information
waddlesplash committed Jan 25, 2022
1 parent c5a400e commit f366bf6
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 42 deletions.
5 changes: 3 additions & 2 deletions x11-libs/cairo/cairo-1.16.0.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COPYRIGHT="2000, 2002, 2004-2007 Keith Packard
2002-2010 many others"
LICENSE="GNU LGPL v2.1
MPL v1.1"
REVISION="4"
REVISION="5"
SOURCE_URI="http://cairographics.org/releases/cairo-$portVersion.tar.xz"
CHECKSUM_SHA256="5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331"
PATCHES="cairo-$portVersion.patchset"
Expand Down Expand Up @@ -90,7 +90,8 @@ defineDebugInfoPackage cairo$secondaryArchSuffix \
BUILD()
{
autoreconf -fi
export CFLAGS=-D__BSD_VISIBLE

export CFLAGS="-D__BSD_VISIBLE -g -O2"
runConfigure ./configure \
--disable-static --enable-shared
make $jobArgs
Expand Down
77 changes: 41 additions & 36 deletions x11-libs/cairo/xcairo-1.16.0.recipe
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUMMARY="Multi-platform 2D graphics library"
SUMMARY="Multi-platform 2D graphics library (with Xlib surfaces)"
DESCRIPTION="Cairo is a 2D graphics library with support for multiple output \
devices. Currently supported output targets include the X Window \
System (via both Xlib and XCB), quartz, win32, and image buffers, \
Expand All @@ -19,7 +19,7 @@ COPYRIGHT="2000, 2002, 2004-2007 Keith Packard
2002-2010 many others"
LICENSE="GNU LGPL v2.1
MPL v1.1"
REVISION="3"
REVISION="4"
SOURCE_URI="http://cairographics.org/releases/cairo-$portVersion.tar.xz"
CHECKSUM_SHA256="5e7b29b3f113ef870d1e3ecf8adf21f923396401604bda16d44be45e66052331"
PATCHES="cairo-$portVersion.patchset"
Expand All @@ -28,35 +28,58 @@ SOURCE_DIR="cairo-$portVersion"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

# This recipe MUST be kept in sync with cairo!

libVersion="2.11600.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
xcairo$secondaryArchSuffix = $portVersion
lib:libcairo_xlib$secondaryArchSuffix = $libVersionCompat
lib:libcairo$secondaryArchSuffix = $libVersionCompat
lib:libcairo_gobject$secondaryArchSuffix = $libVersionCompat
lib:libcairo_script_interpreter$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
cairo$secondaryArchSuffix == $portVersion
lib:libfontconfig$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libglib_2.0$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libpixman_1$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libz$secondaryArchSuffix
lib:libX11$secondaryArchSuffix
lib:libXext$secondaryArchSuffix
"
CONFLICTS="
cairo$secondaryArchSuffix
"

PROVIDES_devel="
xcairo${secondaryArchSuffix}_devel = $portVersion
devel:libcairo_xlib$secondaryArchSuffix = $libVersionCompat
devel:libcairo$secondaryArchSuffix = $libVersionCompat
devel:libcairo_gobject$secondaryArchSuffix = $libVersionCompat
devel:libcairo_script_interpreter$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
xcairo$secondaryArchSuffix == $portVersion base
cairo${secondaryArchSuffix}_devel == $portVersion
devel:libglib_2.0$secondaryArchSuffix
devel:libfontconfig$secondaryArchSuffix
devel:libpixman_1$secondaryArchSuffix
devel:libX11$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
cairo${secondaryArchSuffix}_devel == $portVersion
devel:libfontconfig$secondaryArchSuffix
devel:libfreetype$secondaryArchSuffix
devel:libglib_2.0$secondaryArchSuffix
devel:libpixman_1$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libz$secondaryArchSuffix
devel:libX11$secondaryArchSuffix
devel:libXext$secondaryArchSuffix
"
Expand All @@ -72,50 +95,32 @@ BUILD_PREREQUIRES="
"

defineDebugInfoPackage xcairo$secondaryArchSuffix \
"$libDir"/libcairo-xlib.so.$libVersion
"$libDir"/libcairo.so.$libVersion \
"$libDir"/libcairo-gobject.so.$libVersion \
"$libDir"/libcairo-script-interpreter.so.$libVersion

BUILD()
{
autoreconf -fi
export CFLAGS=-D__BSD_VISIBLE
export CFLAGS="-D__BSD_VISIBLE -g -O2"

runConfigure ./configure \
--disable-static --enable-shared \
--enable-xlib
make $jobArgs

# hack: build libcairo-xlib from just the relevant objects
rm -f cairo-tmp.a
# TODO: these symbols should really all be hidden...
ar rcs cairo-tmp.a src/.libs/*.o

gcc -shared -o libcairo-xlib.so \
-lcairo -lpixman-1 -lfreetype -lfontconfig -lX11 -lXext \
-Wl,--no-undefined -Wl,-soname,libcairo-xlib.so.2 \
src/.libs/*xlib*.o cairo-tmp.a
}

INSTALL()
{
# install our custom cairo-xlib
mkdir -p $libDir
cp libcairo-xlib.so $libDir
mv $libDir/libcairo-xlib.so $libDir/libcairo-xlib.so.$libVersion
ln -s libcairo-xlib.so.$libVersion $libDir/libcairo-xlib.so.2
ln -s libcairo-xlib.so.$libVersion $libDir/libcairo-xlib.so

# pkg-config
mkdir -p $developLibDir/pkgconfig/
cp src/cairo-xlib.pc $developLibDir/pkgconfig/
sed -i "s/Libs\\:/Libs\\: -lcairo-xlib/" $developLibDir/pkgconfig/cairo-xlib.pc

# header
mkdir -p $includeDir/cairo
cp src/cairo-xlib.h $includeDir/cairo/
sed -i '/^#if CAIRO_HAS_XLIB_SURFACE.*/i #define CAIRO_HAS_XLIB_SURFACE 1' $includeDir/cairo/cairo-xlib.h
make install

rm $libDir/libcairo*.la

prepareInstalledDevelLibs \
libcairo-xlib
libcairo \
libcairo-gobject \
libcairo-script-interpreter
fixPkgconfig

packageEntries devel \
$developDir
Expand Down
6 changes: 2 additions & 4 deletions x11-libs/gtk3/gtk3-3.24.30.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ REQUIRES="
pango$secondaryArchSuffix
atk$secondaryArchSuffix
gdk_pixbuf$secondaryArchSuffix
xcairo$secondaryArchSuffix
lib:libfontconfig$secondaryArchSuffix
lib:libfreetype$secondaryArchSuffix
lib:libfribidi$secondaryArchSuffix
Expand All @@ -45,8 +46,6 @@ REQUIRES="
lib:libharfbuzz$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libcairo$secondaryArchSuffix
lib:libcairo_xlib$secondaryArchSuffix
lib:libX11$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
Expand All @@ -61,11 +60,10 @@ REQUIRES_devel="
pango${secondaryArchSuffix}_devel
atk${secondaryArchSuffix}_devel
gdk_pixbuf${secondaryArchSuffix}_devel
xcairo${secondaryArchSuffix}_devel
devel:libglib_2.0$secondaryArchSuffix
devel:libGL$secondaryArchSuffix
devel:libepoxy$secondaryArchSuffix
devel:libcairo$secondaryArchSuffix
devel:libcairo_xlib$secondaryArchSuffix
devel:libX11$secondaryArchSuffix
"

Expand Down

0 comments on commit f366bf6

Please sign in to comment.