[BACK]Return to hacks.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / graphics / cairo

File: [cvs.NetBSD.org] / pkgsrc / graphics / cairo / hacks.mk (download)

Revision 1.7, Thu Feb 25 13:37:47 2016 UTC (5 years, 9 months ago) by jperkin
Branch: MAIN
CVS Tags: pkgsrc-2021Q3-base, pkgsrc-2021Q3, pkgsrc-2021Q2-base, pkgsrc-2021Q2, pkgsrc-2021Q1-base, pkgsrc-2021Q1, pkgsrc-2020Q4-base, pkgsrc-2020Q4, pkgsrc-2020Q3-base, pkgsrc-2020Q3, pkgsrc-2020Q2-base, pkgsrc-2020Q2, pkgsrc-2020Q1-base, pkgsrc-2020Q1, pkgsrc-2019Q4-base, pkgsrc-2019Q4, pkgsrc-2019Q3-base, pkgsrc-2019Q3, pkgsrc-2019Q2-base, pkgsrc-2019Q2, pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1, pkgsrc-2017Q4-base, pkgsrc-2017Q4, pkgsrc-2017Q3-base, pkgsrc-2017Q3, pkgsrc-2017Q2-base, pkgsrc-2017Q2, pkgsrc-2017Q1-base, pkgsrc-2017Q1, pkgsrc-2016Q4-base, pkgsrc-2016Q4, pkgsrc-2016Q3-base, pkgsrc-2016Q3, pkgsrc-2016Q2-base, pkgsrc-2016Q2, pkgsrc-2016Q1-base, pkgsrc-2016Q1, HEAD
Changes since 1.6: +3 -4 lines

Use OPSYSVARS.

# $NetBSD: hacks.mk,v 1.7 2016/02/25 13:37:47 jperkin Exp $

.if !defined(CAIRO_HACKS_MK)
CAIRO_HACKS_MK=	defined

###
### A workaround for MacPorts Ticket #31469
### https://trac.macports.org/ticket/31469
###
.if ${OPSYS} == "Darwin" && !empty(PKGSRC_COMPILER:Mgcc)
_BAD_GCC_BUILD!=	${CC} --version | (${GREP} -c 'i686-apple-darwin11-llvm-gcc-4\.2\ .*build\ 5658' || ${TRUE})
.  if ${_BAD_GCC_BUILD} == "1"
PKG_HACKS+=		llvm-lto-hack
BUILDLINK_TRANSFORM+=	rm:-flto
.  endif
.endif

# Workaround so that pthread is found on MirBSD
OPSYSVARS+=		PTHREAD_CFLAGS
PTHREAD_CFLAGS.MirBSD=	-fhonour-copts

#
# Workaround for "the pixman problem" with netbsd-5 native X. The
# problem is that if the order of rpath options isn't right when
# linking client programs (right being /usr/pkg before /usr/X11R7),
# the native pixman library gets pulled in instead of the pkgsrc one,
# and then the link fails with undefined symbols from cairo; these are
# symbols that are present only in the newer pkgsrc pixman. The
# problem with rpath options and ordering is complicated by there
# being multiple ways of writing them (-R, -Wl,-rpath, etc.) and as
# many packages just blat out flags from various sources they don't
# necessarily match or come out in the right order.
#
# Some cases of "the pixman problem" were solved with one set of
# changes a month ago or so, but other packages still fail for the
# reasons cited. In the absence of a wrappers-based general solution
# to keep the order correct, most or all remaining instances can be
# solved by explicitly adding the necessary pixman lib to the link
# line instead of pulling it in via cairo's dependency on it. Or at
# least, this fixes the build. It should also make the right things
# happen during library search (I think) but that's less clear. I hate
# ELF.
#
# The best way to explicitly add pixman to the link line is to hack it
# into cairo's .pc file. This is what we do here.
#
# Note that this hack is also required for 5.99 earlier than whatever
# point the necessary updates to X were applied. I'm assuming this is
# old enough that nobody's going to care.
#
.if !empty(MACHINE_PLATFORM:MNetBSD-5.*) && \
    empty(MACHINE_PLATFORM:MNetBSD-5.99.*) && \
    ${X11_TYPE} == "native"
SUBST_CLASSES+=		pixman
SUBST_STAGE.pixman=	post-build
SUBST_MESSAGE.pixman=	Hacking pixman into cairo.pc for the "pixman problem".
SUBST_FILES.pixman=	src/cairo.pc
SUBST_SED.pixman=	-e '/^Libs:/s/-lcairo/-lcairo -lpixman-1/'
.endif

.endif	# CAIRO_HACKS_MK