2020-05-31 11:23:52 +02:00
|
|
|
PORTNAME= mesa
|
2021-09-20 19:41:24 +02:00
|
|
|
DISTVERSION= 21.2-branchpoint-2486
|
|
|
|
DISTVERSIONSUFFIX= -g4807d777c09
|
2020-05-31 11:23:52 +02:00
|
|
|
CATEGORIES= graphics
|
|
|
|
PKGNAMESUFFIX= -devel
|
|
|
|
|
|
|
|
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
|
|
|
|
PATCHFILES+= 55822330540d.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
|
|
|
PATCHFILES+= f6c7569ad9ea.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
2020-09-19 02:25:58 +02:00
|
|
|
PATCHFILES+= cb8f7a253934.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3568
|
2020-05-31 11:23:52 +02:00
|
|
|
PATCHFILES+= 700efacda59c.patch:-p1
|
2021-06-02 15:31:43 +02:00
|
|
|
PATCHFILES+= e141af3ac859.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/issues/966#note_394512
|
2020-06-18 02:55:31 +02:00
|
|
|
PATCHFILES+= 167fa293d7b7.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5464
|
2020-12-05 12:30:02 +01:00
|
|
|
PATCHFILES+= 50433886a3e3.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6881
|
2021-02-20 20:06:21 +01:00
|
|
|
PATCHFILES+= 891152495cf7.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9168
|
2020-05-31 11:23:52 +02:00
|
|
|
|
|
|
|
MAINTAINER= jbeich@FreeBSD.org
|
|
|
|
COMMENT= Bleeding edge Mesa drivers (OpenGL, Vulkan)
|
|
|
|
|
|
|
|
LICENSE= MIT
|
|
|
|
|
2020-09-26 02:41:36 +02:00
|
|
|
ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64 powerpc64le
|
2020-05-31 11:23:52 +02:00
|
|
|
ONLY_FOR_ARCHS_REASON= Limited scope: no old drivers and no software rendering. \
|
|
|
|
See also https://mesamatrix.net/
|
|
|
|
|
2021-08-15 20:44:34 +02:00
|
|
|
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR}
|
2020-06-02 01:25:43 +02:00
|
|
|
LIB_DEPENDS= libdrm.so:graphics/libdrm \
|
2021-08-15 20:44:34 +02:00
|
|
|
libOpenGL.so:graphics/libglvnd \
|
2020-05-31 11:23:52 +02:00
|
|
|
libexpat.so:textproc/expat2
|
2020-06-02 01:25:43 +02:00
|
|
|
.if !exists(/usr/lib/libelf.so)
|
|
|
|
# DragonFly doesn't install it yet
|
|
|
|
LIB_DEPENDS+= libelf.so:devel/libelf
|
|
|
|
.endif
|
2020-05-31 11:23:52 +02:00
|
|
|
|
|
|
|
USES= bison compiler:c++11-lib meson pkgconfig python:3.6+,build shebangfix
|
|
|
|
USE_GITHUB= yes
|
|
|
|
GH_ACCOUNT= mesa3d
|
|
|
|
USE_LDCONFIG= yes
|
2020-06-02 01:25:43 +02:00
|
|
|
BINARY_ALIAS= python=${PYTHON_CMD}
|
2020-05-31 11:23:52 +02:00
|
|
|
SHEBANG_FILES= src/vulkan/overlay-layer/${PORTNAME}-overlay-control.py
|
2020-06-02 01:25:43 +02:00
|
|
|
MESON_ARGS= -Dgallium-omx=disabled \
|
2020-05-31 11:23:52 +02:00
|
|
|
-Dgallium-opencl=disabled \
|
2020-06-08 17:06:42 +02:00
|
|
|
-Dgallium-xa=disabled \
|
|
|
|
-Dgallium-xvmc=disabled \
|
2021-07-15 22:55:03 +02:00
|
|
|
-Dglvnd=true \
|
2020-07-11 02:46:20 +02:00
|
|
|
-Dplatforms=${PLATFORMS:O:[-1..1]:ts,} \
|
2020-06-08 17:06:58 +02:00
|
|
|
${BINARY_ALIAS:D--native-file=binary_alias.ini} \
|
2020-05-31 11:23:52 +02:00
|
|
|
${NULL}
|
2020-06-12 09:49:38 +02:00
|
|
|
PLIST_SUB= ARCH=${ARCH:S/amd/x86_/}
|
2020-05-31 11:23:52 +02:00
|
|
|
|
2020-06-02 01:25:43 +02:00
|
|
|
.if exists(/usr/bin/ld.lld) && ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld
|
2020-05-31 11:23:52 +02:00
|
|
|
# --build-id isn't supported by old GNU ld.bfd in base
|
|
|
|
LDFLAGS+= -fuse-ld=lld
|
|
|
|
.endif
|
|
|
|
|
2021-02-26 16:44:59 +01:00
|
|
|
OPTIONS_DEFINE= LIBUNWIND LLVM LTO VAAPI VDPAU VKLAYERS WAYLAND X11 ZSTD
|
|
|
|
OPTIONS_DEFAULT= LIBUNWIND LLVM LTO VAAPI VDPAU VKLAYERS WAYLAND X11 ZSTD
|
2021-02-26 15:48:26 +01:00
|
|
|
OPTIONS_GROUP= DRI GALLIUM VULKAN
|
|
|
|
OPTIONS_GROUP_DRI= i965
|
2021-07-01 17:28:56 +02:00
|
|
|
OPTIONS_GROUP_GALLIUM= crocus iris r600 radeonsi
|
2021-02-26 15:48:26 +01:00
|
|
|
OPTIONS_GROUP_VULKAN= anv radv
|
2020-06-02 01:25:43 +02:00
|
|
|
OPTIONS_EXCLUDE_DragonFly= LIBUNWIND anv
|
2021-02-20 20:06:12 +01:00
|
|
|
OPTIONS_EXCLUDE_i386= LTO # anv: vkcube fails on vkCreateSwapchainKHR
|
2021-02-20 20:41:21 +01:00
|
|
|
OPTIONS_EXCLUDE_powerpc64= ${"${/usr/bin/ld:L:tA}"==/usr/bin/ld.lld:?LTO:} # LLVM bug 47353
|
2021-07-01 17:28:56 +02:00
|
|
|
OPTIONS_EXCLUDE+= ${ARCH:Namd64:Ni386:Nx86_64:C/.+/anv crocus i965 iris/}
|
2021-02-20 20:06:04 +01:00
|
|
|
OPTIONS_EXCLUDE+= ${ARCH:Naarch64:Namd64:Ni386:Npowerpc64:Npowerpc64le:Nx86_64:C/.+/LIBUNWIND/}
|
2020-06-12 09:49:38 +02:00
|
|
|
OPTIONS_EXCLUDE+= ${"${GL_DEFAULT:S/,/ /g:[-1]}"==${.CURDIR:T}:?COINST:}
|
|
|
|
OPTIONS_SLAVE+= ${"${GL_DEFAULT:S/,/ /g:[-1]}"!=${.CURDIR:T}:?COINST:}
|
2020-05-31 11:23:52 +02:00
|
|
|
OPTIONS_SUB= yes
|
|
|
|
|
2020-06-02 01:25:43 +02:00
|
|
|
# Convert options to -D<type>-drivers=<driver1,driver2,etc>
|
2021-02-26 15:48:26 +01:00
|
|
|
.for i in ${OPTIONS_GROUP}
|
2020-06-02 01:25:43 +02:00
|
|
|
MESON_ARGS+= -D${i:tl}-drivers=${${i}_DRIVERS:ts,}
|
2021-02-26 15:48:26 +01:00
|
|
|
. for j in ${OPTIONS_GROUP_${i}}
|
2020-06-02 01:25:43 +02:00
|
|
|
OPTIONS_DEFAULT+= ${j}
|
|
|
|
${j}_VARS+= ${i}_DRIVERS+=${j:S/anv/intel/:S/radv/amd/}
|
|
|
|
. endfor
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
DRI_DESC= Classic OpenGL drivers
|
|
|
|
i965_DESC= GMA 3000 (Gen4) and newer
|
|
|
|
|
|
|
|
GALLIUM_DESC= Unified OpenGL drivers
|
2021-07-01 17:28:56 +02:00
|
|
|
crocus_DESC= Broadwater, Eaglelake, Ironlake, Sandybridge, Ivybridge, Haswell
|
2020-06-02 01:25:43 +02:00
|
|
|
iris_DESC= Broadwell and newer
|
2021-02-26 15:48:31 +01:00
|
|
|
r600_DESC= R600, R700, Evergreen, Northern Islands (implies LLVM)
|
|
|
|
radeonsi_DESC= Southern Islands and newer (implies LLVM)
|
2020-06-02 01:25:43 +02:00
|
|
|
|
2021-02-26 16:44:59 +01:00
|
|
|
VULKAN_DESC= Vulkan drivers
|
|
|
|
anv_DESC= Haswell and newer
|
|
|
|
radv_DESC= Southern Islands and newer (implies LLVM)
|
|
|
|
|
2020-06-12 09:49:38 +02:00
|
|
|
COINST_DESC= Allow co-installation with another Mesa port
|
|
|
|
COINST_MESON_ON= -Degl-lib-suffix=${PKGNAMESUFFIX}
|
|
|
|
COINST_PLIST_SUB= SUFFIX=${PKGNAMESUFFIX}
|
|
|
|
COINST_SUB_FILES= libmap.conf
|
|
|
|
COINST_SUB_LIST= SUFFIX=${PKGNAMESUFFIX}
|
|
|
|
COINST_PLIST_SUB_OFF= SUFFIX=
|
|
|
|
|
2020-05-31 11:23:52 +02:00
|
|
|
LIBUNWIND_DESC= Use libunwind for stacktraces
|
|
|
|
LIBUNWIND_LIB_DEPENDS= libunwind.so:devel/libunwind
|
2020-06-02 01:25:50 +02:00
|
|
|
LIBUNWIND_MESON_ENABLED= libunwind
|
2020-05-31 11:23:52 +02:00
|
|
|
|
2021-02-26 15:48:31 +01:00
|
|
|
LLVM_DESC= Build with LLVM support (see implies)
|
2021-08-31 01:07:37 +02:00
|
|
|
LLVM_LIB_DEPENDS= libLLVM-${LLVM_DEFAULT:C/^([6-9])0/\1/:S/-devel/14git/}.so:devel/llvm${LLVM_DEFAULT}
|
2020-06-02 01:25:50 +02:00
|
|
|
LLVM_MESON_ENABLED= llvm
|
2020-06-02 01:25:43 +02:00
|
|
|
LLVM_BINARY_ALIAS= llvm-config=llvm-config${LLVM_DEFAULT}
|
|
|
|
.for i in r600 radeonsi radv
|
|
|
|
${i}_IMPLIES+= LLVM
|
|
|
|
.endfor
|
|
|
|
|
2021-02-20 20:06:12 +01:00
|
|
|
LTO_MESON_TRUE= b_lto
|
|
|
|
|
2021-02-26 15:48:31 +01:00
|
|
|
VAAPI_DESC= Hardware encoding/decoding (only r600, radeonsi)
|
2020-05-31 11:23:52 +02:00
|
|
|
VAAPI_BUILD_DEPENDS= libva>0:multimedia/libva
|
2020-06-02 01:25:50 +02:00
|
|
|
VAAPI_MESON_ENABLED= gallium-va
|
2020-05-31 11:23:52 +02:00
|
|
|
|
2021-02-26 15:48:31 +01:00
|
|
|
VDPAU_DESC= Hardware decoding (only r600, radeonsi) (implies X11)
|
2020-05-31 11:23:52 +02:00
|
|
|
VDPAU_BUILD_DEPENDS= libvdpau>0:multimedia/libvdpau
|
2020-06-02 01:25:50 +02:00
|
|
|
VDPAU_MESON_ENABLED= gallium-vdpau
|
2021-02-26 15:48:31 +01:00
|
|
|
VDPAU_IMPLIES= X11
|
2020-05-31 11:23:52 +02:00
|
|
|
|
2021-03-27 01:41:03 +01:00
|
|
|
VKLAYERS_DESC= Vulkan layers: ${VKLAYERS_MESON_ON:C/.*=//} (implies ${VKLAYERS_IMPLIES})
|
2021-02-26 16:44:59 +01:00
|
|
|
VKLAYERS_BUILD_DEPENDS= glslangValidator:graphics/glslang
|
2021-03-27 01:41:03 +01:00
|
|
|
VKLAYERS_MESON_ON= -Dvulkan-layers=device-select,overlay
|
2021-02-26 16:44:59 +01:00
|
|
|
VKLAYERS_IMPLIES= ${"${PORT_OPTIONS:Mradv}":?radv:anv} # any from OPTIONS_GROUP_VULKAN
|
2020-06-02 01:25:43 +02:00
|
|
|
|
2020-05-31 11:23:52 +02:00
|
|
|
WAYLAND_BUILD_DEPENDS= wayland-protocols>0:graphics/wayland-protocols
|
|
|
|
WAYLAND_LIB_DEPENDS= libwayland-server.so:graphics/wayland
|
2020-07-11 02:46:20 +02:00
|
|
|
WAYLAND_VARS= PLATFORMS+=wayland
|
2020-05-31 11:23:52 +02:00
|
|
|
|
|
|
|
X11_USES= xorg
|
|
|
|
X11_USE= XORG=x11,xcb,xdamage,xext,xfixes,xorgproto,xrandr,xshmfence,xxf86vm
|
2020-07-11 02:46:20 +02:00
|
|
|
X11_VARS= PLATFORMS+=x11
|
2020-07-11 02:48:50 +02:00
|
|
|
X11_MESON_OFF= -Dglx=disabled
|
2020-05-31 11:23:52 +02:00
|
|
|
|
|
|
|
ZSTD_DESC= Use ZSTD for shader cache
|
|
|
|
ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd
|
2020-06-02 01:25:50 +02:00
|
|
|
ZSTD_MESON_ENABLED= zstd
|
2020-05-31 11:23:52 +02:00
|
|
|
|
graphics/mesa-devel: unbreak standalone after e502b6db284d0
llvm-config found: NO found '9.0.1' but need '>= 11.0.0'
Run-time dependency LLVM found: NO (tried cmake and config-tool)
Looking for a fallback subproject for the dependency llvm (modules: bitwriter, engine, mcdisassembler, mcjit, core, executionengine, scalaropts, transformutils, instcombine, amdgpu, native, bitreader, ipo, asmparser)
meson.build:1604:2: ERROR: Neither a subproject directory nor a llvm.wrap file was found.
2021-06-22 19:39:44 +02:00
|
|
|
.include <bsd.port.options.mk>
|
|
|
|
|
|
|
|
# Ignore Mk/bsd.default-versions.mk but respect make.conf(5)
|
|
|
|
.if !defined(DEFAULT_VERSIONS) || ! ${DEFAULT_VERSIONS:Mllvm*}
|
2021-06-22 19:59:01 +02:00
|
|
|
LLVM_DEFAULT= 12 # bump if not latest release
|
graphics/mesa-devel: unbreak standalone after e502b6db284d0
llvm-config found: NO found '9.0.1' but need '>= 11.0.0'
Run-time dependency LLVM found: NO (tried cmake and config-tool)
Looking for a fallback subproject for the dependency llvm (modules: bitwriter, engine, mcdisassembler, mcjit, core, executionengine, scalaropts, transformutils, instcombine, amdgpu, native, bitreader, ipo, asmparser)
meson.build:1604:2: ERROR: Neither a subproject directory nor a llvm.wrap file was found.
2021-06-22 19:39:44 +02:00
|
|
|
.endif
|
|
|
|
|
2020-06-08 17:06:58 +02:00
|
|
|
post-extract:
|
|
|
|
# Work around Meson lookup order e.g., llvm-config
|
|
|
|
.if defined(BINARY_ALIAS)
|
|
|
|
@${ECHO_CMD} '[binaries]' >${WRKSRC}/binary_alias.ini
|
|
|
|
@for f in ${BINARY_ALIAS}; do \
|
|
|
|
${ECHO_CMD} "$${f%%=*} = '$${f#*=}'"; \
|
|
|
|
done >>${WRKSRC}/binary_alias.ini
|
|
|
|
.endif
|
|
|
|
|
2020-05-31 11:23:52 +02:00
|
|
|
post-patch:
|
|
|
|
# Extract (snapshot) version from the port instead of empty string
|
|
|
|
@${REINPLACE_CMD} '/MESA_GIT_SHA1/s/""/" (git-${DISTVERSIONSUFFIX:C/.*-g//})"/' \
|
|
|
|
${WRKSRC}/bin/git_sha1_gen.py
|
2020-06-12 09:49:38 +02:00
|
|
|
|
|
|
|
post-patch-COINST-on:
|
2020-05-31 11:23:52 +02:00
|
|
|
@${MV} ${WRKSRC}/src/util/00-${PORTNAME}-defaults.conf \
|
|
|
|
${WRKSRC}/src/util/00-${PKGBASE}-defaults.conf
|
|
|
|
|
2020-06-12 09:49:38 +02:00
|
|
|
post-install-COINST-on:
|
2020-05-31 11:23:52 +02:00
|
|
|
@${INSTALL_DATA} ${WRKDIR}/libmap.conf \
|
|
|
|
${STAGEDIR}${PREFIX}/etc/libmap.d/${PKGBASE}.conf.sample
|
|
|
|
|
|
|
|
.include <bsd.port.mk>
|