pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/graphics/MesaLib MesaLib: Add a features.mk and use it...
details: https://anonhg.NetBSD.org/pkgsrc/rev/52a02e8c4947
branches: trunk
changeset: 403101:52a02e8c4947
user: nia <nia%pkgsrc.org@localhost>
date: Mon Oct 21 20:47:55 2019 +0000
description:
MesaLib: Add a features.mk and use it to detect the presence of DRI
No functional change (probably)
diffstat:
graphics/MesaLib/Makefile | 10 +++++-----
graphics/MesaLib/buildlink3.mk | 32 +++-----------------------------
graphics/MesaLib/features.mk | 36 ++++++++++++++++++++++++++++++++++++
graphics/MesaLib/options.mk | 13 +++++++------
4 files changed, 51 insertions(+), 40 deletions(-)
diffs (185 lines):
diff -r 525851cd406a -r 52a02e8c4947 graphics/MesaLib/Makefile
--- a/graphics/MesaLib/Makefile Mon Oct 21 20:47:07 2019 +0000
+++ b/graphics/MesaLib/Makefile Mon Oct 21 20:47:55 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.171 2019/10/21 12:07:32 jperkin Exp $
+# $NetBSD: Makefile,v 1.172 2019/10/21 20:47:55 nia Exp $
DISTNAME= mesa-19.2.1
PKGNAME= ${DISTNAME:S/mesa/MesaLib/}
@@ -6,7 +6,7 @@
MASTER_SITES= https://mesa.freedesktop.org/archive/
EXTRACT_SUFX= .tar.xz
-MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+MAINTAINER= nia%NetBSD.org@localhost
HOMEPAGE= https://www.mesa3d.org/
COMMENT= Open source OpenGL implementation
LICENSE= mit
@@ -31,8 +31,8 @@
VULKAN_DRIVERS= #
MESA_PLATFORMS= surfaceless
-.include "../../mk/bsd.prefs.mk"
.include "../../mk/compiler.mk"
+.include "features.mk"
.include "options.mk"
PLIST_SUBST+= GLVER="1.2.0"
@@ -46,7 +46,7 @@
# other features
PLIST_VARS+= egl gbm vaapi xatracker
-.if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
+.if ${MESALIB_SUPPORTS_DRI} == "yes"
BUILDLINK_API_DEPENDS.libdrm+= libdrm>=2.4.81
.include "../../x11/libdrm/buildlink3.mk"
MESA_PLATFORMS+= drm
@@ -114,7 +114,7 @@
.else
MESON_ARGS+= -Degl=false
MESON_ARGS+= -Dgbm=false
-.endif # ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
+.endif # ${MESALIB_SUPPORTS_DRI} == "yes"
MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,}
MESON_ARGS+= -Ddri-drivers=${DRI_DRIVERS:ts,}
diff -r 525851cd406a -r 52a02e8c4947 graphics/MesaLib/buildlink3.mk
--- a/graphics/MesaLib/buildlink3.mk Mon Oct 21 20:47:07 2019 +0000
+++ b/graphics/MesaLib/buildlink3.mk Mon Oct 21 20:47:55 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.64 2019/10/21 12:30:36 nia Exp $
+# $NetBSD: buildlink3.mk,v 1.65 2019/10/21 20:47:55 nia Exp $
BUILDLINK_TREE+= MesaLib
@@ -9,7 +9,7 @@
BUILDLINK_ABI_DEPENDS.MesaLib+= MesaLib>=7.11.2
BUILDLINK_PKGSRCDIR.MesaLib?= ../../graphics/MesaLib
-.include "../../mk/bsd.fast.prefs.mk"
+.include "../../graphics/MesaLib/features.mk"
# See <http://developer.apple.com/qa/qa2007/qa1567.html>.
.if ${X11_TYPE} == "native" && !empty(MACHINE_PLATFORM:MDarwin-[9].*-*)
@@ -18,32 +18,6 @@
pkgbase:= MesaLib
-.if ${X11_TYPE} == "modular"
-MESALIB_SUPPORTS_OSMESA= yes
-MESALIB_SUPPORTS_GLESv2= yes
-. if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
-MESALIB_SUPPORTS_EGL= yes
-. else
-MESALIB_SUPPORTS_EGL= no
-. endif
-.else
-. if exists(${X11BASE}/include/EGL/egl.h)
-MESALIB_SUPPORTS_EGL= yes
-. else
-MESALIB_SUPPORTS_EGL= no
-. endif
-. if exists(${X11BASE}/lib/libOSMesa.so)
-MESALIB_SUPPORTS_OSMESA= yes
-. else
-MESALIB_SUPPORTS_OSMESA= no
-. endif
-. if exists(${X11BASE}/include/GLES2/gl2.h)
-MESALIB_SUPPORTS_GLESv2= yes
-. else
-MESALIB_SUPPORTS_GLESv2= no
-. endif
-.endif
-
.include "../../mk/pkg-build-options.mk"
.if !empty(PKG_BUILD_OPTIONS.MesaLib:Mwayland)
@@ -63,7 +37,7 @@
. include "../../x11/xorgproto/buildlink3.mk"
.endif
-.if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
+.if ${MESALIB_SUPPORTS_DRI} == "yes"
. include "../../x11/libdrm/buildlink3.mk"
.endif
diff -r 525851cd406a -r 52a02e8c4947 graphics/MesaLib/features.mk
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/MesaLib/features.mk Mon Oct 21 20:47:55 2019 +0000
@@ -0,0 +1,36 @@
+# $NetBSD: features.mk,v 1.1 2019/10/21 20:47:55 nia Exp $
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if !defined(MESALIB_SUPPORTS_DRI)
+. for dri_os in DragonFly FreeBSD NetBSD OpenBSD Linux SunOS
+. if !empty(OPSYS:M${dri_os})
+MESALIB_SUPPORTS_DRI?= yes
+. endif
+. endfor
+.endif
+
+MESALIB_SUPPORTS_DRI?= no
+
+.if ${X11_TYPE} == "modular"
+MESALIB_SUPPORTS_OSMESA?= yes
+MESALIB_SUPPORTS_GLESv2?= yes
+. if ${MESALIB_SUPPORTS_DRI} == "yes"
+MESALIB_SUPPORTS_EGL?= yes
+. else
+. endif
+.else
+. if exists(${X11BASE}/include/EGL/egl.h)
+MESALIB_SUPPORTS_EGL?= yes
+. endif
+. if exists(${X11BASE}/lib/libOSMesa.so)
+MESALIB_SUPPORTS_OSMESA?= yes
+. endif
+. if exists(${X11BASE}/include/GLES2/gl2.h)
+MESALIB_SUPPORTS_GLESv2?= yes
+. endif
+.endif
+
+MESALIB_SUPPORTS_EGL?= no
+MESALIB_SUPPORTS_GLESv2?= no
+MESALIB_SUPPORTS_OSMESA?= no
diff -r 525851cd406a -r 52a02e8c4947 graphics/MesaLib/options.mk
--- a/graphics/MesaLib/options.mk Mon Oct 21 20:47:07 2019 +0000
+++ b/graphics/MesaLib/options.mk Mon Oct 21 20:47:55 2019 +0000
@@ -1,10 +1,12 @@
-# $NetBSD: options.mk,v 1.75 2019/10/21 12:30:36 nia Exp $
+# $NetBSD: options.mk,v 1.76 2019/10/21 20:47:55 nia Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.MesaLib
+.include "features.mk"
+
PKG_SUPPORTED_OPTIONS+= llvm vulkan x11
-.if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
+.if ${MESALIB_SUPPORTS_DRI} == "yes"
PKG_SUPPORTED_OPTIONS+= wayland
.endif
@@ -15,9 +17,8 @@
#
# Enable it by default on platforms where such GPUs might be encountered or
# LLVM-accelerated software rendering might be useful.
-.if ${OPSYS} != "SunOS" && \
- ${OPSYS} != "Darwin" && \
- ${OPSYS} != "Cygwin" && \
+.if ${MESALIB_SUPPORTS_DRI} == "yes" && \
+ ${OPSYS} != "SunOS" && \
(${MACHINE_ARCH} == "i386" || \
${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH} == "aarch64")
@@ -82,7 +83,7 @@
.if !empty(PKG_OPTIONS:Mx11)
MESA_PLATFORMS+= x11
PLIST.glx= yes
-. if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
+. if ${MESALIB_SUPPORTS_DRI} == "yes"
MESON_ARGS+= -Dglx=dri
. include "../../multimedia/libvdpau/available.mk"
. if ${VDPAU_AVAILABLE} == "yes"
Home |
Main Index |
Thread Index |
Old Index