Index: head/graphics/libosmesa/Makefile =================================================================== --- head/graphics/libosmesa/Makefile +++ head/graphics/libosmesa/Makefile @@ -7,20 +7,17 @@ COMMENT= Off-Screen Mesa implementation of the OpenGL API -LIB_DEPENDS= libexpat.so:textproc/expat2 \ - libglapi.so:graphics/mesa-libs - USE_XORG= glproto .include -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common" +.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" CONFIGURE_ARGS+= --disable-dri --disable-egl --disable-gbm \ - --with-gallium-drivers=swrast + --disable-gles2 --with-gallium-drivers=swrast MESA_BUILD_WRKSRC= src/util src/compiler src/mapi src/mesa .if "${MESA_LLVM_VER}" != "" -CONFGIURE_ARGS+= --enable-osmesa-gallium +CONFIGURE_ARGS+= --enable-osmesa-gallium MESA_BUILD_WRKSRC+= src/gallium MESA_INSTALL_WRKSRC= src/gallium/state_trackers/osmesa src/gallium/targets/osmesa .else @@ -28,11 +25,11 @@ MESA_INSTALL_WRKSRC= src/mesa/drivers/osmesa .endif -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets" +.include "${MASTERDIR}/Makefile.targets" post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/include/GL ${INSTALL_DATA} ${WRKSRC}/include/GL/osmesa.h \ ${STAGEDIR}${PREFIX}/include/GL -.include +.include Index: head/graphics/mesa-dri/Makefile =================================================================== --- head/graphics/mesa-dri/Makefile +++ head/graphics/mesa-dri/Makefile @@ -7,8 +7,6 @@ COMMENT= OpenGL hardware acceleration drivers for DRI2+ -LIB_DEPENDS= libdrm.so:graphics/libdrm \ - libexpat.so:textproc/expat2 RUN_DEPENDS= ${LOCALBASE}/lib/libtxc_dxtn.so:graphics/s2tc USE_XORG= dri2proto dri3proto glproto presentproto x11 xdamage xext \ @@ -17,7 +15,6 @@ OPTIONS_DEFINE= TEXTURE VAAPI VDPAU OPTIONS_DEFAULT=TEXTURE OPTIONS_SUB= yes -PKGHELP= ${.CURDIR}/pkg-help TEXTURE_DESC= Enable texture-float support (patent encumbered) TEXTURE_CONFIGURE_ENABLE= texture-float @@ -30,23 +27,30 @@ VDPAU_LIB_DEPENDS= libvdpau.so:multimedia/libvdpau .include -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common" +.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" ALL_DRI_DRIVERS= I915 I965 RADEON R200 SWRAST ALL_GALLIUM_DRIVERS= FREEDRENO R300 R600 RADEONSI SVGA SWRAST VC4 -DRI_DRIVERS= SWRAST -GALLIUM_DRIVERS= SWRAST +DRI_DRIVERS= SWRAST # classic swrast +.if "${MESA_LLVM_VER}" != "" +GALLIUM_DRIVERS= SWRAST # llvmpipe +.else +GALLIUM_DRIVERS= "" +.endif .if ${ARCH} == amd64 || ${ARCH} == i386 \ || ${ARCH} == powerpc || ${ARCH} == powerpc64 DRI_DRIVERS+= RADEON R200 -GALLIUM_DRIVERS+= R300 R600 RADEONSI -.elif ${ARCH} == armv6 || ${ARCH} == aarch64 -GALLIUM_DRIVERS+= FREEDRENO VC4 +GALLIUM_DRIVERS+= R300 R600 +.if "${MESA_LLVM_VER}" != "" # until PPC gets LLVM in base +GALLIUM_DRIVERS+= RADEONSI +.endif .endif .if ${ARCH} == amd64 || ${ARCH} == i386 DRI_DRIVERS+= I915 I965 GALLIUM_DRIVERS+= SVGA +.elif ${ARCH} == armv6 || ${ARCH} == aarch64 +GALLIUM_DRIVERS+= FREEDRENO VC4 .endif CONFIGURE_ARGS+= --with-dri-drivers="${DRI_DRIVERS:tl}" \ @@ -68,9 +72,9 @@ . endif .endfor -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets" +.include "${MASTERDIR}/Makefile.targets" post-install: @${RM} -r ${STAGEDIR}/etc/OpenCL -.include +.include Index: head/graphics/mesa-dri/Makefile.common =================================================================== --- head/graphics/mesa-dri/Makefile.common +++ head/graphics/mesa-dri/Makefile.common @@ -14,7 +14,7 @@ MESAVERSION= ${MESABASEVERSION}${MESASUBVERSION:C/^(.)/.\1/} MESADISTVERSION=${MESABASEVERSION}${MESASUBVERSION:C/^(.)/-\1/} -MESABASEVERSION= 17.0.4 +MESABASEVERSION= 17.1.0 # if there is a subversion, don't include the '-' between 7.11-rc2. MESASUBVERSION= @@ -27,14 +27,28 @@ MAINTAINER= x11@FreeBSD.org +COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} + +BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs +LIB_DEPENDS+= libexpat.so:textproc/expat2 +.if ${COMPONENT} != osmesa +LIB_DEPENDS+= libdrm.so:graphics/libdrm +.endif +.if ${COMPONENT} != libs +LIB_DEPENDS+= libglapi.so:graphics/mesa-libs +.endif +.if ${ARCH} == amd64 || ${ARCH} == i386 +LIB_DEPENDS+= libunwind.so:devel/libunwind +.endif +.if ${OPSYS} == DragonFly +LIB_DEPENDS+= libelf.so:devel/libelf +.endif + USES+= compiler:c++11-lib bison gettext-tools gmake libtool \ localbase pathfix pkgconfig python:2,build shebangfix tar:xz USE_LDCONFIG= yes GNU_CONFIGURE= yes -PKGINSTALL= ${.CURDIR}/pkg-install -PKGDEINSTALL= ${.CURDIR}/pkg-deinstall - # only have one port to check with portscout. .if ${PORTNAME} != mesa-dri PORTSCOUT= ignore:1 @@ -43,34 +57,39 @@ python_OLD_CMD= /usr/bin/env[[:space:]]python2 /usr/bin/python2 /bin/env[[:space:]]python SHEBANG_FILES= src/gallium/*/*/*.py src/gallium/tools/trace/*.py \ src/gallium/drivers/svga/svgadump/svga_dump.py \ - src/gallium/drivers/freedreno/ir3/ir3_nir_trig.py \ src/mapi/glapi/gen/*.py src/mapi/mapi_abi.py \ src/mesa/drivers/dri/common/xmlpool/gen_xmlpool.py \ src/mesa/main/get_*.py src/util/format_srgb.py \ src/amd/*/*.py src/intel/genxml/gen_pack_header.py -MASTERDIR= ${.CURDIR}/../../graphics/mesa-dri +MASTERDIR= ${.CURDIR:H:H}/graphics/mesa-dri PATCHDIR= ${MASTERDIR}/files WRKSRC= ${WRKDIR}/mesa-${MESADISTVERSION} DESCR= ${.CURDIR}/pkg-descr PLIST= ${.CURDIR}/pkg-plist +PKGHELP= ${.CURDIR}/pkg-help +PKGINSTALL= ${.CURDIR}/pkg-install +PKGDEINSTALL= ${.CURDIR}/pkg-deinstall INSTALL_TARGET= install-strip -COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} +.include -.if (${ARCH} != sparc64 && ${ARCH} != ia64) # no working LLVM +# need LLVM for libEGL wherever possible, but mixing GCC and LLVM breaks Gallium +.if ${CHOSEN_COMPILER_TYPE} == clang \ + || (${COMPONENT} == libs && ${ARCH} != sparc64) # no working LLVM MESA_LLVM_VER?= 40 .endif .if "${MESA_LLVM_VER}" != "" BUILD_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} +.if ${COMPONENT} != libs RUN_DEPENDS+= llvm${MESA_LLVM_VER}>=3.9.0_4:devel/llvm${MESA_LLVM_VER} +.endif CONFIGURE_ENV+= LLVM_CONFIG=${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${MESA_LLVM_VER}/lib -# The gallium-llvm switch is the global llvm switch for historical reasons -CONFIGURE_ARGS+= --enable-gallium-llvm +CONFIGURE_ARGS+= --enable-llvm .else -CONFIGURE_ARGS+= --disable-gallium-llvm +CONFIGURE_ARGS+= --disable-llvm .endif # There are issues that need to be fixed to use TLS model "initial-exec" @@ -84,7 +103,3 @@ # we don't care about GLes v1 CONFIGURE_ARGS+= --disable-gles1 -.if ${OPSYS} == DragonFly -LIB_DEPENDS+= libelf.so:devel/libelf -.endif - Index: head/graphics/mesa-dri/Makefile.targets =================================================================== --- head/graphics/mesa-dri/Makefile.targets +++ head/graphics/mesa-dri/Makefile.targets @@ -5,13 +5,10 @@ post-patch: .if ${OPSYS} == FreeBSD @${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure -# Clang 3.4 in 10.x on i386 fails with the following error when using "GCC atomics" -# -# glsl/cache.c:613:4: error: cannot compile this atomic library call yet -# p_atomic_add(cache->size, size); note: expanded from macro 'p_atomic_add' -# define p_atomic_add(v, i) (void) __atomic_add_fetch((v), (i), __ATOMIC_ACQ_REL) -# -.if ${OSVERSION} < 1100000 && ${ARCH} == "i386" +# Disable use of GCC_ATOMICs on i386 to avoid build failures +# Clang in 10.3 fails with cannot compile this atomic library call yet 'p_atomic_add' +# Clang in 11.0 fails with undefined reference to `__atomic_fetch_add_8` +.if ${ARCH} == "i386" @${REINPLACE_CMD} -e 's|-DUSE_GCC_ATOMIC_BUILTINS||' ${WRKSRC}/configure .endif .endif # ${OPSYS} Index: head/graphics/mesa-dri/distinfo =================================================================== --- head/graphics/mesa-dri/distinfo +++ head/graphics/mesa-dri/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1492459376 -SHA256 (mesa-17.0.4.tar.xz) = 1269dc8545a193932a0779b2db5bce9be4a5f6813b98c38b93b372be8362a346 -SIZE (mesa-17.0.4.tar.xz) = 9454976 +TIMESTAMP = 1494841816 +SHA256 (mesa-17.1.0.tar.xz) = cf234a6ed4764673886b6661553b54675776ef0898f774716173cec890ac3b17 +SIZE (mesa-17.1.0.tar.xz) = 9849580 Index: head/graphics/mesa-dri/files/configure.ac =================================================================== --- head/graphics/mesa-dri/files/configure.ac +++ head/graphics/mesa-dri/files/configure.ac @@ -1,38 +1,5 @@ --- configure.ac.orig 2017-04-01 15:33:36 UTC +++ configure.ac -@@ -942,19 +942,19 @@ llvm_add_target() { - # Call this inside ` ` to get the return value. - # $1 is the llvm-config command with arguments. - strip_unwanted_llvm_flags() { -- # Use \> (marks the end of the word) -- echo " `$1`" | sed \ -- -e 's/\s\+-m\S*//g' \ -- -e 's/\s\+-DNDEBUG\>//g' \ -- -e 's/\s\+-D_GNU_SOURCE\>//g' \ -- -e 's/\s\+-pedantic\>//g' \ -- -e 's/\s\+-W\S*//g' \ -- -e 's/\s\+-O\S*//g' \ -- -e 's/\s\+-g\S*//g' \ -- -e 's/-fno-rtti\>/-Fno-rtti/g' \ -- -e 's/\s\+-f\S*//g' \ -- -e 's/-Fno-rtti\>/-fno-rtti/g' \ -- -e 's/^ //' -+ echo " `$1` " | sed -E \ -+ -e 's/[[[:space:]]]+-m[[^[:space:]]]*//g' \ -+ -e 's/[[[:space:]]]+-DNDEBUG[[[:space:]]]/ /g' \ -+ -e 's/[[[:space:]]]+-D_GNU_SOURCE[[[:space:]]]/ /g' \ -+ -e 's/[[[:space:]]]+-pedantic[[[:space:]]]/ /g' \ -+ -e 's/[[[:space:]]]+-W[[^[:space:]]]*//g' \ -+ -e 's/[[[:space:]]]+-O[[^[:space:]]]*//g' \ -+ -e 's/[[[:space:]]]+-g[[^[:space:]]]*//g' \ -+ -e 's/-fno-rtti[[[:space:]]]/-Fno-rtti /g' \ -+ -e 's/[[[:space:]]]+-f[[^[:space:]]]*//g' \ -+ -e 's/-Fno-rtti[[[:space:]]]/-fno-rtti /g' \ -+ -e 's/^[[[:space:]]]//' \ -+ -e 's/[[[:space:]]]$//' - } - - llvm_set_environment_variables() { @@ -1121,7 +1121,7 @@ fi AC_SUBST(LIBSENSORS_LIBS) Index: head/graphics/mesa-dri/files/patch-configure =================================================================== --- head/graphics/mesa-dri/files/patch-configure +++ head/graphics/mesa-dri/files/patch-configure @@ -1,39 +1,6 @@ ---- configure.orig 2017-04-01 15:33:50 UTC +--- configure.orig 2017-05-10 14:14:06 UTC +++ configure -@@ -22350,19 +22350,19 @@ llvm_add_target() { - # Call this inside ` ` to get the return value. - # $1 is the llvm-config command with arguments. - strip_unwanted_llvm_flags() { -- # Use \> (marks the end of the word) -- echo " `$1`" | sed \ -- -e 's/\s\+-m\S*//g' \ -- -e 's/\s\+-DNDEBUG\>//g' \ -- -e 's/\s\+-D_GNU_SOURCE\>//g' \ -- -e 's/\s\+-pedantic\>//g' \ -- -e 's/\s\+-W\S*//g' \ -- -e 's/\s\+-O\S*//g' \ -- -e 's/\s\+-g\S*//g' \ -- -e 's/-fno-rtti\>/-Fno-rtti/g' \ -- -e 's/\s\+-f\S*//g' \ -- -e 's/-Fno-rtti\>/-fno-rtti/g' \ -- -e 's/^ //' -+ echo " `$1` " | sed -E \ -+ -e 's/[[:space:]]+-m[^[:space:]]*//g' \ -+ -e 's/[[:space:]]+-DNDEBUG[[:space:]]/ /g' \ -+ -e 's/[[:space:]]+-D_GNU_SOURCE[[:space:]]/ /g' \ -+ -e 's/[[:space:]]+-pedantic[[:space:]]/ /g' \ -+ -e 's/[[:space:]]+-W[^[:space:]]*//g' \ -+ -e 's/[[:space:]]+-O[^[:space:]]*//g' \ -+ -e 's/[[:space:]]+-g[^[:space:]]*//g' \ -+ -e 's/-fno-rtti[[:space:]]/-Fno-rtti /g' \ -+ -e 's/[[:space:]]+-f[^[:space:]]*//g' \ -+ -e 's/-Fno-rtti[[:space:]]/-fno-rtti /g' \ -+ -e 's/^[[:space:]]//' \ -+ -e 's/[[:space:]]$//' - } - - llvm_set_environment_variables() { -@@ -22560,7 +22560,7 @@ fi +@@ -22709,7 +22709,7 @@ fi case "$host_os" in @@ -42,7 +9,7 @@ dri3_default=yes ;; *) -@@ -24099,7 +24099,7 @@ fi +@@ -24108,7 +24108,7 @@ fi if test "x$enable_dri" = xyes; then # Platform specific settings and drivers to build case "$host_os" in @@ -51,7 +18,7 @@ if test "x$enable_dri3" = xyes; then DEFINES="$DEFINES -DHAVE_DRI3" fi -@@ -25851,9 +25851,19 @@ if test "x$enable_opencl" = xyes; then +@@ -25972,9 +25972,19 @@ if test "x$enable_opencl" = xyes; then as_fn_error $? "cannot enable OpenCL without Gallium" "$LINENO" 5 fi @@ -71,7 +38,7 @@ if test "x$have_libclc" = xno; then as_fn_error $? "pkg-config cannot find libclc.pc which is required to build clover. -@@ -25916,9 +25926,6 @@ rm -f core conftest.err conftest.$ac_obj +@@ -26037,9 +26047,6 @@ rm -f core conftest.err conftest.$ac_obj CLANG_LIBDIR=${LLVM_LIBDIR} fi CLANG_RESOURCE_DIR=$CLANG_LIBDIR/clang/${LLVM_VERSION} Index: head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c +++ head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c @@ -1,8 +1,8 @@ # work-around for https://bugs.freedesktop.org/show_bug.cgi?id=100627 # ---- src/egl/drivers/dri2/platform_x11.c.orig 2017-04-01 15:33:36 UTC +--- src/egl/drivers/dri2/platform_x11.c.orig 2017-05-10 14:13:57 UTC +++ src/egl/drivers/dri2/platform_x11.c -@@ -1507,7 +1507,11 @@ +@@ -1509,7 +1509,11 @@ dri2_initialize_x11(_EGLDriver *drv, _EG if (!getenv("LIBGL_ALWAYS_SOFTWARE")) { #ifdef HAVE_DRI3 Index: head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c +++ head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_pipe-loader_pipe__loader__drm.c @@ -25,9 +25,9 @@ Reviewed-by: Francisco Jerez ---- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2017-04-01 15:33:37 UTC +--- src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c.orig 2017-05-10 14:13:57 UTC +++ src/gallium/auxiliary/pipe-loader/pipe_loader_drm.c -@@ -225,6 +225,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa +@@ -209,6 +209,14 @@ pipe_loader_drm_probe_fd(struct pipe_loa } static int @@ -42,7 +42,7 @@ open_drm_render_node_minor(int minor) { char path[PATH_MAX]; -@@ -236,8 +244,15 @@ open_drm_render_node_minor(int minor) +@@ -220,8 +228,15 @@ open_drm_render_node_minor(int minor) int pipe_loader_drm_probe(struct pipe_loader_device **devs, int ndev) { @@ -59,7 +59,7 @@ for (i = DRM_RENDER_NODE_MIN_MINOR, j = 0; i <= DRM_RENDER_NODE_MAX_MINOR; i++) { struct pipe_loader_device *dev; -@@ -251,6 +266,9 @@ pipe_loader_drm_probe(struct pipe_loader +@@ -235,6 +250,9 @@ pipe_loader_drm_probe(struct pipe_loader continue; } @@ -69,7 +69,7 @@ if (j < ndev) { devs[j] = dev; } else { -@@ -260,6 +278,46 @@ pipe_loader_drm_probe(struct pipe_loader +@@ -244,6 +262,46 @@ pipe_loader_drm_probe(struct pipe_loader j++; } Index: head/graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_Makefile.in =================================================================== --- head/graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_Makefile.in +++ head/graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_Makefile.in @@ -0,0 +1,13 @@ +# enable NEON instructions in the compiler when building the NEON codepath +# +--- src/gallium/drivers/vc4/Makefile.in.orig 2017-05-16 13:55:49 UTC ++++ src/gallium/drivers/vc4/Makefile.in +@@ -669,7 +669,7 @@ libvc4_la_SOURCES = $(C_SOURCES) + libvc4_la_LIBADD = $(SIM_LIB) $(VC4_LIBS) libvc4_neon.la + libvc4_la_LDFLAGS = $(SIM_LDFLAGS) + libvc4_neon_la_SOURCES = vc4_tiling_lt.c +-libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -DVC4_BUILD_NEON ++libvc4_neon_la_CFLAGS = $(AM_CFLAGS) -DVC4_BUILD_NEON -march=armv7-a -mfpu=neon + EXTRA_DIST = kernel/README + all: all-am + Index: head/graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_vc4__bufmgr.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_vc4__bufmgr.c +++ head/graphics/mesa-dri/files/patch-src_gallium_drivers_vc4_vc4__bufmgr.c @@ -0,0 +1,14 @@ +# define ETIME as ETIMEOUT same as in intel driver +# +--- src/gallium/drivers/vc4/vc4_bufmgr.c.orig 2017-05-10 14:13:57 UTC ++++ src/gallium/drivers/vc4/vc4_bufmgr.c +@@ -27,6 +27,9 @@ + #include + #include + #include ++#ifndef ETIME ++#define ETIME ETIMEDOUT ++#endif + + #include "util/u_hash_table.h" + #include "util/u_memory.h" Index: head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c +++ head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c @@ -1,9 +1,9 @@ # We don't have MAP_NORESERVE so use MAP_NOSYNC | MAP_NOCORE and # hope for the best (this alloc is too big but it's only a test) # ---- src/intel/tools/aubinator.c.orig 2017-04-01 15:33:37 UTC +--- src/intel/tools/aubinator.c.orig 2017-05-10 14:13:57 UTC +++ src/intel/tools/aubinator.c -@@ -1299,7 +1299,7 @@ int main(int argc, char *argv[]) +@@ -1221,7 +1221,7 @@ int main(int argc, char *argv[]) /* mmap a terabyte for our gtt space. */ gtt_size = 1ull << 40; gtt = mmap(NULL, gtt_size, PROT_READ | PROT_WRITE, Index: head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator__error__decode.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator__error__decode.c +++ head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator__error__decode.c @@ -0,0 +1,14 @@ +# expose getline in FreeBSD's stdio.h +# +--- src/intel/tools/aubinator_error_decode.c.orig 2017-05-10 14:13:57 UTC ++++ src/intel/tools/aubinator_error_decode.c +@@ -22,6 +22,9 @@ + * + */ + ++#ifdef __FreeBSD__ ++#define _WITH_GETLINE ++#endif + #include + #include + #include Index: head/graphics/mesa-dri/files/patch-src_mapi_glapi_gen_gl__gentable.py =================================================================== --- head/graphics/mesa-dri/files/patch-src_mapi_glapi_gen_gl__gentable.py +++ head/graphics/mesa-dri/files/patch-src_mapi_glapi_gen_gl__gentable.py @@ -1,6 +1,6 @@ ---- src/mapi/glapi/gen/gl_gentable.py.orig 2017-01-06 02:14:06 UTC +--- src/mapi/glapi/gen/gl_gentable.py.orig 2017-05-15 12:05:59 UTC +++ src/mapi/glapi/gen/gl_gentable.py -@@ -44,7 +44,7 @@ header = """/* GLXEXT is the define used +@@ -43,7 +43,7 @@ header = """/* GLXEXT is the define used #endif #if (defined(GLXEXT) && defined(HAVE_BACKTRACE)) \\ Index: head/graphics/mesa-dri/files/patch-src_mesa_main_compiler.h =================================================================== --- head/graphics/mesa-dri/files/patch-src_mesa_main_compiler.h +++ head/graphics/mesa-dri/files/patch-src_mesa_main_compiler.h @@ -1,6 +1,6 @@ ---- src/mesa/main/compiler.h.orig 2016-11-10 22:05:17 UTC +--- src/mesa/main/compiler.h.orig 2017-05-10 14:13:57 UTC +++ src/mesa/main/compiler.h -@@ -56,6 +56,9 @@ extern "C" { +@@ -51,6 +51,9 @@ #if defined(__linux__) #include #define CPU_TO_LE32( x ) bswap_32( x ) Index: head/graphics/mesa-dri/files/patch-src_util_build__id.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_util_build__id.c +++ head/graphics/mesa-dri/files/patch-src_util_build__id.c @@ -0,0 +1,17 @@ +# Elf_ doesn't exist, use Elf32_ or Elf64_ +# +--- src/util/build_id.c.orig 2017-05-10 14:13:58 UTC ++++ src/util/build_id.c +@@ -33,7 +33,11 @@ + #endif + + #ifndef ElfW +-#define ElfW(type) Elf_##type ++#ifdef __LP64__ ++#define ElfW(type) Elf64_##type ++#else ++#define ElfW(type) Elf32_##type ++#endif + #endif + + #define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1)) Index: head/graphics/mesa-dri/files/patch-src_util_ralloc.c =================================================================== --- head/graphics/mesa-dri/files/patch-src_util_ralloc.c +++ head/graphics/mesa-dri/files/patch-src_util_ralloc.c @@ -1,18 +0,0 @@ ---- src/util/ralloc.c.orig 2017-04-01 15:33:37 UTC -+++ src/util/ralloc.c -@@ -338,6 +338,7 @@ ralloc_parent(const void *ptr) - - static void *autofree_context = NULL; - -+__attribute__((destructor)) - static void - autofree(void) - { -@@ -349,7 +350,6 @@ ralloc_autofree_context(void) - { - if (unlikely(autofree_context == NULL)) { - autofree_context = ralloc_context(NULL); -- atexit(autofree); - } - return autofree_context; - } Index: head/graphics/mesa-dri/pkg-plist =================================================================== --- head/graphics/mesa-dri/pkg-plist +++ head/graphics/mesa-dri/pkg-plist @@ -25,7 +25,9 @@ @comment include/gbm.h %%I915_DRIVER%%lib/dri/i915_dri.so %%I965_DRIVER%%lib/dri/i965_dri.so +%%FREEDRENO_GDRIVER%%lib/dri/kgsl_dri.so %%SWRAST_GDRIVER%%lib/dri/kms_swrast_dri.so +%%FREEDRENO_GDRIVER%%lib/dri/msm_dri.so %%R200_DRIVER%%lib/dri/r200_dri.so %%R300_GDRIVER%%lib/dri/r300_dri.so %%R600_GDRIVER%%lib/dri/r600_dri.so @@ -34,6 +36,7 @@ %%RADEONSI_GDRIVER%%lib/dri/radeonsi_dri.so %%VAAPI%%%%RADEONSI_GDRIVER%%lib/dri/radeonsi_drv_video.so %%SWRAST_DRIVER%%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 Index: head/graphics/mesa-libs/Makefile =================================================================== --- head/graphics/mesa-libs/Makefile +++ head/graphics/mesa-libs/Makefile @@ -7,10 +7,6 @@ COMMENT= OpenGL libraries that support GLX and EGL clients -BUILD_DEPENDS+= ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs -LIB_DEPENDS+= libdrm.so:graphics/libdrm \ - libexpat.so:textproc/expat2 - USE_XORG= dri2proto dri3proto glproto presentproto x11 xcb xdamage xext \ xfixes xshmfence xxf86vm @@ -22,25 +18,25 @@ libwayland-server.so:graphics/wayland .include -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common" +.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" -CONFIGURE_ARGS+= --with-dri-drivers=swrast --with-gallium-drivers=swrast +CONFIGURE_ARGS+= --with-dri-drivers="" --with-gallium-drivers="" # libEGL needs gallium enabled which depends on llvm .if "${MESA_LLVM_VER}" != "" .if ${PORT_OPTIONS:MWAYLAND} -CONFIGURE_ARGS+= --with-egl-platforms=x11,drm,wayland +CONFIGURE_ARGS+= --with-platforms=x11,drm,wayland .else -CONFIGURE_ARGS+= --with-egl-platforms=x11,drm +CONFIGURE_ARGS+= --with-platforms=x11,drm .endif -PLIST_SUB+= EGL="" +PLIST_SUB+= EGL="" .else -CONFIGURE_ARGS+= --disable-egl +CONFIGURE_ARGS+= --disable-egl PLIST_SUB+= EGL="@comment " .if ${PORT_OPTIONS:MWAYLAND} -IGNORE= WAYLAND is an option for EGL and thus only valid on platforms with LLVM +IGNORE= option WAYLAND is only valid on platforms with LLVM +.endif .endif -.endif MESA_BUILD_WRKSRC= src/mapi MESA_INSTALL_WRKSRC= src/mapi @@ -58,10 +54,10 @@ MESA_INSTALL_WRKSRC+= src/egl .endif -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets" +.include "${MASTERDIR}/Makefile.targets" post-install: @cd ${WRKSRC}/src && ${SETENV} DESTDIR=${STAGEDIR} \ ${MAKE_CMD} install-pkgconfigDATA install-glHEADERS install-glxHEADERS -.include +.include Index: head/lang/clover/Makefile =================================================================== --- head/lang/clover/Makefile +++ head/lang/clover/Makefile @@ -7,28 +7,25 @@ COMMENT= Mesa "Clover" OpenCL library BUILD_DEPENDS= libclc>=0.2.0.20160915:devel/libclc \ - opencl>=0:devel/opencl \ - ${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs -LIB_DEPENDS= libdrm.so:graphics/libdrm \ - libexpat.so:textproc/expat2 \ - libOpenCL.so:devel/ocl-icd + opencl>=0:devel/opencl +LIB_DEPENDS= libOpenCL.so:devel/ocl-icd RUN_DEPENDS= opencl>=0:devel/opencl ONLY_FOR_ARCHS= i386 amd64 ONLY_FOR_ARCHS_REASON= Clover needs a GPU supported by the Radeon KMS driver .include -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.common" +.include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" CONFIGURE_ARGS+= --enable-opencl --enable-opencl-icd --disable-dri \ - --disable-egl --disable-gbm --disable-glx \ + --disable-egl --disable-gbm --disable-gles2 --disable-glx \ --disable-va --disable-vdpau --disable-xvmc \ - --with-gallium-drivers=r600,radeonsi + --with-gallium-drivers=r600,radeonsi # only supported GPUs #MESA_BUILD_WRKSRC= src/util src/compiler src/mesa src/gallium MESA_INSTALL_WRKSRC= src/gallium/targets/opencl src/gallium/targets/pipe-loader -.include "${.CURDIR}/../../graphics/mesa-dri/Makefile.targets" +.include "${MASTERDIR}/Makefile.targets" pre-configure: @if [ -e ${LOCALBASE}/bin/llvm-config${MESA_LLVM_VER} ] && \ @@ -40,4 +37,4 @@ post-install: @${MV} ${STAGEDIR}/etc/OpenCL ${STAGEDIR}${PREFIX}/etc/ -.include +.include