Changeset View
Changeset View
Standalone View
Standalone View
graphics/mesa/Makefile
# Created by: Eric Anholt <anholt@FreeBSD.org> | # Created by: Eric Anholt <anholt@FreeBSD.org> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= mesa-dri | PORTNAME= mesa | ||||
PORTVERSION= ${MESAVERSION} | PORTVERSION= ${MESAVERSION} | ||||
PORTREVISION= 9 | |||||
CATEGORIES= graphics | CATEGORIES= graphics | ||||
COMMENT= OpenGL hardware acceleration drivers for DRI2+ | COMMENT= OpenGL hardware acceleration drivers for DRI2+ | ||||
USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence xv xvmc | USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence xv xvmc xrandr xxf86vm xcb | ||||
OPTIONS_DEFINE= VAAPI VDPAU WAYLAND | OPTIONS_DEFINE= VAAPI VDPAU WAYLAND | ||||
OPTIONS_DEFAULT=WAYLAND | OPTIONS_DEFAULT=WAYLAND | ||||
OPTIONS_SUB= yes | OPTIONS_SUB= yes | ||||
VAAPI_CONFIGURE_ENABLE= va | VAAPI_MESON_TRUE= gallium-va | ||||
VAAPI_LIB_DEPENDS= libva.so:multimedia/libva | VAAPI_LIB_DEPENDS= libva.so:multimedia/libva | ||||
VAAPI_USE= XORG=xcb | |||||
VDPAU_CONFIGURE_ENABLE= vdpau | VDPAU_MESON_TRUE= gallium-vdpau | ||||
VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau | VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau | ||||
WAYLAND_DESC= Enable support for the Wayland platform in Vulkan drivers | WAYLAND_DESC= Enable support for the Wayland platform in Vulkan drivers | ||||
WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols | WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols | ||||
WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland | WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland | ||||
.include <bsd.port.options.mk> | .include <bsd.port.options.mk> | ||||
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" | .include "${.CURDIR:H:H}/graphics/mesa/Makefile.common" | ||||
ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST | # Mesa only understands x86_64 and x86 as arches, let it choose for Vulkan in PLIST | ||||
ALL_GALLIUM_DRIVERS= FREEDRENO R300 R600 RADEONSI SVGA SWRAST VC4 | .if ${ARCH} == amd64 | ||||
ALL_VULKAN_DRIVERS= INTEL RADEON | MESA_ARCH= x86_64 | ||||
.elif ${ARCH} == i386 | |||||
MESA_ARCH= x86 | |||||
.endif | |||||
DRI_DRIVERS= SWRAST # classic swrast | ALL_DRI_DRIVERS= i915 i965 r100 r200 | ||||
ALL_GALLIUM_DRIVERS= freedreno r300 r600 radeonsi svga swrast vc4 | |||||
ALL_VULKAN_DRIVERS= intel amd | |||||
DRI_DRIVERS= # | |||||
# Use Gallium as default provider for swrast | |||||
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} | .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} | ||||
GALLIUM_DRIVERS= SWRAST # llvmpipe | GALLIUM_DRIVERS= swrast | ||||
.else | .else | ||||
GALLIUM_DRIVERS= "" | GALLIUM_DRIVERS= # | ||||
.endif | .endif | ||||
VULKAN_DRIVERS= # | VULKAN_DRIVERS= # | ||||
.if ${ARCH} == amd64 || ${ARCH} == i386 \ | .if ${ARCH} == amd64 || ${ARCH} == i386 || ${ARCH} == powerpc || ${ARCH} == powerpc64 | ||||
|| ${ARCH} == powerpc || ${ARCH} == powerpc64 | DRI_DRIVERS+= r100 r200 | ||||
DRI_DRIVERS+= RADEON R200 | GALLIUM_DRIVERS+= r300 r600 radeonsi | ||||
GALLIUM_DRIVERS+= R300 R600 RADEONSI | VULKAN_DRIVERS+= amd | ||||
VULKAN_DRIVERS+= RADEON | |||||
.endif | .endif | ||||
.if ${ARCH} == amd64 || ${ARCH} == i386 | .if ${ARCH} == amd64 || ${ARCH} == i386 | ||||
DRI_DRIVERS+= I915 I965 | DRI_DRIVERS+= i965 i915 | ||||
GALLIUM_DRIVERS+= SVGA | GALLIUM_DRIVERS+= svga | ||||
. if ${OPSYS} == FreeBSD | VULKAN_DRIVERS+= intel | ||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-src_mesa_drivers_dri_i965_intel__screen.c | |||||
. endif | |||||
VULKAN_DRIVERS+= INTEL | |||||
.elif ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 | .elif ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 | ||||
GALLIUM_DRIVERS+= FREEDRENO VC4 | GALLIUM_DRIVERS+= freedreno vc4 | ||||
. if ${ARCH} == armv6 || ${ARCH} == armv7 | |||||
EXTRA_PATCHES+= ${PATCHDIR}/extra-src_gallium_drivers_vc4_Makefile.in | |||||
. endif | .endif | ||||
.endif | |||||
.if ${VULKAN_DRIVERS} | |||||
BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR} | |||||
USE_XORG+= xcb xrandr | |||||
.endif | |||||
LDFLAGS_i386= -Wl,-znotext | LDFLAGS_i386= -Wl,-znotext | ||||
.if ${DRI_DRIVERS} || ${VULKAN_DRIVERS:MINTEL} | .if ${DRI_DRIVERS} || ${VULKAN_DRIVERS:MINTEL} | ||||
. if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld | . if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld | ||||
# --build-id isn't supported by old GNU ld.bfd in base | # --build-id isn't supported by old GNU ld.bfd in base | ||||
USE_BINUTILS= yes | USE_BINUTILS= yes | ||||
LDFLAGS+= -B${LOCALBASE}/bin | LDFLAGS+= -B${LOCALBASE}/bin | ||||
. endif | . endif | ||||
.endif | .endif | ||||
# enables VK_KHR_wayland_surface in Vulkan drivers | # Enables VK_KHR_wayland_surface in Vulkan drivers | ||||
.if ${PORT_OPTIONS:MWAYLAND} && !empty(VULKAN_DRIVERS) | .if ${PORT_OPTIONS:MWAYLAND} && !empty(VULKAN_DRIVERS) | ||||
CONFIGURE_ARGS+= --with-platforms=x11,surfaceless,drm,wayland | MESON_ARGS+= -Dplatforms=x11,surfaceless,drm,wayland | ||||
.endif | .endif | ||||
CONFIGURE_ARGS+= --with-dri-drivers="${DRI_DRIVERS:tl}" \ | # XA is tracked by graphics/libxatracker | ||||
--with-gallium-drivers="${GALLIUM_DRIVERS:tl}" \ | MESON_ARGS+= -Dgallium-xa=false | ||||
--with-vulkan-drivers="${VULKAN_DRIVERS:tl}" | |||||
MESON_ARGS+= -Ddri-drivers="${DRI_DRIVERS:ts,}" \ | |||||
-Dgallium-drivers="${GALLIUM_DRIVERS:ts,}" \ | |||||
-Dvulkan-drivers="${VULKAN_DRIVERS:ts,}" | |||||
.for _d in ${ALL_DRI_DRIVERS} | .for _d in ${ALL_DRI_DRIVERS} | ||||
. if ${DRI_DRIVERS:M${_d}} | . if ${DRI_DRIVERS:M${_d}} | ||||
PLIST_SUB+= ${_d}_DRIVER="" | PLIST_SUB+= ${_d}_DRIVER="" | ||||
. else | . else | ||||
PLIST_SUB+= ${_d}_DRIVER="@comment " | PLIST_SUB+= ${_d}_DRIVER="@comment " | ||||
. endif | . endif | ||||
.endfor | .endfor | ||||
.for _gd in ${ALL_GALLIUM_DRIVERS} | .for _gd in ${ALL_GALLIUM_DRIVERS} | ||||
. if ${GALLIUM_DRIVERS:M${_gd}} | . if ${GALLIUM_DRIVERS:M${_gd}} | ||||
PLIST_SUB+= ${_gd}_GDRIVER="" | PLIST_SUB+= ${_gd}_GDRIVER="" | ||||
. else | . else | ||||
PLIST_SUB+= ${_gd}_GDRIVER="@comment " | PLIST_SUB+= ${_gd}_GDRIVER="@comment " | ||||
. endif | . endif | ||||
.endfor | .endfor | ||||
.for _vd in ${ALL_VULKAN_DRIVERS} | .for _vd in ${ALL_VULKAN_DRIVERS} | ||||
. if ${VULKAN_DRIVERS:M${_vd}} | . if ${VULKAN_DRIVERS:M${_vd}} | ||||
PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${ARCH}" | PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${MESA_ARCH}" | ||||
. else | . else | ||||
PLIST_SUB+= ${_vd}_VDRIVER="@comment " | PLIST_SUB+= ${_vd}_VDRIVER="@comment " | ||||
. endif | . endif | ||||
.endfor | .endfor | ||||
.include "${MASTERDIR}/Makefile.targets" | |||||
post-install: | post-install: | ||||
@${RM} -r ${STAGEDIR}/etc/OpenCL | @${RM} -r ${STAGEDIR}/etc/OpenCL | ||||
@${MKDIR} ${STAGEDIR}${PREFIX}/share/drirc.d | |||||
.include <bsd.port.post.mk> | @${CP} ${WRKSRC}/src/util/00-mesa-defaults.conf ${STAGEDIR}/share/drirc.d |