mesa*: Switch to meson

Upstream switched to meson for their build system so do the same as
it will be easier to find problems sooner than later.
This also switch to python3, python is only used for the build.
There is more thing enabled by default (or auto-enabled based on some
configuration) so we need to disable a lot more things than with autotools.

This should be a non functional change.

Reviewed by:	zeising (x11@)
Differential Revision:	https:/reviews.freebsd.org/D25092
This commit is contained in:
Emmanuel Vadot 2020-06-05 09:13:57 +00:00
parent ae49030f4b
commit 899ab84a70
22 changed files with 209 additions and 422 deletions

View file

@ -13,18 +13,32 @@ USE_XORG= xorgproto
.include <bsd.port.options.mk>
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
CONFIGURE_ARGS+= --disable-dri --disable-egl --disable-gbm \
--disable-gles2 --with-gallium-drivers=swrast
MESA_BUILD_WRKSRC= src/util src/compiler src/mapi src/mesa
# Disable some options
MESON_ARGS+= -Ddri-drivers="" \
-Dgallium-drivers=swrast \
-Dvulkan-drivers="" \
-Dplatforms="" \
-Dgallium-vdpau=false \
-Dgallium-omx=disabled \
-Dgallium-va=false \
-Dgallium-opencl=disabled \
-Dgallium-xa=false \
-Dgallium-xvmc=false \
-Dgallium-nine=false \
-Dgles1=false \
-Dgles2=false \
-Dopengl=false \
-Dglx=disabled \
-Degl=false \
-Dgbm=false \
-Dtools=""
LDFLAGS_i386= -Wl,-znotext
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
CONFIGURE_ARGS+= --enable-osmesa-gallium
MESA_BUILD_WRKSRC+= src/gallium
MESA_INSTALL_WRKSRC= src/gallium/state_trackers/osmesa src/gallium/targets/osmesa
.if ${ARCH} == sparc64
MESON_ARGS+= -Dosmesa=classic
.else
CONFIGURE_ARGS+= --enable-osmesa
MESA_INSTALL_WRKSRC= src/mesa/drivers/osmesa
MESON_ARGS+= -Dosmesa=gallium
.endif
.include "${MASTERDIR}/Makefile.targets"

View file

@ -3,3 +3,4 @@ lib/libOSMesa.so
lib/libOSMesa.so.8
lib/libOSMesa.so.8.0.0
libdata/pkgconfig/osmesa.pc
@comment share/drirc.d/00-mesa-defaults.conf

View file

@ -8,7 +8,7 @@ CATEGORIES= graphics
COMMENT= Mesa XA state tracker
USES= xorg
USES= xorg meson
USE_XORG= xorgproto
.include <bsd.port.options.mk>
@ -17,22 +17,27 @@ USE_XORG= xorgproto
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= Used only by VMWare supported architectures
CONFIGURE_ARGS+= --disable-dri \
--disable-egl \
--disable-gbm \
--disable-gles2 \
--disable-glx \
--disable-opengl \
--disable-shared-glapi \
--with-gallium-drivers= \
--with-platforms=
MESON_ARGS+= -Ddri-drivers="" \
-Dgallium-drivers="svga" \
-Dvulkan-drivers="" \
-Dgallium-vdpau=false \
-Dgallium-omx=disabled \
-Dgallium-va=false \
-Dgallium-opencl=disabled \
-Dgallium-xvmc=false \
-Dgallium-nine=false \
-Degl=false \
-Dgbm=false \
-Dgles2=false \
-Dglx=disabled \
-Dopengl=false \
-Dshared-glapi=false \
-Dosmesa=none \
-Dplatforms=
MESA_BUILD_WRKSRC= src/util src/compiler
LDFLAGS_i386= -Wl,-znotext
CONFIGURE_ARGS+= --enable-xa
MESA_BUILD_WRKSRC+= src/gallium
MESA_INSTALL_WRKSRC= src/gallium/state_trackers/xa src/gallium/targets/xa
MESA_ARGS+= -Dgallium-xa=true
.include "${MASTERDIR}/Makefile.targets"
.include <bsd.port.post.mk>

View file

@ -5,3 +5,4 @@ lib/libxatracker.so
lib/libxatracker.so.2
lib/libxatracker.so.2.5.0
libdata/pkgconfig/xatracker.pc
@comment share/drirc.d/00-mesa-defaults.conf

View file

@ -3,6 +3,7 @@
PORTNAME= mesa-dri
PORTVERSION= ${MESAVERSION}
PORTREVISION= 1
CATEGORIES= graphics
COMMENT= OpenGL hardware acceleration drivers for DRI2+
@ -14,11 +15,11 @@ OPTIONS_DEFINE= VAAPI VDPAU WAYLAND
OPTIONS_DEFAULT=WAYLAND
OPTIONS_SUB= yes
VAAPI_CONFIGURE_ENABLE= va
VAAPI_MESON_ON= -Dgallium-va=true
VAAPI_LIB_DEPENDS= libva.so:multimedia/libva
VAAPI_USE= XORG=xcb
VDPAU_CONFIGURE_ENABLE= vdpau
VDPAU_MESON_ON= -Dgallium-vdpau=true
VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau
WAYLAND_DESC= Enable support for the Wayland platform in Vulkan drivers
@ -28,11 +29,10 @@ WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland
.include <bsd.port.options.mk>
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST
ALL_DRI_DRIVERS= I915 I965 R100 R200 SWRAST
ALL_GALLIUM_DRIVERS= FREEDRENO R300 R600 RADEONSI SVGA SWRAST VC4
ALL_VULKAN_DRIVERS= INTEL RADEON
ALL_VULKAN_DRIVERS= INTEL AMD
DRI_DRIVERS= SWRAST # classic swrast
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
GALLIUM_DRIVERS= SWRAST # llvmpipe
.else
@ -42,9 +42,10 @@ VULKAN_DRIVERS= #
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == i386 \
|| ${ARCH} == powerpc || ${ARCH} == powerpc64
DRI_DRIVERS+= RADEON R200
DRI_DRIVERS+= R100 R200
GALLIUM_DRIVERS+= R300 R600 RADEONSI
VULKAN_DRIVERS+= RADEON
VULKAN_DRIVERS+= AMD
MESON_ARGS+= -Dgallium-xvmc=true
.endif
.if ${ARCH} == amd64 || ${ARCH} == i386
DRI_DRIVERS+= I915 I965
@ -76,12 +77,21 @@ LDFLAGS+= -B${LOCALBASE}/bin
# enables VK_KHR_wayland_surface in 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
CONFIGURE_ARGS+= --with-dri-drivers="${DRI_DRIVERS:tl}" \
--with-gallium-drivers="${GALLIUM_DRIVERS:tl}" \
--with-vulkan-drivers="${VULKAN_DRIVERS:tl}"
MESON_ARGS+= -Ddri-drivers="${DRI_DRIVERS:ts,:tl}" \
-Dgallium-drivers="${GALLIUM_DRIVERS:ts,:tl}" \
-Dvulkan-drivers="${VULKAN_DRIVERS:ts,:tl}"
# Disable some options
MESON_ARGS+= -Dgallium-xa=false \
-Dgles1=false \
-Dgles2=false \
-Dglx=disabled \
-Degl=false \
-Dosmesa=none \
-Dtools=""
.for _d in ${ALL_DRI_DRIVERS}
. if ${DRI_DRIVERS:M${_d}}
@ -99,9 +109,10 @@ PLIST_SUB+= ${_gd}_GDRIVER="@comment "
. endif
.endfor
PLIST_SUB += ARCH=${ARCH:S/amd/x86_/}
.for _vd in ${ALL_VULKAN_DRIVERS}
. if ${VULKAN_DRIVERS:M${_vd}}
PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${ARCH}"
PLIST_SUB+= ${_vd}_VDRIVER=""
. else
PLIST_SUB+= ${_vd}_VDRIVER="@comment "
. endif

View file

@ -29,7 +29,8 @@ MAINTAINER= x11@FreeBSD.org
COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//}
BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs \
${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR}
LIB_DEPENDS+= libexpat.so:textproc/expat2
.if ${COMPONENT} != clover
USES+= xorg
@ -47,11 +48,10 @@ LIB_DEPENDS+= libunwind.so:devel/libunwind
LIB_DEPENDS+= libelf.so:devel/libelf
.endif
USES+= compiler:c++11-lib bison gettext-tools gmake libtool \
localbase pathfix pkgconfig python:2.7,build shebangfix tar:xz
USES+= compiler:c++11-lib bison meson pathfix pkgconfig \
python:3.6+,build shebangfix tar:xz
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+=--enable-autotools
# only have one port to check with portscout.
.if ${PORTNAME} != mesa-dri
@ -84,26 +84,20 @@ LLVM_DEFAULT= 90
LLVM_DEFAULT= 80
.endif
.if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*}
BINARY_ALIAS+= python3=${PYTHON_VERSION}
.if ${ARCH} == sparc64
MESON_ARGS+= -Dllvm=false
.else
BUILD_DEPENDS+= llvm${LLVM_DEFAULT}>=3.9.0_4:devel/llvm${LLVM_DEFAULT}
.if ${COMPONENT} != libs
RUN_DEPENDS+= llvm${LLVM_DEFAULT}>=3.9.0_4:devel/llvm${LLVM_DEFAULT}
.endif
CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT}
BINARY_ALIAS+= llvm-config=llvm-config${LLVM_DEFAULT}
LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib
CONFIGURE_ARGS+= --enable-llvm
.else
CONFIGURE_ARGS+= --disable-llvm
MESON_ARGS+= -Dllvm=true
.endif
# 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
# patch for rtld. We might want to backport global-dynamic or
# pthread_setspecific which it uses now by default. But since this
# configure switch is going away ...
# https://lists.freebsd.org/pipermail/freebsd-arch/2016-February/017699.html
CONFIGURE_ARGS+= --disable-glx-tls
# we don't care about GLes v1
CONFIGURE_ARGS+= --disable-gles1
MESON_ARGS+= -Dgles1=false

View file

@ -3,34 +3,5 @@
# this file holds common targets
post-patch:
.if ${OPSYS} == FreeBSD
@${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure
.endif
@${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \
${WRKSRC}/src/util/xmlconfig.c
pre-build: mesa-pre-build
#custom targets so we can build parts of Mesa
mesa-pre-build:
# do propper gmake target.
@cd ${WRKSRC}/src && ${MAKE_CMD} git_sha1.h libglsl_util.la
@cd ${WRKSRC}/src/mesa/drivers/dri/common/ && ${MAKE_CMD}
@cd ${WRKSRC}/src/loader && ${MAKE_CMD}
# libloader.la
.if defined(MESA_BUILD_WRKSRC)
do-build:
. for dir in ${MESA_BUILD_WRKSRC}
(cd ${WRKSRC}/${dir}; ${DO_MAKE_BUILD} ${ALL_TARGET};)
. endfor
.endif
.if defined(MESA_INSTALL_WRKSRC)
do-install:
. for dir in ${MESA_INSTALL_WRKSRC}
(cd ${WRKSRC}/${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \
${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
. endfor
.endif

View file

@ -1,66 +0,0 @@
--- configure.ac.orig 2018-11-09 11:03:00 UTC
+++ configure.ac
@@ -931,7 +931,7 @@ case "$host_os" in
darwin*)
;;
*)
- AC_CHECK_FUNCS([clock_gettime], [CLOCK_LIB=],
+ AC_CHECK_FUNCS([clock_gettime clock_nanosleep], [CLOCK_LIB=],
[AC_CHECK_LIB([rt], [clock_gettime], [CLOCK_LIB=-lrt],
[AC_MSG_ERROR([Could not find clock_gettime])])])
AC_SUBST([CLOCK_LIB])
@@ -982,8 +982,12 @@ save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS"
AC_MSG_CHECKING(whether pthread_setaffinity_np is supported)
AC_LINK_IFELSE([AC_LANG_SOURCE([[
+ #if defined(__DragonFly__) || defined(__FreeBSD__)
+ #include <pthread_np.h>
+ #else
#define _GNU_SOURCE
#include <pthread.h>
+ #endif
int main() {
void *a = (void*) &pthread_setaffinity_np;
long b = (long) a;
@@ -995,7 +999,10 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([[
LIBS="$save_LIBS"
dnl Check for futex for fast inline simple_mtx_t.
-AC_CHECK_HEADER([linux/futex.h], [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"])
+AC_CHECK_HEADERS([linux/futex.h sys/umtx.h],
+ [DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"],,
+ [#include <errno.h>
+ #include <sys/types.h>])
dnl SELinux awareness.
AC_ARG_ENABLE([selinux],
@@ -1278,7 +1285,7 @@ fi
AC_SUBST(LIBSENSORS_LIBS)
case "$host_os" in
-linux*)
+linux* | freebsd*)
dri3_default=yes
;;
*)
@@ -1932,9 +1939,9 @@ fi
if test x"$have_xlease" = xyes; then
randr_modules="x11-xcb xcb-randr"
- PKG_CHECK_MODULES([XCB_RANDR], [$randr_modules])
+ PKG_CHECK_MODULES([XCB_RANDR], [$randr_modules],, [have_xlease=no])
xlib_randr_modules="xrandr"
- PKG_CHECK_MODULES([XLIB_RANDR], [$xlib_randr_modules])
+ PKG_CHECK_MODULES([XLIB_RANDR], [$xlib_randr_modules],, [have_xlease=no])
fi
AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
@@ -2515,8 +2522,6 @@ if test "x$enable_opencl" = xyes; then
CLANG_LIBDIR=${LLVM_LIBDIR}
fi
CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
- AS_IF([test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"],
- [AC_MSG_ERROR([Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries.])])
fi
AM_CONDITIONAL(HAVE_CLOVER, test "x$enable_opencl" = xyes)
AM_CONDITIONAL(HAVE_CLOVER_ICD, test "x$enable_opencl_icd" = xyes)

View file

@ -1,153 +0,0 @@
--- configure.orig 2019-01-17 11:26:29 UTC
+++ configure
@@ -20767,7 +20767,7 @@ case "$host_os" in
*-android*)
android=yes
;;
-linux*|*-gnu*|gnu*|cygwin*)
+linux*|*-gnu*|gnu*|cygwin*|freebsd*)
DEFINES="$DEFINES -D_GNU_SOURCE"
;;
solaris*)
@@ -22648,12 +22648,13 @@ case "$host_os" in
darwin*)
;;
*)
- for ac_func in clock_gettime
+ for ac_func in clock_gettime clock_nanosleep
do :
- ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
-if test "x$ac_cv_func_clock_gettime" = xyes; then :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_CLOCK_GETTIME 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
CLOCK_LIB=
else
@@ -23319,8 +23320,12 @@ $as_echo_n "checking whether pthread_setaffinity_np is
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+ #if defined(__DragonFly__) || defined(__FreeBSD__)
+ #include <pthread_np.h>
+ #else
#define _GNU_SOURCE
#include <pthread.h>
+ #endif
int main() {
void *a = (void*) &pthread_setaffinity_np;
long b = (long) a;
@@ -23339,11 +23344,20 @@ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS="$save_LIBS"
-ac_fn_c_check_header_mongrel "$LINENO" "linux/futex.h" "ac_cv_header_linux_futex_h" "$ac_includes_default"
-if test "x$ac_cv_header_linux_futex_h" = xyes; then :
- DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"
+for ac_header in linux/futex.h sys/umtx.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include <errno.h>
+ #include <sys/types.h>
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ DEFINES="$DEFINES -DHAVE_LINUX_FUTEX_H"
fi
+done
# Check whether --enable-selinux was given.
@@ -24241,7 +24255,7 @@ fi
case "$host_os" in
-linux*)
+linux* | freebsd*)
dri3_default=yes
;;
*)
@@ -26542,31 +26556,11 @@ fi
# Put the nasty error message in config.log where it belongs
echo "$XCB_RANDR_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements ($randr_modules) were not met:
-
-$XCB_RANDR_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables XCB_RANDR_CFLAGS
-and XCB_RANDR_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
+ have_xlease=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables XCB_RANDR_CFLAGS
-and XCB_RANDR_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+ have_xlease=no
else
XCB_RANDR_CFLAGS=$pkg_cv_XCB_RANDR_CFLAGS
XCB_RANDR_LIBS=$pkg_cv_XCB_RANDR_LIBS
@@ -26634,31 +26628,11 @@ fi
# Put the nasty error message in config.log where it belongs
echo "$XLIB_RANDR_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements ($xlib_randr_modules) were not met:
-
-$XLIB_RANDR_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-Alternatively, you may set the environment variables XLIB_RANDR_CFLAGS
-and XLIB_RANDR_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details." "$LINENO" 5
+ have_xlease=no
elif test $pkg_failed = untried; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-Alternatively, you may set the environment variables XLIB_RANDR_CFLAGS
-and XLIB_RANDR_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+ have_xlease=no
else
XLIB_RANDR_CFLAGS=$pkg_cv_XLIB_RANDR_CFLAGS
XLIB_RANDR_LIBS=$pkg_cv_XLIB_RANDR_LIBS
@@ -28694,9 +28668,6 @@ rm -f core conftest.err conftest.$ac_objext conftest.$
CLANG_LIBDIR=${LLVM_LIBDIR}
fi
CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION}
- if test ! -f "$CLANG_RESOURCE_DIR/include/stddef.h"; then :
- as_fn_error $? "Could not find clang internal header stddef.h in $CLANG_RESOURCE_DIR Use --with-clang-libdir to specify the correct path to the clang libraries." "$LINENO" 5
-fi
fi
if test "x$enable_opencl" = xyes; then
HAVE_CLOVER_TRUE=

View file

@ -0,0 +1,26 @@
- Do not define GLX_USE_TLS, this doesn't work on all FreeBSD version
Later mesa version rename this to USE_ELF_TLS and make it conditional
on some platform, but for now simply comment it here.
See https://github.com/dumbbell/test-tls-initial-exec for more info
- Add dependency on libxv for xvmc, this is fixed in later mesa version.
--- meson.build.orig 2019-06-26 20:14:08 UTC
+++ meson.build
@@ -336,7 +336,7 @@ if with_egl and not (with_platform_drm or with_platfor
endif
endif
-pre_args += '-DGLX_USE_TLS'
+#pre_args += '-DGLX_USE_TLS'
if with_glx != 'disabled'
if not (with_platform_x11 and with_any_opengl)
error('Cannot build GLX support without X11 platform support and at least one OpenGL API')
@@ -458,7 +458,8 @@ dep_xvmc = null_dep
with_gallium_xvmc = false
if _xvmc != 'false'
dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : _xvmc == 'true')
- with_gallium_xvmc = dep_xvmc.found()
+ dep_xv = dependency('xv', required: _xvmc == 'true')
+ with_gallium_xvmc = dep_xvmc.found() and dep_xv.found()
endif
xvmc_drivers_path = get_option('xvmc-libs-path')

View file

@ -1,11 +0,0 @@
--- src/gallium/state_trackers/xvmc/Makefile.in.orig 2019-10-21 15:12:43 UTC
+++ src/gallium/state_trackers/xvmc/Makefile.in
@@ -674,7 +674,7 @@ AM_CFLAGS = \
noinst_LTLIBRARIES = libxvmctracker.la
libxvmctracker_la_SOURCES = $(C_SOURCES)
noinst_HEADERS = tests/testlib.h
-TEST_LIBS = $(XVMC_LIBS) -lXvMCW $(VL_LIBS) $(XCB_DRI3_LIBS)
+TEST_LIBS = $(XVMC_LIBS) -lXv -lXvMCW $(VL_LIBS) $(XCB_DRI3_LIBS)
tests_test_context_SOURCES = tests/test_context.c tests/testlib.c
tests_test_context_LDADD = $(TEST_LIBS)
tests_test_surface_SOURCES = tests/test_surface.c tests/testlib.c

View file

@ -0,0 +1,19 @@
--- src/gallium/state_trackers/xvmc/meson.build.orig 2019-06-26 20:14:08 UTC
+++ src/gallium/state_trackers/xvmc/meson.build
@@ -18,12 +18,15 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+XVMC_MAJOR = 1
+XVMC_MINOR = 0
+
libxvmc_st = static_library(
'xvmc_st',
files('attributes.c', 'block.c', 'context.c', 'surface.c', 'subpicture.c'),
c_args : [c_vis_args],
include_directories : [inc_common],
- dependencies : [dep_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3],
+ dependencies : [dep_xvmc, dep_x11_xcb, dep_xcb, dep_xcb_dri2, dep_xcb_dri3, dep_xv],
)
# These tests will not work without a working xvmc configuration.

View file

@ -1,11 +0,0 @@
--- src/gallium/targets/xvmc/Makefile.in.orig 2019-10-21 16:05:11 UTC
+++ src/gallium/targets/xvmc/Makefile.in
@@ -718,7 +718,7 @@ libXvMCgallium_la_LIBADD = $(top_builddir)/src/gallium
$(top_builddir)/src/gallium/auxiliary/libgalliumvlwinsys.la \
$(top_builddir)/src/gallium/auxiliary/libgalliumvl.la \
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
- $(top_builddir)/src/util/libmesautil.la $(XVMC_LIBS) \
+ $(top_builddir)/src/util/libmesautil.la $(XVMC_LIBS) -lXv \
$(VL_LIBS) $(XCB_DRI3_LIBS) $(LIBDRM_LIBS) \
$(GALLIUM_COMMON_LIB_DEPS) $(am__append_13) $(am__append_14) \
$(am__append_15)

View file

@ -0,0 +1,11 @@
--- src/gallium/targets/xvmc/meson.build.orig 2020-06-04 18:31:48 UTC
+++ src/gallium/targets/xvmc/meson.build
@@ -55,7 +55,7 @@ libxvmc_gallium = shared_library(
foreach d : [[with_gallium_r600, 'r600'], [with_gallium_nouveau, 'nouveau']]
if d[0]
- xvmc_drivers += 'libXvMC@0@.so'.format(d[1])
+ xvmc_drivers += 'libXvMC@0@.so.@1@.@2@.0'.format(d[1], XVMC_MAJOR, XVMC_MINOR)
endif
endforeach

View file

@ -1,18 +0,0 @@
../../src/util/.libs/libmesautil.a(libmesautil_la-half_float.o): In function `_mesa_float_to_half':
half_float.c:(.text+0x94): undefined reference to `lrintf'
half_float.c:(.text+0xbf): undefined reference to `lrintf'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[5]: *** [Makefile:2706: tools/aubinator_error_decode] Error 1
--- src/intel/Makefile.in.orig 2017-12-24 10:29:12 UTC
+++ src/intel/Makefile.in
@@ -1977,7 +1977,8 @@ tools_aubinator_error_decode_LDADD = \
compiler/libintel_compiler.la \
$(top_builddir)/src/util/libmesautil.la \
$(PTHREAD_LIBS) \
- $(ZLIB_LIBS)
+ $(ZLIB_LIBS) \
+ -lm
tools_aubinator_error_decode_CFLAGS = \
$(AM_CFLAGS) \

View file

@ -0,0 +1,13 @@
--- src/mesa/main/macros.h.orig 2019-06-26 20:14:08 UTC
+++ src/mesa/main/macros.h
@@ -677,6 +677,10 @@ minify(unsigned value, unsigned levels)
*
* \sa ROUND_DOWN_TO()
*/
+#ifdef __FreeBSD__
+#undef ALIGN
+#endif
+
static inline uintptr_t
ALIGN(uintptr_t value, int32_t alignment)
{

View file

@ -1,8 +1,13 @@
- Implement futex_wake() and futex_wait() via _umtx_op()
--- src/util/futex.h.orig 2018-09-24 16:00:57 UTC
--- src/util/futex.h.orig 2019-06-26 20:14:08 UTC
+++ src/util/futex.h
@@ -29,10 +29,32 @@
@@ -24,15 +24,37 @@
#ifndef UTIL_FUTEX_H
#define UTIL_FUTEX_H
-#if defined(HAVE_LINUX_FUTEX_H)
+/* #if defined(HAVE_LINUX_FUTEX_H) */
#include <limits.h>
#include <stdint.h>
#include <unistd.h>
@ -35,11 +40,13 @@
static inline long sys_futex(void *addr1, int op, int val1, const struct timespec *timeout, void *addr2, int val3)
{
return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
@@ -50,6 +72,7 @@ static inline int futex_wait(uint32_t *addr, int32_t v
@@ -50,7 +72,8 @@ static inline int futex_wait(uint32_t *addr, int32_t v
return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL,
FUTEX_BITSET_MATCH_ANY);
}
+#endif
-
#endif
+
+/* #endif */
#endif /* UTIL_FUTEX_H */

View file

@ -1,25 +1,8 @@
@comment include/EGL/egl.h
@comment include/EGL/eglext.h
@comment include/EGL/eglextchromium.h
@comment include/EGL/eglmesaext.h
@comment include/EGL/eglplatform.h
@comment include/GL/gl.h
@comment include/GL/gl_mangle.h
@comment include/GL/glcorearb.h
@comment include/GL/glext.h
@comment include/GL/glx.h
@comment include/GL/glx_mangle.h
@comment include/GL/glxext.h
include/GL/internal/dri_interface.h
@comment include/GL/osmesa.h
@comment include/GLES2/gl2.h
@comment include/GLES2/gl2ext.h
@comment include/GLES2/gl2platform.h
@comment include/GLES3/gl3.h
@comment include/GLES3/gl31.h
@comment include/GLES3/gl32.h
@comment include/GLES3/gl3ext.h
@comment include/GLES3/gl3platform.h
@comment include/KHR/khrplatform.h
@comment include/gbm.h
%%INTEL_VDRIVER%%include/vulkan/vulkan_intel.h
@ -32,32 +15,12 @@ include/GL/internal/dri_interface.h
%%R300_GDRIVER%%lib/dri/r300_dri.so
%%R600_GDRIVER%%lib/dri/r600_dri.so
%%VAAPI%%%%R600_GDRIVER%%lib/dri/r600_drv_video.so
%%RADEON_DRIVER%%lib/dri/radeon_dri.so
%%R100_DRIVER%%lib/dri/radeon_dri.so
%%RADEONSI_GDRIVER%%lib/dri/radeonsi_dri.so
%%VAAPI%%%%RADEONSI_GDRIVER%%lib/dri/radeonsi_drv_video.so
%%SWRAST_DRIVER%%lib/dri/swrast_dri.so
%%SWRAST_GDRIVER%%lib/dri/swrast_dri.so
%%VC4_GDRIVER%%lib/dri/vc4_dri.so
%%SVGA_GDRIVER%%lib/dri/vmwgfx_dri.so
@comment lib/gallium-pipe/pipe_r300.so
@comment lib/gallium-pipe/pipe_r600.so
@comment lib/gallium-pipe/pipe_radeonsi.so
@comment lib/gallium-pipe/pipe_swrast.so
@comment lib/gallium-pipe/pipe_vmwgfx.so
@comment lib/libEGL.so
@comment lib/libEGL.so.1
@comment lib/libEGL.so.1.0.0
@comment lib/libGL.so
@comment lib/libGL.so.1
@comment lib/libGL.so.1.2.0
@comment lib/libGLESv2.so
@comment lib/libGLESv2.so.2
@comment lib/libGLESv2.so.2.0.0
@comment lib/libMesaOpenCL.so
@comment lib/libMesaOpenCL.so.1
@comment lib/libMesaOpenCL.so.1.0.0
@comment lib/libOSMesa.so
@comment lib/libOSMesa.so.8
@comment lib/libOSMesa.so.8.0.0
%%R600_GDRIVER%%lib/libXvMCr600.so
%%R600_GDRIVER%%lib/libXvMCr600.so.1
%%R600_GDRIVER%%lib/libXvMCr600.so.1.0
@ -81,13 +44,9 @@ include/GL/internal/dri_interface.h
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0
%%VDPAU%%%%RADEONSI_GDRIVER%%lib/vdpau/libvdpau_radeonsi.so.1.0.0
%%INTEL_VDRIVER%%lib/libvulkan_intel.so
%%RADEON_VDRIVER%%lib/libvulkan_radeon.so
%%AMD_VDRIVER%%lib/libvulkan_radeon.so
libdata/pkgconfig/dri.pc
@comment libdata/pkgconfig/egl.pc
@comment libdata/pkgconfig/gbm.pc
@comment libdata/pkgconfig/gl.pc
@comment libdata/pkgconfig/glesv2.pc
@comment libdata/pkgconfig/osmesa.pc
share/drirc.d/00-mesa-defaults.conf
%%INTEL_VDRIVER%%share/vulkan/icd.d/intel_icd.%%ARCH%%.json
%%RADEON_VDRIVER%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json
%%AMD_VDRIVER%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json

View file

@ -11,7 +11,7 @@ CONFLICTS_INSTALL= libglvnd # include/GL/gl.h
USES= xorg
USE_XORG= xorgproto x11 xcb xdamage xext \
xfixes xshmfence xxf86vm
xfixes xshmfence xxf86vm xrandr
OPTIONS_DEFINE= WAYLAND
OPTIONS_DEFAULT=WAYLAND
@ -24,25 +24,26 @@ WAYLAND_LIB_DEPENDS= libwayland-egl.so:graphics/wayland
.include <bsd.port.options.mk>
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
CONFIGURE_ARGS+= --with-dri-drivers="" --with-gallium-drivers=""
MESON_ARGS+= -Dgallium-drivers="" \
-Dgallium-vdpau=false \
-Dgallium-xvmc=false \
-Dgallium-omx=disabled \
-Dgallium-va=false \
-Dgallium-xa=false \
-Dgallium-nine=false \
-Dgallium-clover=disabled \
-Dosmesa=none \
-Dtools="" \
-Degl=true \
-Dgbm=true \
-Dvulkan-drivers=""
# Building EGL and GBM requires a dri driver so add swrast
MESON_ARGS+= -Ddri-drivers="swrast"
.if ${PORT_OPTIONS:MWAYLAND}
CONFIGURE_ARGS+= --with-platforms=x11,surfaceless,drm,wayland
MESON_ARGS+= -Dplatforms=x11,surfaceless,drm,wayland
.endif
MESA_BUILD_WRKSRC= src/mapi src/util
MESA_INSTALL_WRKSRC= src/mapi
.if ${PORT_OPTIONS:MWAYLAND}
MESA_BUILD_WRKSRC+= src/egl/wayland/wayland-drm
.endif
MESA_BUILD_WRKSRC+= src/gbm src/glx
MESA_INSTALL_WRKSRC+= src/gbm src/glx
MESA_BUILD_WRKSRC+= src/egl
MESA_INSTALL_WRKSRC+= src/egl
.if ${ARCH} == "i386"
# PR230239 Fix the build for i386 when WITH_LLD_IS_LD is set
LDFLAGS+=-Wl,-z,notext
@ -52,8 +53,4 @@ USE_GCC= yes
.include "${MASTERDIR}/Makefile.targets"
post-install:
@cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \
${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS
.include <bsd.port.post.mk>

View file

@ -1,4 +1,3 @@
@comment etc/drirc
include/EGL/egl.h
include/EGL/eglext.h
include/EGL/eglextchromium.h
@ -11,6 +10,7 @@ include/GL/glext.h
include/GL/glx.h
include/GL/glx_mangle.h
include/GL/glxext.h
@comment include/GL/internal/dri_interface.h
include/GLES2/gl2.h
include/GLES2/gl2ext.h
include/GLES2/gl2platform.h
@ -21,6 +21,7 @@ include/GLES3/gl3ext.h
include/GLES3/gl3platform.h
include/KHR/khrplatform.h
include/gbm.h
@comment lib/dri/swrast_dri.so
lib/libEGL.so
lib/libEGL.so.1
lib/libEGL.so.1.0.0
@ -36,7 +37,9 @@ lib/libgbm.so.1.0.0
lib/libglapi.so
lib/libglapi.so.0
lib/libglapi.so.0.0.0
@comment libdata/pkgconfig/dri.pc
libdata/pkgconfig/egl.pc
libdata/pkgconfig/gbm.pc
libdata/pkgconfig/gl.pc
libdata/pkgconfig/glesv2.pc
@comment share/drirc.d/00-mesa-defaults.conf

View file

@ -18,18 +18,31 @@ ONLY_FOR_ARCHS_REASON= Clover needs a GPU supported by the Radeon KMS driver
.include <bsd.port.options.mk>
.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
CONFIGURE_ARGS+= --enable-opencl --enable-opencl-icd --disable-dri \
--disable-egl --disable-gbm --disable-gles2 --disable-glx \
--disable-va --disable-vdpau --disable-xvmc \
--with-gallium-drivers=r600,radeonsi # only supported GPUs
LDFLAGS_i386= -Wl,-znotext
MESON_ARGS+= -Ddri-drivers="" \
-Dgallium-drivers=r600,radeonsi \
-Dvulkan-drivers="" \
-Dplatforms="" \
-Dgallium-vdpau=false \
-Dgallium-omx=disabled \
-Dgallium-va=false \
-Dgallium-opencl=disabled \
-Dgallium-xa=false \
-Dgallium-xvmc=false \
-Dgallium-nine=false \
-Dgles1=false \
-Dgles2=false \
-Dopengl=false \
-Dglx=disabled \
-Degl=false \
-Dgbm=false \
-Dgallium-opencl=icd \
-Dtools=""
#MESA_BUILD_WRKSRC= src/util src/compiler src/mesa src/gallium
MESA_INSTALL_WRKSRC= src/gallium/targets/opencl src/gallium/targets/pipe-loader
LDFLAGS_i386= -Wl,-znotext
.include "${MASTERDIR}/Makefile.targets"
pre-configure:
pre-patch:
@if [ -e ${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} ] && \
! [ -e ${LOCALBASE}/bin/clang${LLVM_DEFAULT} ]; then \
${ECHO_MSG} "Your llvm${LLVM_DEFAULT} is not built with clang support, which is required."; \

View file

@ -4,3 +4,4 @@ lib/gallium-pipe/pipe_radeonsi.so
lib/libMesaOpenCL.so
lib/libMesaOpenCL.so.1
lib/libMesaOpenCL.so.1.0.0
@comment share/drirc.d/00-mesa-defaults.conf