pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/MesaLib MesaLib: various changes to how this ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/eb5abecd924f
branches:  trunk
changeset: 338764:eb5abecd924f
user:      nia <nia%pkgsrc.org@localhost>
date:      Fri Aug 30 13:00:56 2019 +0000

description:
MesaLib: various changes to how this is built

- Try to appease the Darwin build.
- Simplify and reduce the number of options to make testing easier.
- Silence lots of pkglint warnings.
- Enable the surfaceless platform as recommended by Mesa.
- Switch to gallium swrast as recommended by Mesa.
- Switch to gallium osmesa as recommended by Mesa.
- Support building without X11.

todo:
- glvnd support (needs testing to figure out which platforms it builds on)
- make AMD drivers optional on platforms like aarch64

Bump PKGREVISION.

diffstat:

 graphics/MesaLib/Makefile      |  125 ++++++++++++++-
 graphics/MesaLib/PLIST         |   97 +++++-------
 graphics/MesaLib/buildlink3.mk |   45 +++--
 graphics/MesaLib/dri.mk        |   31 ----
 graphics/MesaLib/options.mk    |  315 +++++++++-------------------------------
 5 files changed, 251 insertions(+), 362 deletions(-)

diffs (truncated from 759 to 300 lines):

diff -r 1cd41305a6a3 -r eb5abecd924f graphics/MesaLib/Makefile
--- a/graphics/MesaLib/Makefile Fri Aug 30 12:33:35 2019 +0000
+++ b/graphics/MesaLib/Makefile Fri Aug 30 13:00:56 2019 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.157 2019/08/28 09:09:15 nia Exp $
+# $NetBSD: Makefile,v 1.158 2019/08/30 13:00:56 nia Exp $
 
 DISTNAME=      mesa-19.1.5
 PKGNAME=       ${DISTNAME:S/mesa/MesaLib/}
-CATEGORIES=    graphics x11
+PKGREVISION=   1
+CATEGORIES=    graphics
 MASTER_SITES=  https://mesa.freedesktop.org/archive/
 EXTRACT_SUFX=  .tar.xz
 
@@ -37,15 +38,115 @@
 CXXFLAGS.SunOS+=       -Drestrict=__restrict__
 LDFLAGS.SunOS+=                -lsocket -lnsl
 
+# Some of these get appended in options.mk.
+DRI_DRIVERS=           #
+GALLIUM_DRIVERS=       swrast
+VULKAN_DRIVERS=                #
+MESA_PLATFORMS=                surfaceless
+
 .include "../../mk/bsd.prefs.mk"
 .include "../../mk/compiler.mk"
 .include "options.mk"
 
+PLIST_SUBST+=  GLVER="1.2.0"
+
+# classic DRI drivers
+PLIST_VARS+=           i915 i965 r100 r200 nouveau_dri
+
+# Gallium drivers
+PLIST_VARS+=           r300 svga nouveau vc4
+
+# other features
+PLIST_VARS+=           egl gbm vaapi xatracker
+
+.if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
+.include "../../x11/libdrm/buildlink3.mk"
+MESA_PLATFORMS+=       drm
+MESON_ARGS+=           -Ddri3=true
+MESON_ARGS+=           -Dgallium-xa=true
+PLIST.xatracker=       yes
+.  if ${OPSYS} != "SunOS"
+MESON_ARGS+=           -Degl=true
+MESON_ARGS+=           -Dgbm=true
+PLIST.egl=             yes
+PLIST.gbm=             yes
+.  else
+MESON_ARGS+=           -Degl=false
+MESON_ARGS+=           -Dgbm=false
+.  endif
+.  include "../../multimedia/libva/available.mk"
+.  if ${VAAPI_AVAILABLE} == "yes"
+MESON_ARGS+=           -Dgallium-va=true
+PLIST.vaapi=           yes
+.    include "../../multimedia/libva/buildlink3.mk"
+.  else
+MESON_ARGS+=           -Dgallium-va=false
+.  endif
+.  if !empty(MACHINE_PLATFORM:MNetBSD-*-*arm*)
+# ARM Mali Utgard
+#GALLIUM_DRIVERS+=     lima
+#PLIST.lima=           yes
+# ARM Mali Midgard, Bifrost
+#GALLIUM_DRIVERS+=     panfrost
+#PLIST.panfrost=       yes
+# Vivante GCxxx
+#GALLIUM_DRIVERS+=     etnaviv
+#PLIST.etnaviv=                yes
+# Qualcomm Snapdragon
+#GALLIUM_DRIVERS+=     freedreno
+#PLIST.freedreno=      yes
+# Broadcom VideoCore 4
+GALLIUM_DRIVERS+=      vc4
+PLIST.vc4=             yes
+.  endif
+.  if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+GALLIUM_DRIVERS+=      svga
+DRI_DRIVERS+=          i915 i965
+PLIST.svga=            yes
+PLIST.i915=            yes
+PLIST.i965=            yes
+.  endif
+# FreeBSD lacks nouveau support (there are official binaries from Nvidia)
+.  if ${OPSYS} != "FreeBSD"
+PLIST.nouveau=         yes
+PLIST.nouveau_dri=     yes
+GALLIUM_DRIVERS+=      nouveau
+DRI_DRIVERS+=          nouveau
+.  endif
+.  if !empty(MACHINE_PLATFORM:MLinux-*-x86_64)
+# qemu Linux guest driver
+# XXX test this
+#GALLIUM_DRIVERS+=     virgl
+#PLIST.virgl=          yes
+.  endif
+# theoretically cross platform PCI drivers
+.  if empty(MACHINE_PLATFORM:MNetBSD-*-*arm*) && \
+      empty(MACHINE_PLATFORM:MNetBSD-*-mipsel)
+DRI_DRIVERS+=          r100 r200
+GALLIUM_DRIVERS+=      r300
+PLIST.r100=            yes
+PLIST.r200=            yes
+PLIST.r300=            yes
+.  endif
+.else
+MESON_ARGS+=           -Degl=false
+MESON_ARGS+=           -Dgbm=false
+.endif # ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
+
+MESON_ARGS+=   -Dgallium-drivers=${GALLIUM_DRIVERS:ts,}
+MESON_ARGS+=   -Ddri-drivers=${DRI_DRIVERS:ts,}
+MESON_ARGS+=   -Dvulkan-drivers=${VULKAN_DRIVERS:ts,}
+MESON_ARGS+=   -Dplatforms=${MESA_PLATFORMS:ts,}
+
 .if ${MACHINE_ARCH} == "i386"
 MESON_ARGS+=   -Dglx-read-only-text=true
 .endif
 
+MESON_ARGS+=   -Dgles1=true
+MESON_ARGS+=   -Dgles2=true
+MESON_ARGS+=   -Dosmesa=gallium
 MESON_ARGS+=   -Dshared-glapi=true
+MESON_ARGS+=   -Dgallium-xvmc=false
 
 CPPFLAGS+=     -DHAVE_NOATEXIT
 CPPFLAGS+=     -DSYSCONFDIR=${PKG_SYSCONFDIR}
@@ -57,18 +158,22 @@
 CXXFLAGS.NetBSD+=      -Dalloca=__builtin_alloca
 
 PYTHON_FOR_BUILD_ONLY= yes
-BUILD_DEPENDS+=                ${PYPKGPREFIX}-mako-[0-9]*:../../devel/py-mako
+
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-mako-[0-9]*:../../devel/py-mako
+
 # needed to build vulkan support
-BUILD_DEPENDS+=                ${PYPKGPREFIX}-cElementTree-[0-9]*:../../textproc/py-cElementTree
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-cElementTree-[0-9]*:../../textproc/py-cElementTree
 
 # LLVM detection
 TOOL_DEPENDS+=         ${PYPKGPREFIX}-meson>=0.51.1nb3:../../devel/py-meson
 
-EGDIR=                 ${PREFIX}/share/examples/mesa
+EGDIR=         ${PREFIX}/share/examples/mesa
+
+OWN_DIRS=      ${PKG_SYSCONFDIR}/drirc.d
+CONF_FILES+=   ${EGDIR}/00-mesa-defaults.conf \
+               ${PKG_SYSCONFDIR}/drirc.d/00-mesa-defaults.conf
+
 INSTALLATION_DIRS+=    ${EGDIR}
-OWN_DIRS=              ${PKG_SYSCONFDIR}/drirc.d
-CONF_FILES+=           ${EGDIR}/00-mesa-defaults.conf \
-                       ${PKG_SYSCONFDIR}/drirc.d/00-mesa-defaults.conf
 
 pre-configure:
        touch ${WRKSRC}/src/glx/apple_dummy.cpp
@@ -79,8 +184,4 @@
 .include "../../devel/py-meson/build.mk"
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../textproc/expat/buildlink3.mk"
-.include "../../x11/libXrandr/buildlink3.mk"
-.include "../../x11/libX11/buildlink3.mk"
-.include "../../x11/libXext/buildlink3.mk"
-.include "../../x11/libxcb/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r 1cd41305a6a3 -r eb5abecd924f graphics/MesaLib/PLIST
--- a/graphics/MesaLib/PLIST    Fri Aug 30 12:33:35 2019 +0000
+++ b/graphics/MesaLib/PLIST    Fri Aug 30 13:00:56 2019 +0000
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.41 2019/08/26 14:01:27 nia Exp $
+@comment $NetBSD: PLIST,v 1.42 2019/08/30 13:00:56 nia Exp $
 ${PLIST.egl}include/EGL/egl.h
 ${PLIST.egl}include/EGL/eglext.h
 ${PLIST.egl}include/EGL/eglextchromium.h
@@ -8,76 +8,59 @@
 include/GL/gl_mangle.h
 include/GL/glcorearb.h
 include/GL/glext.h
-include/GL/glx.h
-include/GL/glx_mangle.h
-include/GL/glxext.h
-${PLIST.dri}include/GL/internal/dri_interface.h
-${PLIST.osmesa}include/GL/osmesa.h
-${PLIST.glesv1}include/GLES/egl.h
-${PLIST.glesv1}include/GLES/gl.h
-${PLIST.glesv1}include/GLES/glext.h
-${PLIST.glesv1}include/GLES/glplatform.h
-${PLIST.glesv2}include/GLES2/gl2.h
-${PLIST.glesv2}include/GLES2/gl2ext.h
-${PLIST.glesv2}include/GLES2/gl2platform.h
-${PLIST.glesv2}include/GLES3/gl3.h
-${PLIST.glesv2}include/GLES3/gl31.h
-${PLIST.glesv2}include/GLES3/gl32.h
-${PLIST.glesv2}include/GLES3/gl3ext.h
-${PLIST.glesv2}include/GLES3/gl3platform.h
+${PLIST.glx}include/GL/glx.h
+${PLIST.glx}include/GL/glx_mangle.h
+${PLIST.glx}include/GL/glxext.h
+include/GL/internal/dri_interface.h
+include/GL/osmesa.h
+include/GLES/egl.h
+include/GLES/gl.h
+include/GLES/glext.h
+include/GLES/glplatform.h
+include/GLES2/gl2.h
+include/GLES2/gl2ext.h
+include/GLES2/gl2platform.h
+include/GLES3/gl3.h
+include/GLES3/gl31.h
+include/GLES3/gl32.h
+include/GLES3/gl3ext.h
+include/GLES3/gl3platform.h
 include/KHR/khrplatform.h
 ${PLIST.gbm}include/gbm.h
-${PLIST.vulkan}include/vulkan/vulkan_intel.h
 ${PLIST.xatracker}include/xa_composite.h
 ${PLIST.xatracker}include/xa_context.h
 ${PLIST.xatracker}include/xa_tracker.h
-@comment ${PLIST.vaapi}lib/dri/gallium_drv_video.la
-@comment ${PLIST.vaapi}lib/dri/gallium_drv_video.so
 ${PLIST.i915}lib/dri/i915_dri.so
 ${PLIST.i965}lib/dri/i965_dri.so
-@comment ${PLIST.ilo}lib/dri/ilo_dri.so
-${PLIST.freedreno}lib/dri/kgsl_dri.so
-${PLIST.swrast}lib/dri/kms_swrast_dri.so
-${PLIST.freedreno}lib/dri/msm_dri.so
+lib/dri/kms_swrast_dri.so
 ${PLIST.nouveau}lib/dri/nouveau_dri.so
-@comment ${PLIST.vdpau}lib/dri/nouveau_drv_video.la
 ${PLIST.nouveau}${PLIST.vaapi}lib/dri/nouveau_drv_video.so
 ${PLIST.nouveau_dri}lib/dri/nouveau_vieux_dri.so
-@comment ${PLIST.vdpau}lib/dri/radeonsi_drv_video.la
 ${PLIST.r200}lib/dri/r200_dri.so
 ${PLIST.r300}lib/dri/r300_dri.so
 ${PLIST.r600}lib/dri/r600_dri.so
-@comment ${PLIST.vdpau}lib/dri/r600_drv_video.la
-${PLIST.vaapi}lib/dri/r600_drv_video.so
+${PLIST.r600}${PLIST.vaapi}lib/dri/r600_drv_video.so
 ${PLIST.r100}lib/dri/radeon_dri.so
 ${PLIST.radeonsi}lib/dri/radeonsi_dri.so
-${PLIST.vaapi}lib/dri/radeonsi_drv_video.so
-${PLIST.swrast_dri}lib/dri/swrast_dri.so
+${PLIST.r600}${PLIST.vaapi}lib/dri/radeonsi_drv_video.so
+lib/dri/swrast_dri.so
 ${PLIST.vc4}lib/dri/vc4_dri.so
 ${PLIST.svga}lib/dri/vmwgfx_dri.so
 ${PLIST.egl}lib/libEGL.so
 ${PLIST.egl}lib/libEGL.so.1
 ${PLIST.egl}lib/libEGL.so.1.0.0
-lib/libGL.so
-lib/libGL.so.1
-lib/libGL.so.${GLVER}
-${PLIST.glesv1}lib/libGLESv1_CM.so
-${PLIST.glesv1}lib/libGLESv1_CM.so.1
-${PLIST.glesv1}lib/libGLESv1_CM.so.1.1.0
-${PLIST.glesv2}lib/libGLESv2.so
-${PLIST.glesv2}lib/libGLESv2.so.2
-${PLIST.glesv2}lib/libGLESv2.so.2.0.0
-${PLIST.osmesa}lib/libOSMesa.so
-${PLIST.osmesa}lib/libOSMesa.so.8
-${PLIST.osmesa}lib/libOSMesa.so.8.0.0
-${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so
-${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1
-${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1.0
-${PLIST.xvmc}${PLIST.nouveau}lib/libXvMCnouveau.so.1.0.0
-${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so
-${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1
-${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1.0
-${PLIST.xvmc}${PLIST.r600}lib/libXvMCr600.so.1.0.0
+${PLIST.glx}lib/libGL.so
+${PLIST.glx}lib/libGL.so.1
+${PLIST.glx}lib/libGL.so.${GLVER}
+lib/libGLESv1_CM.so
+lib/libGLESv1_CM.so.1
+lib/libGLESv1_CM.so.1.1.0
+lib/libGLESv2.so
+lib/libGLESv2.so.2
+lib/libGLESv2.so.2.0.0
+lib/libOSMesa.so
+lib/libOSMesa.so.8
+lib/libOSMesa.so.8.0.0
 ${PLIST.gbm}lib/libgbm.so
 ${PLIST.gbm}lib/libgbm.so.1
 ${PLIST.gbm}lib/libgbm.so.1.0.0
@@ -87,13 +70,13 @@
 ${PLIST.xatracker}lib/libxatracker.so
 ${PLIST.xatracker}lib/libxatracker.so.2
 ${PLIST.xatracker}lib/libxatracker.so.2.5.0
-${PLIST.dri}lib/pkgconfig/dri.pc
+lib/pkgconfig/dri.pc
 ${PLIST.egl}lib/pkgconfig/egl.pc
 ${PLIST.gbm}lib/pkgconfig/gbm.pc
-lib/pkgconfig/gl.pc
-${PLIST.glesv1}lib/pkgconfig/glesv1_cm.pc
-${PLIST.glesv2}lib/pkgconfig/glesv2.pc
-${PLIST.osmesa}lib/pkgconfig/osmesa.pc



Home | Main Index | Thread Index | Old Index