Changeset View
Changeset View
Standalone View
Standalone View
graphics/mesa-dri/Makefile.common
- This file was moved from graphics/libGL/Makefile.common.
# Makefile.common - shared code between MesaLib ports. | # Makefile.common - shared code between MesaLib ports. | ||||
# | # | ||||
# !!! Here be dragons !!! (they seem to be everywhere these days) | # !!! Here be dragons !!! (they seem to be everywhere these days) | ||||
# | # | ||||
# Remember to upgrade the following ports everytime you bump MESAVERSION: | # Remember to upgrade the following ports everytime you bump MESAVERSION: | ||||
# | # | ||||
# - graphics/dri | |||||
# - graphics/gbm | |||||
# - graphics/libEGL | |||||
# - graphics/libGL | |||||
# - graphics/libglapi | |||||
# - graphics/libglesv2 | |||||
# - graphics/libosmesa | # - graphics/libosmesa | ||||
# - graphics/mesa-dri | |||||
# - graphics/mesa-libs | |||||
# - lang/clover | # - lang/clover | ||||
# | # | ||||
# $FreeBSD: head/graphics/libGL/Makefile.common 438198 2017-04-10 19:14:48Z rezny $ | # $FreeBSD: head/graphics/mesa-libs/Makefile.common 438198 2017-04-10 19:14:48Z rezny $ | ||||
MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} | MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} | ||||
MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} | MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} | ||||
MESABASEVERSION= 17.0.3 | MESABASEVERSION= 17.0.4 | ||||
# if there is a subversion, don't include the '-' between 7.11-rc2. | # if there is a subversion, don't include the '-' between 7.11-rc2. | ||||
MESASUBVERSION= | MESASUBVERSION= | ||||
MASTER_SITES= https://mesa.freedesktop.org/archive/ \ | MASTER_SITES= https://mesa.freedesktop.org/archive/ \ | ||||
https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \ | https://mesa.freedesktop.org/archive/${MESABASEVERSION}/ \ | ||||
ftp://ftp.freedesktop.org/pub/mesa/ \ | ftp://ftp.freedesktop.org/pub/mesa/ \ | ||||
ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/ | ftp://ftp.freedesktop.org/pub/mesa/${MESABASEVERSION}/ | ||||
DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX} | DISTFILES= mesa-${MESADISTVERSION}${EXTRACT_SUFX} | ||||
MAINTAINER= x11@FreeBSD.org | MAINTAINER= x11@FreeBSD.org | ||||
BUILD_DEPENDS+= makedepend:devel/makedepend | |||||
USES+= compiler:c++11-lib bison gettext-tools gmake libtool \ | USES+= compiler:c++11-lib bison gettext-tools gmake libtool \ | ||||
localbase pathfix pkgconfig python:2,build shebangfix tar:xz | localbase pathfix pkgconfig python:2,build shebangfix tar:xz | ||||
USE_LDCONFIG= yes | USE_LDCONFIG= yes | ||||
GNU_CONFIGURE= yes | GNU_CONFIGURE= yes | ||||
PKGINSTALL= ${.CURDIR}/pkg-install | PKGINSTALL= ${.CURDIR}/pkg-install | ||||
PKGDEINSTALL= ${.CURDIR}/pkg-deinstall | PKGDEINSTALL= ${.CURDIR}/pkg-deinstall | ||||
# only have one port to check with portscout. | # only have one port to check with portscout. | ||||
.if ${PORTNAME} != libGL | .if ${PORTNAME} != mesa-dri | ||||
PORTSCOUT= ignore:1 | PORTSCOUT= ignore:1 | ||||
.endif | .endif | ||||
python_OLD_CMD= "/usr/bin/env[[:space:]]python" | python_OLD_CMD= /usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python | ||||
python_CMD= ${LOCALBASE}/bin/python2 | |||||
SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \ | SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \ | ||||
src/gallium/drivers/svga/svgadump/svga_dump.py \ | src/gallium/drivers/svga/svgadump/svga_dump.py \ | ||||
src/mapi/glapi/gen/*.py | src/gallium/drivers/freedreno/ir3/ir3_nir_trig.py \ | ||||
SHEBANG_FILES+= src/mapi/mapi_abi.py | src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py \ | ||||
src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py \ | |||||
src/mesa/main/get_*.py src/util/format_srgb.py \ | |||||
src/amd/*/*.py src/intel/genxml/gen_pack_header.py | |||||
MASTERDIR= ${.CURDIR}/../../graphics/libGL | MASTERDIR= ${.CURDIR}/../../graphics/mesa-dri | ||||
PATCHDIR= ${MASTERDIR}/files | PATCHDIR= ${MASTERDIR}/files | ||||
WRKSRC= ${WRKDIR}/mesa-${MESADISTVERSION} | WRKSRC= ${WRKDIR}/mesa-${MESADISTVERSION} | ||||
DESCR= ${.CURDIR}/pkg-descr | DESCR= ${.CURDIR}/pkg-descr | ||||
PLIST= ${.CURDIR}/pkg-plist | PLIST= ${.CURDIR}/pkg-plist | ||||
INSTALL_TARGET= install-strip | INSTALL_TARGET= install-strip | ||||
COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} | COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} | ||||
.if (${ARCH} != sparc64 && ${ARCH} != ia64) # no working LLVM | .if (${ARCH} != sparc64 && ${ARCH} != ia64) # no working LLVM | ||||
MESA_LLVM_VER?= 40 | MESA_LLVM_VER?= 40 | ||||
.endif | |||||
.if ${MESA_LLVM_VER} != "" | |||||
BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} | |||||
RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} | |||||
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} | |||||
LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib | LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib | ||||
# The gallium-llvm switch is the global llvm switch for historical reasons | |||||
CONFIGURE_ARGS+= --enable-gallium-llvm | |||||
.else | |||||
CONFIGURE_ARGS+= --disable-gallium-llvm | |||||
.endif | .endif | ||||
# There are issues that need to be fixed to use TLS model "initial-exec" | # There are issues that need to be fixed to use TLS model "initial-exec" | ||||
# So stick with "global-dynamic"'s model for now. kan@ is working on a | # So stick with "global-dynamic"'s model for now. kan@ is working on a | ||||
# patch for rtld. We might want to backport global-dynamic or | # patch for rtld. We might want to backport global-dynamic or | ||||
# pthread_setspecific which it uses now by default. But since this | # pthread_setspecific which it uses now by default. But since this | ||||
# configure switch is going away ... | # configure switch is going away ... | ||||
# https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html | # https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html | ||||
CONFIGURE_ARGS+= --disable-glx-tls | CONFIGURE_ARGS+= --disable-glx-tls | ||||
# libEGL, dri and clover need gallium enabled. | |||||
# the third option in --with-egl-platforms is wayland. | |||||
.if (${MESA_LLVM_VER} != "") | |||||
CONFIGURE_ARGS+= --enable-egl --with-egl-platforms=x11,drm | |||||
.else | |||||
CONFIGURE_ARGS+= --disable-egl | |||||
.endif | |||||
# we don't care about GLes v1 | # we don't care about GLes v1 | ||||
CONFIGURE_ARGS+= --disable-gles1 --enable-gles2 | CONFIGURE_ARGS+= --disable-gles1 | ||||
# Clover (OpenCL). | |||||
.if ${OPSYS} == DragonFly || \ | |||||
(${OPSYS} == FreeBSD && \ | |||||
(${ARCH} == amd64 || ${ARCH} == i386)) | |||||
BUILD_DEPENDS+= libclc>=0.2.0.20160915:devel/libclc | |||||
# We need the clang port too even if it is not used to compile because | |||||
# Clover needs some of the clang includes to build. | |||||
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Mosmesa} != "" | |||||
_USES_pre_configure+= 290:clover-pre-configure | |||||
# .if !exists() evaluates too early before cairo has a chance to be installed | |||||
clover-pre-configure: | |||||
@if [ -e ${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} ] && \ | |||||
! [ -e ${LOCALBASE}/bin/clang${MESA_LLVM_VER} ]; then \ | |||||
${ECHO_MSG} "Your llvm${MESA_LLVM_VER} is not build with clang support, which is required."; \ | |||||
${FALSE}; \ | |||||
fi | |||||
.endif | |||||
CONFIGURE_ARGS+= --enable-opencl --enable-opencl-icd | |||||
.else | |||||
CONFIGURE_ARGS+= --disable-opencl | |||||
.endif | |||||
CONFIGURE_ARGS+= --enable-osmesa --enable-xvmc | |||||
# gallium | |||||
.if (${MESA_LLVM_VER} != "") | |||||
BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} | |||||
.if ${COMPONENT:Mdri} != "" || ${COMPONENT:Mclover} != "" || ${COMPONENT:Megl} != "" | |||||
RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} | |||||
.endif | |||||
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} | |||||
CONFIGURE_ARGS+= --enable-gallium-llvm --enable-llvm-shared-libs | |||||
.else | |||||
CONFIGURE_ARGS+= --disable-gallium-llvm | |||||
.endif | |||||
ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST | |||||
ALL_GALLIUM_DRIVERS= R300 R600 RADEONSI SVGA SWRAST | |||||
.if ${ARCH} == amd64 || ${ARCH} == i386 | |||||
DRI_DRIVERS= I915 I965 RADEON R200 | |||||
GALLIUM_DRIVERS= R300 R600 RADEONSI SVGA | |||||
.endif | |||||
.if ${ARCH} == powerpc || ${ARCH} == powerpc64 | |||||
DRI_DRIVERS= RADEON R200 | |||||
GALLIUM_DRIVERS= R300 R600 RADEONSI | |||||
.endif | |||||
# software rendering for all arches | |||||
DRI_DRIVERS+= SWRAST | |||||
GALLIUM_DRIVERS+= SWRAST | |||||
.for _d in ${ALL_DRI_DRIVERS} | |||||
. if ${DRI_DRIVERS:M${_d}} | |||||
PLIST_SUB+= ${_d}_DRIVER="" | |||||
. else | |||||
PLIST_SUB+= ${_d}_DRIVER="@comment " | |||||
. endif | |||||
.endfor | |||||
CONFIGURE_ARGS+=--with-dri-drivers="${DRI_DRIVERS:tl}" | |||||
.for _gd in ${ALL_GALLIUM_DRIVERS} | |||||
. if ${GALLIUM_DRIVERS:M${_gd}} | |||||
PLIST_SUB+= ${_gd}_GDRIVER="" | |||||
. else | |||||
PLIST_SUB+= ${_gd}_GDRIVER="@comment " | |||||
. endif | |||||
.endfor | |||||
.if (${MESA_LLVM_VER} != "") | |||||
CONFIGURE_ARGS+=--with-gallium-drivers="${GALLIUM_DRIVERS:tl}" | |||||
.endif | |||||
.if ${OPSYS} == DragonFly | .if ${OPSYS} == DragonFly | ||||
LIB_DEPENDS+= libelf.so:devel/libelf | LIB_DEPENDS+= libelf.so:devel/libelf | ||||
.endif | .endif | ||||