Index: head/graphics/libdrm/Makefile =================================================================== --- head/graphics/libdrm/Makefile +++ head/graphics/libdrm/Makefile @@ -3,6 +3,7 @@ PORTNAME= libdrm PORTVERSION= 2.4.80 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= graphics x11 MASTER_SITES= http://dri.freedesktop.org/libdrm/ @@ -20,33 +21,25 @@ USE_LDCONFIG= yes INSTALL_TARGET= install-strip -OPTIONS_DEFINE= MANPAGES +OPTIONS_DEFINE= MANPAGES TESTS +OPTIONS_SUB= yes + +TESTS_DESC= Install test programs (which are always built) .if defined(PACKAGE_BUILDING) OPTIONS_DEFAULT+= MANPAGES .endif -.include +MANPAGES_CONFIGURE_ENABLE= manpages +MANPAGES_BUILD_DEPENDS= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl +MANPAGES_USE= GNOME=libxslt:build -# KMS support in the kernel is only build on these archs, disable others -.if ${ARCH} == "amd64" || ${ARCH} == "i386" -CONFIGURE_ARGS+=--enable-libkms -PLIST_SUB+= KMS="" -.else -CONFIGURE_ARGS+=--disable-libkms -PLIST_SUB+= KMS="@comment " -.endif +TESTS_CONFIGURE_ENABLE= install-test-programs -.if ${PORT_OPTIONS:MMANPAGES} -BUILD_DEPENDS+= ${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl -USE_GNOME+= libxslt:build -PLIST_SUB+= MAN="" -.else -CONFIGURE_ARGS+=--disable-manpages -PLIST_SUB+= MAN="@comment " -.endif +# avoid circular dependency in case cairo supports OpenGL (cairo->mesa-libs->libdrm->cairo) +CONFIGURE_ARGS+= --disable-cairo-tests -CONFIGURE_ARGS+=--disable-vmwgfx +.include .if ${ARCH} == amd64 || ${ARCH} == i386 PLIST_SUB+= ARM_DRIVERS="@comment " Index: head/graphics/libdrm/files/patch-libkms_vmwgfx.c =================================================================== --- head/graphics/libdrm/files/patch-libkms_vmwgfx.c +++ head/graphics/libdrm/files/patch-libkms_vmwgfx.c @@ -0,0 +1,27 @@ +# the defintion of ERESTART is behind a check for _KERNEL, but +# defining that causes errno to not be defined. fortunately, there's +# an alternative switch. unfortunately, those differ by platform and +# _WANT_KERNEL_ERRNO is too recent to be part of any release, so just +# define ERESTART if we still don't have it after including errno.h +# +--- libkms/vmwgfx.c.orig 2017-04-14 23:29:46 UTC ++++ libkms/vmwgfx.c +@@ -30,10 +30,18 @@ + #include "config.h" + #endif + ++#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) ++#define _WANT_KERNEL_ERRNO ++#elif defined(__DragonFly__) ++#define _KERNEL_STRUCTURES ++#endif + #include + #include + #include + #include "internal.h" ++#ifndef ERESTART ++#define ERESTART (-1) ++#endif + + #include "xf86drm.h" + #include "libdrm_macros.h" Index: head/graphics/libdrm/files/patch-libsync.h =================================================================== --- head/graphics/libdrm/files/patch-libsync.h +++ head/graphics/libdrm/files/patch-libsync.h @@ -0,0 +1,14 @@ +# define ETIME as ETIMEOUT same as done in Mesa +# +--- libsync.h.orig 2017-04-14 23:29:46 UTC ++++ libsync.h +@@ -35,6 +35,9 @@ + #include + #include + #include ++#ifndef ETIME ++#define ETIME ETIMEDOUT ++#endif + + #if defined(__cplusplus) + extern "C" { Index: head/graphics/libdrm/pkg-plist =================================================================== --- head/graphics/libdrm/pkg-plist +++ head/graphics/libdrm/pkg-plist @@ -1,3 +1,10 @@ +%%TESTS%%bin/kms-steal-crtc +%%TESTS%%bin/kms-universal-planes +%%TESTS%%bin/kmstest +%%TESTS%%bin/modeprint +%%TESTS%%bin/modetest +%%TESTS%%bin/proptest +%%TESTS%%bin/vbltest %%ARM_DRIVERS%%include/freedreno/freedreno_drmif.h %%ARM_DRIVERS%%include/freedreno/freedreno_ringbuffer.h %%RADEON_DRIVERS%%include/libdrm/amdgpu.h @@ -40,7 +47,8 @@ %%ARM_DRIVERS%%include/libdrm/vc4_qpu_defines.h include/libdrm/via_drm.h include/libdrm/virtgpu_drm.h -%%KMS%%include/libkms/libkms.h +include/libdrm/vmwgfx_drm.h +include/libkms/libkms.h include/libsync.h include/xf86drm.h include/xf86drmMode.h @@ -62,9 +70,9 @@ %%RADEON_DRIVERS%%lib/libdrm_radeon.so %%RADEON_DRIVERS%%lib/libdrm_radeon.so.1 %%RADEON_DRIVERS%%lib/libdrm_radeon.so.1.0.1 -%%KMS%%lib/libkms.so -%%KMS%%lib/libkms.so.1 -%%KMS%%lib/libkms.so.1.0.0 +lib/libkms.so +lib/libkms.so.1 +lib/libkms.so.1.0.0 libdata/pkgconfig/libdrm.pc %%RADEON_DRIVERS%%libdata/pkgconfig/libdrm_amdgpu.pc %%ARM_DRIVERS%%libdata/pkgconfig/libdrm_freedreno.pc @@ -72,13 +80,13 @@ %%NOUVEAU_DRIVER%%libdata/pkgconfig/libdrm_nouveau.pc %%RADEON_DRIVERS%%libdata/pkgconfig/libdrm_radeon.pc %%ARM_DRIVERS%%libdata/pkgconfig/libdrm_vc4.pc -%%KMS%%libdata/pkgconfig/libkms.pc -%%MAN%%man/man3/drmAvailable.3.gz -%%MAN%%man/man3/drmHandleEvent.3.gz -%%MAN%%man/man3/drmModeGetResources.3.gz -%%MAN%%man/man7/drm-gem.7.gz -%%MAN%%man/man7/drm-kms.7.gz -%%MAN%%man/man7/drm-memory.7.gz -%%MAN%%man/man7/drm-mm.7.gz -%%MAN%%man/man7/drm-ttm.7.gz -%%MAN%%man/man7/drm.7.gz +libdata/pkgconfig/libkms.pc +%%MANPAGES%%man/man3/drmAvailable.3.gz +%%MANPAGES%%man/man3/drmHandleEvent.3.gz +%%MANPAGES%%man/man3/drmModeGetResources.3.gz +%%MANPAGES%%man/man7/drm-gem.7.gz +%%MANPAGES%%man/man7/drm-kms.7.gz +%%MANPAGES%%man/man7/drm-memory.7.gz +%%MANPAGES%%man/man7/drm-mm.7.gz +%%MANPAGES%%man/man7/drm-ttm.7.gz +%%MANPAGES%%man/man7/drm.7.gz