summaryrefslogtreecommitdiff
path: root/graphics/MesaLib7/Makefile
blob: 20f04467b80667052d767692128589c712eb8b7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# $NetBSD: Makefile,v 1.9 2017/01/01 14:43:41 wiz Exp $

DISTNAME?=	${MESA_DISTNAME}
PKGNAME=	MesaLib7-${MESA_PKGVERSION}
PKGREVISION=	2
CATEGORIES=	graphics
MASTER_SITES=	${MESA_SITES}
EXTRACT_SUFX=	.tar.bz2

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.mesa3d.org/
COMMENT=	Graphics library similar to SGI's OpenGL

GNU_CONFIGURE_PREFIX=	${LOCALBASE}/MesaLib7

DISTFILES+=		MesaLib-${MESA_VERSION}${EXTRACT_SUFX}
MESA_DISTNAME= 		MesaLib-${MESA_VERSION}
MESA_SITES=		ftp://freedesktop.org/pub/mesa/older-versions/7.x/${MESA_VERSION}/
MESA_VERSION=		7.11.2
MESA_PKGVERSION=	${MESA_VERSION}

GNU_CONFIGURE=		yes
USE_LANGUAGES=		c99 c++
USE_TOOLS+=		automake bison flex gmake pkg-config makedepend
WRKSRC=			${WRKDIR}/Mesa-${MESA_VERSION}
DIST_SUBDIR=		Mesa-${MESA_PKGVERSION}

CONFLICTS+=	xf86driproto<2.0.4

PLIST_VARS=		dri nodri

BUILDLINK_PASSTHRU_RPATHDIRS+=	${PREFIX}/MesaLib7/lib

PKGCONFIG_OVERRIDE+=	src/mesa/drivers/dri/dri.pc.in
PKGCONFIG_OVERRIDE+=	src/mesa/gl.pc.in
PKGCONFIG_OVERRIDE+=	src/mesa/osmesa.pc.in
PKGCONFIG_OVERRIDE+=	src/glw/glw.pc.in

CONFIGURE_ARGS+=	--disable-glu
CONFIGURE_ARGS+=	--disable-glut
CONFIGURE_ARGS+=	--disable-motif
CONFIGURE_ARGS+=	--with-gallium-drivers=""
CONFIGURE_ARGS+=	--disable-gallium-llvm
CONFIGURE_ARGS+=	--disable-egl

.include "glx-config.mk"

PYTHON_FOR_BUILD_ONLY=		tool
PYTHON_VERSIONS_INCOMPATIBLE=	34 35 36 # not yet ported as of 7.11.2

MAKE_ENV+=		MAKE=${GMAKE:Q}

.include "../../mk/compiler.mk"

.if !empty(PKGSRC_COMPILER:Mccc)
CFLAGS+=	-D__FUNCTION__=__FILE__
.endif

.if !empty(PKGSRC_COMPILER:Mclang)
CFLAGS+=	-no-integrated-as -fvisibility=hidden
.endif

BUILDLINK_TRANSFORM.MirBSD+=	rm:-fvisibility=hidden

.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
# XXX This is not quite enough: we will need to patch the makefile
# because it bogusly tries to reuse objects for native tools and target
# libraries, and for cross-compiling the objects need to be built
# separately.  Alternatively, we could just update Mesa to something
# less prehistoric...
SUBST_CLASSES+=		nativecc
SUBST_STAGE.nativecc=	pre-configure
SUBST_MESSAGE.nativecc=	Fix makefiles to compile tools with native cc.
SUBST_FILES.nativecc+=	src/glsl/Makefile
SUBST_SED.nativecc+=	-e 's,$$(CC),$$(APP_CC),g'
SUBST_SED.nativecc+=	-e 's,$$(CXX),$$(APP_CXX),g'
MAKE_FLAGS+=		APP_CC=${NATIVE_CC:Q}
MAKE_FLAGS+=		APP_CXX=${NATIVE_CXX:Q}
.endif

.include "options.mk"

.if !empty(MACHINE_PLATFORM:MNetBSD-[12].*)
##
## NetBSD 2.x and earlier require pthread stubs
##
.  include "../../devel/pthread-stublib/buildlink3.mk"
PTHREAD_STUBLIB= -L${PREFIX}/lib -Wl,-R${PREFIX}/lib -lpthstub
.elif !empty(MACHINE_PLATFORM:MNetBSD-*)
##
## NetBSD 3.x and later have pthread stubs in libc
##
PTHREAD_STUBLIB=
.else
##
## Other platforms may or may not have stubs provided by libc, but pulling in
## threading support via the pthread.buildlink3.mk definitions will provide
## all the necessary interfaces.  This matches the standard configuration for
## most platforms as they appear in "${WRKSRC}/configs", and is necessary
## for successful linking with libGL under many platforms.
##
.include "../../mk/pthread.buildlink3.mk"
PTHREAD_STUBLIB= ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}
.endif
PKGSRC_MAKE_ENV+=	PTHREAD_STUBLIB=${PTHREAD_STUBLIB:Q}
MAKE_ENV+=		PTHREAD_STUBLIB=${PTHREAD_STUBLIB:Q}

.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
MAKE_ENV+=	CROSS_COMPILING=yes
.endif

pre-configure:
	cd ${WRKSRC} && ${MAKE} configure

post-extract:
.if !empty(PKG_OPTIONS:Mdri) && (${OPSYS} == "SunOS")
	${CP} ${FILESDIR}/mapfile.externs ${WRKSRC}/src/mesa/drivers/dri/
.endif
	${CP} ${FILESDIR}/gen_matypes.awk ${WRKSRC}/src/mesa/x86
	${CP} ${FILESDIR}/gen_matypes.sh ${WRKSRC}/src/mesa/x86
	${CHMOD} a+x ${WRKSRC}/src/mesa/x86/gen_matypes.sh

#
# remove include files installed respectively by ../glu and ../glut
#
pre-install:
	${RM} -f ${WRKSRC}/include/GL/glu*.h

.include "../../lang/python/tool.mk"
BUILDLINK_DEPMETHOD.libxml2?=	build
.include "../../textproc/libxml2/buildlink3.mk"
BUILDLINK_API_DEPENDS.glproto+=	glproto>=1.4.11
.include "../../x11/glproto/buildlink3.mk"
.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXi/buildlink3.mk"
.include "../../x11/libXmu/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
.include "../../x11/libXt/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"