[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / graphics / MesaLib

File: [cvs.NetBSD.org] / pkgsrc / graphics / MesaLib / Makefile (download)

Revision 1.148, Fri Apr 26 13:13:59 2019 UTC (8 weeks, 4 days ago) by maya
Branch: MAIN
CVS Tags: HEAD
Changes since 1.147: +2 -2 lines

Omit mentions of python 34 and 35, after those were removed.

- Includes some whitespace changes, to be handled in a separate commit.

# $NetBSD: Makefile,v 1.148 2019/04/26 13:13:59 maya Exp $

DISTNAME=	mesa-11.2.2
PKGNAME=	${DISTNAME:S/mesa/MesaLib/}
PKGREVISION=	11
CATEGORIES=	graphics x11
MASTER_SITES=	ftp://ftp.freedesktop.org/pub/mesa/${PKGVERSION_NOREV}/
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://www.mesa3d.org/
COMMENT=	The Mesa 3D Graphics Library
LICENSE=	mit

GNU_CONFIGURE=	yes
USE_TOOLS+=	bison pkg-config gmake flex
USE_LANGUAGES=	c99 c++
USE_LIBTOOL=	yes

#CFLAGS+=	-g -O0
#CXXFLAGS+=	-g -O0

GCC_REQD+=	4.2

PKGCONFIG_OVERRIDE+=	src/egl/main/egl.pc.in
PKGCONFIG_OVERRIDE+=	src/egl/wayland/wayland-egl/wayland-egl.pc.in
PKGCONFIG_OVERRIDE+=	src/gallium/targets/d3dadapter9/d3d.pc.in
PKGCONFIG_OVERRIDE+=	src/gallium/targets/osmesa/osmesa.pc.in
PKGCONFIG_OVERRIDE+=	src/gallium/targets/xa/xatracker.pc.in
PKGCONFIG_OVERRIDE+=	src/gbm/main/gbm.pc.in
PKGCONFIG_OVERRIDE+=	src/mapi/es1api/glesv1_cm.pc.in
PKGCONFIG_OVERRIDE+=	src/mapi/es2api/glesv2.pc.in
PKGCONFIG_OVERRIDE+=	src/mesa/drivers/dri/dri.pc.in
PKGCONFIG_OVERRIDE+=	src/mesa/drivers/osmesa/osmesa.pc.in
PKGCONFIG_OVERRIDE+=	src/mesa/gl.pc.in

CONFIGURE_ARGS+=		--enable-shared-glapi

# Work around a buildlink and/or libtool bug:
# In the libtool install/relink stage, if we want to link with two static
# archives named libglapi.la but in different directories, bad things happen.
SUBST_CLASSES+=			wrapper-bug
SUBST_STAGE.wrapper-bug=	pre-configure
SUBST_MESSAGE.wrapper-bug=	Renaming glapi-shared/libglapi in Makefiles
SUBST_FILES.wrapper-bug=	src/gbm/Makefile.in
SUBST_FILES.wrapper-bug+=	src/glx/Makefile.in
SUBST_FILES.wrapper-bug+=	src/mapi/Makefile.in
SUBST_FILES.wrapper-bug+=	src/mesa/drivers/x11/Makefile.in
SUBST_SED.wrapper-bug=		-e 's,shared-glapi/libglapi.la,shared-glapi/libglapi_tmp_rename.la,g'
SUBST_SED.wrapper-bug+=		-e 's,libglapi.la,libglapi_impl.la,g'
SUBST_SED.wrapper-bug+=		-e 's,libglapi_tmp_rename.la,libglapi.la,g'

# Replace /etc/drirc with ${PREFIX}/etc/drirc
SUBST_CLASSES+=			drirc
SUBST_STAGE.drirc=		pre-configure
SUBST_MESSAGE.drirc=		Fixing hardcoded /etc/drirc references
SUBST_FILES.drirc+=		src/mesa/drivers/dri/common/xmlconfig.c
SUBST_SED.drirc+=		 -e 's|/etc/|${PREFIX}/etc/|g'

# Required due to clang defaulting to strict C standard by default (no strdup).
CFLAGS.SunOS+=	-D__EXTENSIONS__

.include "../../mk/bsd.prefs.mk"
.include "../../mk/compiler.mk"
.include "options.mk"

.if ${MACHINE_ARCH} == "i386"
CONFIGURE_ARGS+=	--enable-glx-read-only-text
.endif

.if !empty(PKGSRC_COMPILER:Mclang)
SUBST_CLASSES+=		tr1
SUBST_STAGE.tr1=	pre-configure
SUBST_MESSAGE.tr1=	Fixing TR1 C++ namespace
SUBST_FILES.tr1=	src/gallium/drivers/nouveau/codegen/*.h
SUBST_FILES.tr1+=	src/gallium/drivers/nouveau/codegen/*.cpp
SUBST_SED.tr1=		-e 's,std::tr1::,std::,g'
SUBST_SED.tr1+=		-e 's,include <tr1/,include <,g'
.endif

PYTHON_FOR_BUILD_ONLY=	yes
PYTHON_VERSIONS_INCOMPATIBLE=	 36 37 # as of 11.2.2
BUILD_DEPENDS+=		${PYPKGPREFIX}-mako-[0-9]*:../../devel/py-mako
CONFIGURE_ENV+=		ac_cv_prog_PYTHON2=${PYTHONBIN}
.include "../../lang/python/tool.mk"

# Handle platforms without exp2
.if !empty(MACHINE_PLATFORM:MNetBSD-[1-5].*-*)
CPPFLAGS+=	-Dexp2\(x\)=exp\(\(x\)\*M_LN2\)
CPPFLAGS+=	-Dexp2f\(x\)=expf\(\(x\)\*M_LN2\)
.endif

# Manual patch for FDO bug 90311. Don't apply if not on Darwin as there could
# be side effects.
.if ${OPSYS} == "Darwin"
pre-configure: ${WRKDIR}/.manual_patch_done
${WRKDIR}/.manual_patch_done:
	cd ${WRKSRC} && ${TOOLS_PATCH} -z .manual -p0 < ${FILESDIR}/patch-manual_fdo90311
	touch ${.TARGET}
.endif

INSTALLATION_DIRS+=	share/examples/MesaLib

post-install:
	${INSTALL_DATA} ${WRKSRC}/src/mesa/drivers/dri/common/drirc ${DESTDIR}${PREFIX}/share/examples/MesaLib

.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libxcb/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"