2020-05-31 11:23:52 +02:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PORTNAME= mesa
|
2020-06-16 02:53:01 +02:00
|
|
|
DISTVERSION= 20.1-branchpoint-1896
|
|
|
|
DISTVERSIONSUFFIX= -g25a629558ca
|
2020-05-31 11:23:52 +02:00
|
|
|
CATEGORIES= graphics
|
|
|
|
PKGNAMESUFFIX= -devel
|
|
|
|
|
|
|
|
PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
|
|
|
|
PATCHFILES+= ee5c7790fa93.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
|
|
|
PATCHFILES+= 9f52b5177728.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
|
|
|
PATCHFILES+= cefdea8105bf.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
|
|
|
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
|
|
|
|
PATCHFILES+= c7a2ab64144b.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
|
|
|
PATCHFILES+= f3b7aba7ed39.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
|
|
|
PATCHFILES+= 23df7d9971dd.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1598
|
|
|
|
PATCHFILES+= ec60ac47860a.patch:-p1
|
|
|
|
PATCHFILES+= 807ae077ab19.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3568
|
|
|
|
PATCHFILES+= 1b10b42fe65e.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1619
|
|
|
|
PATCHFILES+= 9291544ca0bd.patch:-p1
|
|
|
|
PATCHFILES+= 700efacda59c.patch:-p1
|
2020-06-16 02:53:01 +02:00
|
|
|
PATCHFILES+= e86eead1255e.patch:-p1
|
|
|
|
PATCHFILES+= ee6635dea86a.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5463
|
|
|
|
PATCHFILES+= 525b0ed4974f.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5463
|
|
|
|
PATCHFILES+= 7b643e935870.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5462
|
|
|
|
PATCHFILES+= 91c69ccd11e6.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5461
|
|
|
|
PATCHFILES+= b0314147a92b.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5460
|
|
|
|
PATCHFILES+= ba91764bc737.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5464
|
2020-05-31 11:23:52 +02:00
|
|
|
|
|
|
|
MAINTAINER= jbeich@FreeBSD.org
|
|
|
|
COMMENT= Bleeding edge Mesa drivers (OpenGL, Vulkan)
|
|
|
|
|
|
|
|
LICENSE= MIT
|
|
|
|
|
2020-06-02 01:25:43 +02:00
|
|
|
ONLY_FOR_ARCHS= aarch64 amd64 i386 powerpc64
|
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/
|
|
|
|
|
2020-06-02 01:25:43 +02:00
|
|
|
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR}
|
|
|
|
LIB_DEPENDS= libdrm.so:graphics/libdrm \
|
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
|
|
|
|
PLATFORMS= ${PORT_OPTIONS:MX11:tl} ${PORT_OPTIONS:MWAYLAND:tl} drm surfaceless
|
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 \
|
2020-05-31 11:23:52 +02:00
|
|
|
-Dplatforms=${PLATFORMS: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
|
|
|
|
|
2020-06-12 10:23:59 +02:00
|
|
|
OPTIONS_DEFINE= ${OPTIONS_MULTI} LIBUNWIND LLVM NLS VAAPI VDPAU WAYLAND X11 ZSTD
|
|
|
|
OPTIONS_DEFAULT= ${OPTIONS_MULTI} LIBUNWIND LLVM VAAPI VDPAU WAYLAND X11 ZSTD
|
2020-06-02 01:25:43 +02:00
|
|
|
OPTIONS_MULTI= DRI GALLIUM VULKAN
|
|
|
|
OPTIONS_MULTI_DRI= i965
|
|
|
|
OPTIONS_MULTI_GALLIUM= iris r600 radeonsi
|
|
|
|
OPTIONS_MULTI_VULKAN= anv radv
|
|
|
|
OPTIONS_EXCLUDE_DragonFly= LIBUNWIND anv
|
|
|
|
OPTIONS_EXCLUDE+= ${ARCH:Namd64:Ni386:C/.+/anv i965 iris/}
|
|
|
|
OPTIONS_EXCLUDE+= ${ARCH:Naarch64:Namd64:Ni386:C/.+/LIBUNWIND/}
|
2020-06-12 09:49:38 +02:00
|
|
|
OPTIONS_EXCLUDE+= ${"${GL_DEFAULT:S/,/ /g:[-1]}"==${.CURDIR:T}:?COINST:}
|
|
|
|
OPTIONS_EXCLUDE+= ${"${GL_DEFAULT:S/,/ /g:[1]}"!=libglvnd:?GLVND:}
|
|
|
|
OPTIONS_SLAVE+= ${"${GL_DEFAULT:S/,/ /g:[-1]}"!=${.CURDIR:T}:?COINST:}
|
|
|
|
OPTIONS_SLAVE+= ${"${GL_DEFAULT:S/,/ /g:[1]}"==libglvnd:?GLVND:}
|
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>
|
|
|
|
.for i in ${OPTIONS_MULTI}
|
|
|
|
MESON_ARGS+= -D${i:tl}-drivers=${${i}_DRIVERS:ts,}
|
|
|
|
. for j in ${OPTIONS_MULTI_${i}}
|
|
|
|
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
|
|
|
|
iris_DESC= Broadwell and newer
|
|
|
|
r600_DESC= R600, R700, Evergreen, Northern Islands
|
|
|
|
radeonsi_DESC= Southern Islands and newer
|
|
|
|
|
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=
|
|
|
|
|
|
|
|
GLVND_DESC= GL Vendor-Neutral Dispatch support
|
|
|
|
GLVND_BUILD_DEPENDS= libglvnd>0:graphics/libglvnd
|
|
|
|
GLVND_MESON_TRUE= glvnd
|
|
|
|
|
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
|
|
|
|
2020-06-02 01:25:43 +02:00
|
|
|
LLVM_DESC= Build with LLVM support
|
|
|
|
LLVM_LIB_DEPENDS= libLLVM-${LLVM_DEFAULT:C/^([6-9])0/\1/:S/-devel/11/}.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
|
|
|
|
|
2020-06-08 17:06:52 +02:00
|
|
|
NLS_USES= gettext-tools
|
|
|
|
|
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
|
|
|
|
|
|
|
VDPAU_BUILD_DEPENDS= libvdpau>0:multimedia/libvdpau
|
2020-06-02 01:25:50 +02:00
|
|
|
VDPAU_MESON_ENABLED= gallium-vdpau
|
2020-05-31 11:23:52 +02:00
|
|
|
|
2020-06-02 01:25:43 +02:00
|
|
|
VULKAN_DESC= Vulkan drivers and layers
|
|
|
|
VULKAN_BUILD_DEPENDS= glslangValidator:devel/glslang
|
|
|
|
VULKAN_MESON_TRUE= vulkan-device-select-layer vulkan-overlay-layer
|
|
|
|
anv_DESC= Haswell and newer
|
|
|
|
radv_DESC= Southern Islands and newer
|
|
|
|
|
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
|
|
|
|
|
|
|
|
X11_USES= xorg
|
|
|
|
X11_USE= XORG=x11,xcb,xdamage,xext,xfixes,xorgproto,xrandr,xshmfence,xxf86vm
|
|
|
|
X11_MESON_OFF= -Dglx=disabled
|
|
|
|
|
|
|
|
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
|
|
|
|
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-08 17:06:52 +02:00
|
|
|
pre-build-NLS-on:
|
|
|
|
# Meson doesn't automatically generate translations
|
|
|
|
@${DO_MAKE_BUILD} -C ${BUILD_WRKSRC} xmlpool-gmo
|
|
|
|
|
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>
|