Index: graphics/libosmesa/Makefile =================================================================== --- graphics/libosmesa/Makefile +++ graphics/libosmesa/Makefile @@ -13,18 +13,32 @@ .include .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 +MESON_ARGS+= -Dosmesa=gallium .else -CONFIGURE_ARGS+= --enable-osmesa -MESA_INSTALL_WRKSRC= src/mesa/drivers/osmesa +MESON_ARGS+= -Dosmesa=classic .endif .include "${MASTERDIR}/Makefile.targets" Index: graphics/libosmesa/pkg-plist =================================================================== --- graphics/libosmesa/pkg-plist +++ graphics/libosmesa/pkg-plist @@ -3,3 +3,4 @@ lib/libOSMesa.so.8 lib/libOSMesa.so.8.0.0 libdata/pkgconfig/osmesa.pc +@comment share/drirc.d/00-mesa-defaults.conf Index: graphics/libxatracker/Makefile =================================================================== --- graphics/libxatracker/Makefile +++ graphics/libxatracker/Makefile @@ -8,7 +8,7 @@ COMMENT= Mesa XA state tracker -USES= xorg +USES= xorg meson USE_XORG= xorgproto .include @@ -17,22 +17,27 @@ 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= - -MESA_BUILD_WRKSRC= src/util src/compiler +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= + 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 Index: graphics/libxatracker/pkg-plist =================================================================== --- graphics/libxatracker/pkg-plist +++ graphics/libxatracker/pkg-plist @@ -5,3 +5,4 @@ lib/libxatracker.so.2 lib/libxatracker.so.2.5.0 libdata/pkgconfig/xatracker.pc +@comment share/drirc.d/00-mesa-defaults.conf Index: graphics/mesa-dri/Makefile =================================================================== --- graphics/mesa-dri/Makefile +++ graphics/mesa-dri/Makefile @@ -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_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 @@ .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" -ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST +ALL_DRI_DRIVERS= I915 I965 RADEON 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 @@ .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,24 @@ # 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_DRI_DRIVERS!= ${ECHO_CMD} ${DRI_DRIVERS} | ${TR} ' ' ',' +MESON_GALLIUM_DRIVERS!= ${ECHO_CMD} ${GALLIUM_DRIVERS} | ${TR} ' ' ',' +MESON_VULKAN_DRIVERS!= ${ECHO_CMD} ${VULKAN_DRIVERS} | ${TR} ' ' ',' +MESON_ARGS+= -Ddri-drivers="${MESON_DRI_DRIVERS:tl}" \ + -Dgallium-drivers="${MESON_GALLIUM_DRIVERS:tl}" \ + -Dvulkan-drivers="${MESON_VULKAN_DRIVERS: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}} @@ -101,7 +114,12 @@ .for _vd in ${ALL_VULKAN_DRIVERS} . if ${VULKAN_DRIVERS:M${_vd}} -PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${ARCH}" +. if ${ARCH} == "amd64" +PLIST_ARCH="x86_64" +. else +PLIST_ARCH=${ARCH} +. endif +PLIST_SUB+= ${_vd}_VDRIVER="" ARCH="${PLIST_ARCH}" . else PLIST_SUB+= ${_vd}_VDRIVER="@comment " . endif @@ -111,5 +129,8 @@ post-install: @${RM} -r ${STAGEDIR}/etc/OpenCL + @${LN} -s ${STAGEDIR}/${LOCALBASE}/lib/libXvMCr600.so ${STAGEDIR}/${LOCALBASE}/lib/libXvMCr600.so.1 + @${LN} -s ${STAGEDIR}/${LOCALBASE}/lib/libXvMCr600.so ${STAGEDIR}/${LOCALBASE}/lib/libXvMCr600.so.1.0 + @${LN} -s ${STAGEDIR}/${LOCALBASE}/lib/libXvMCr600.so ${STAGEDIR}/${LOCALBASE}/lib/libXvMCr600.so.1.0.0 .include Index: graphics/mesa-dri/Makefile.common =================================================================== --- graphics/mesa-dri/Makefile.common +++ graphics/mesa-dri/Makefile.common @@ -29,7 +29,8 @@ 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+= 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 gettext-tools libtool \ + localbase pathfix pkgconfig python:3.6+,build shebangfix tar:xz \ + meson 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= 80 .endif +BINARY_ALIAS= python3=${PYTHON_VERSION} + .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} 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} +MESON_ARGS+= --native-file="${WRKSRC}/llvm.ini" LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_DEFAULT}/lib -CONFIGURE_ARGS+= --enable-llvm +MESON_ARGS+= -Dllvm=true .else -CONFIGURE_ARGS+= --disable-llvm +MESON_ARGS+= -Dllvm=false .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 Index: graphics/mesa-dri/Makefile.targets =================================================================== --- graphics/mesa-dri/Makefile.targets +++ graphics/mesa-dri/Makefile.targets @@ -2,35 +2,10 @@ # # this file holds common targets +pre-configure: + ${PRINTF} "[binaries]\nllvm-config = '${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT}'" \ + > ${WRKSRC}/llvm.ini + 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 - Index: graphics/mesa-dri/files/configure.ac =================================================================== --- graphics/mesa-dri/files/configure.ac +++ /dev/null @@ -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 -+ #else - #define _GNU_SOURCE - #include -+ #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 -+ #include ]) - - 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) Index: graphics/mesa-dri/files/patch-configure =================================================================== --- graphics/mesa-dri/files/patch-configure +++ /dev/null @@ -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 -+ #else - #define _GNU_SOURCE - #include -+ #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 -+ #include -+" -+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 . --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 . --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= Index: graphics/mesa-dri/files/patch-meson.build =================================================================== --- /dev/null +++ graphics/mesa-dri/files/patch-meson.build @@ -0,0 +1,21 @@ +--- meson.build.orig 2019-06-26 22:14:08.000000000 +0200 ++++ meson.build 2020-05-31 21:48:53.431733000 +0200 +@@ -336,7 +336,7 @@ + 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 @@ + 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') Index: graphics/mesa-dri/files/patch-src_gallium_state__trackers_xvmc_Makefile.in =================================================================== --- graphics/mesa-dri/files/patch-src_gallium_state__trackers_xvmc_Makefile.in +++ /dev/null @@ -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 Index: graphics/mesa-dri/files/patch-src_gallium_state__trackers_xvmc_meson.build =================================================================== --- /dev/null +++ graphics/mesa-dri/files/patch-src_gallium_state__trackers_xvmc_meson.build @@ -0,0 +1,11 @@ +--- src/gallium/state_trackers/xvmc/meson.build.orig 2020-05-31 21:23:11.196532000 +0200 ++++ src/gallium/state_trackers/xvmc/meson.build 2020-05-31 21:23:22.321319000 +0200 +@@ -23,7 +23,7 @@ + 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. Index: graphics/mesa-dri/files/patch-src_gallium_targets_xvmc_Makefile.in =================================================================== --- graphics/mesa-dri/files/patch-src_gallium_targets_xvmc_Makefile.in +++ /dev/null @@ -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) Index: graphics/mesa-dri/files/patch-src_intel_Makefile.in =================================================================== --- graphics/mesa-dri/files/patch-src_intel_Makefile.in +++ /dev/null @@ -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) \ Index: graphics/mesa-dri/files/patch-src_mesa_main_macros.h =================================================================== --- /dev/null +++ graphics/mesa-dri/files/patch-src_mesa_main_macros.h @@ -0,0 +1,13 @@ +--- src/mesa/main/macros.h.orig 2020-05-31 14:05:45.442955000 +0200 ++++ src/mesa/main/macros.h 2020-05-31 14:05:54.808435000 +0200 +@@ -677,6 +677,10 @@ + * + * \sa ROUND_DOWN_TO() + */ ++#ifdef __FreeBSD__ ++#undef ALIGN ++#endif ++ + static inline uintptr_t + ALIGN(uintptr_t value, int32_t alignment) + { Index: graphics/mesa-dri/files/patch-src_util_futex.h =================================================================== --- graphics/mesa-dri/files/patch-src_util_futex.h +++ graphics/mesa-dri/files/patch-src_util_futex.h @@ -1,8 +1,12 @@ -- 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 -@@ -29,10 +29,32 @@ +--- src/util/futex.h.orig 2019-06-26 22:14:08.000000000 +0200 ++++ src/util/futex.h 2020-05-31 14:39:01.330547000 +0200 +@@ -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 #include #include @@ -35,11 +39,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 @@ return sys_futex(addr, FUTEX_WAIT_BITSET, value, timeout, NULL, FUTEX_BITSET_MATCH_ANY); } -+#endif - +- #endif ++ ++/* #endif */ + #endif /* UTIL_FUTEX_H */ Index: graphics/mesa-dri/pkg-plist =================================================================== --- graphics/mesa-dri/pkg-plist +++ graphics/mesa-dri/pkg-plist @@ -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 @@ %%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 @@ %%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 Index: graphics/mesa-libs/Makefile =================================================================== --- graphics/mesa-libs/Makefile +++ graphics/mesa-libs/Makefile @@ -11,7 +11,7 @@ USES= xorg USE_XORG= xorgproto x11 xcb xdamage xext \ - xfixes xshmfence xxf86vm + xfixes xshmfence xxf86vm xrandr OPTIONS_DEFINE= WAYLAND OPTIONS_DEFAULT=WAYLAND @@ -24,24 +24,38 @@ .include .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 +#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 +#.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/gbm src/glx +#MESA_INSTALL_WRKSRC+= src/gbm src/glx -MESA_BUILD_WRKSRC+= src/egl -MESA_INSTALL_WRKSRC+= src/egl +#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 @@ -52,8 +66,8 @@ .include "${MASTERDIR}/Makefile.targets" -post-install: - @cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \ - ${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS +#post-install: +# @cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \ +# ${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS .include Index: graphics/mesa-libs/pkg-plist =================================================================== --- graphics/mesa-libs/pkg-plist +++ graphics/mesa-libs/pkg-plist @@ -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/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/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/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 Index: lang/clover/Makefile =================================================================== --- lang/clover/Makefile +++ lang/clover/Makefile @@ -18,18 +18,31 @@ .include .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."; \ Index: lang/clover/pkg-plist =================================================================== --- lang/clover/pkg-plist +++ lang/clover/pkg-plist @@ -4,3 +4,4 @@ lib/libMesaOpenCL.so lib/libMesaOpenCL.so.1 lib/libMesaOpenCL.so.1.0.0 +@comment share/drirc.d/00-mesa-defaults.conf