tech-pkg archive

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

[PATCH] graphics/MesaLib: add osmesa option



Hi,

I sent a version this patch several months ago to the -users list. Any
final comment here? Would someone consider doing a commit of this?

I use it to build pkgsrc with graphical fun on headless servers, using
osmesa as viable software rasterizer for X11 sessions over ssh.


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
Universität Hamburg
RRZ / Basis-Infrastruktur / HPC
Schlüterstr. 70
20146 Hamburg
Tel.: 040/42838 8826
Fax: 040/428 38 6270
Index: graphics/MesaLib/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/MesaLib/Makefile,v
retrieving revision 1.139
diff -u -r1.139 Makefile
--- graphics/MesaLib/Makefile	3 Sep 2017 08:53:09 -0000	1.139
+++ graphics/MesaLib/Makefile	5 Oct 2017 12:57:06 -0000
@@ -45,10 +45,14 @@
 SUBST_FILES.wrapper-bug=	src/gbm/Makefile.in
 SUBST_FILES.wrapper-bug+=	src/glx/Makefile.in
 SUBST_FILES.wrapper-bug+=	src/mapi/Makefile.in
+SUBST_FILES.wrapper-bug+=	src/mesa/Makefile.in
 SUBST_FILES.wrapper-bug+=	src/mesa/drivers/x11/Makefile.in
+SUBST_FILES.wrapper-bug+=	src/mesa/drivers/osmesa/Makefile.in
+SUBST_FILES.wrapper-bug+=       src/gallium/targets/libgl-xlib/Makefile.in
 SUBST_SED.wrapper-bug=		-e 's,shared-glapi/libglapi.la,shared-glapi/libglapi_tmp_rename.la,g'
 SUBST_SED.wrapper-bug+=		-e 's,libglapi.la,libglapi_impl.la,g'
 SUBST_SED.wrapper-bug+=		-e 's,libglapi_tmp_rename.la,libglapi.la,g'
+SUBST_SED.wrapper-bug+=         -e 's,^\(LTCPPASCOMPILE = $$(LIBTOOL)\) \($$(AM_V_lt)\),\1 --tag=CC \2,'
 
 # Replace /etc/drirc with ${PREFIX}/etc/drirc
 SUBST_CLASSES+=			drirc
@@ -112,4 +116,5 @@
 .include "../../x11/libX11/buildlink3.mk"
 .include "../../x11/libXext/buildlink3.mk"
 .include "../../x11/libxcb/buildlink3.mk"
+.include "../../x11/glproto/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
Index: graphics/MesaLib/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/MesaLib/PLIST,v
retrieving revision 1.35
diff -u -r1.35 PLIST
--- graphics/MesaLib/PLIST	24 Feb 2017 13:48:33 -0000	1.35
+++ graphics/MesaLib/PLIST	5 Oct 2017 12:57:06 -0000
@@ -81,3 +81,7 @@
 ${PLIST.vdpau}lib/vdpau/libvdpau_radeonsi.so.1.0.0
 ${PLIST.vaapi}lib/dri/gallium_drv_video.la
 ${PLIST.vaapi}lib/dri/gallium_drv_video.so
+${PLIST.osmesa}lib/pkgconfig/osmesa.pc
+${PLIST.osmesa}lib/libOSMesa.la
+@comment For some reason, it is not part of the libGL.la anymore?!
+${PLIST.osmesa}lib/libGL.so.1.6.0
Index: graphics/MesaLib/options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/MesaLib/options.mk,v
retrieving revision 1.57
diff -u -r1.57 options.mk
--- graphics/MesaLib/options.mk	1 Jul 2017 12:48:10 -0000	1.57
+++ graphics/MesaLib/options.mk	5 Oct 2017 12:57:06 -0000
@@ -1,7 +1,7 @@
 # $NetBSD: options.mk,v 1.57 2017/07/01 12:48:10 maya Exp $
 
 PKG_OPTIONS_VAR=		PKG_OPTIONS.MesaLib
-PKG_SUPPORTED_OPTIONS=		llvm dri
+PKG_SUPPORTED_OPTIONS=		llvm dri osmesa
 PKG_SUGGESTED_OPTIONS=
 
 # The LLVM option enables JIT accelerated software rendering and
@@ -21,6 +21,7 @@
 
 .include "../../mk/bsd.options.mk"
 
+PLIST_VARS+=    osmesa
 # gallium
 PLIST_VARS+=	freedreno ilo i915 i965 nouveau r300 r600 radeonsi	\
 		swrast svga vc4 virgl
@@ -29,6 +30,24 @@
 # other features
 PLIST_VARS+=	gbm vaapi vdpau wayland xatracker
 
+GALLIUM_DRIVERS=	#
+.if ${OPSYS} != "Darwin"
+GALLIUM_DRIVERS+=	swrast
+.endif
+
+
+# OSMesa wants swrast,llvmpipe,softpipe; hoping for swrast at least.
+# I would like a non-DRI build with llvmpipe. Can I have that with pkgsrc?
+# Or swr, even?
+# I am getting linking/dependency trouble with glapi; is this due to pkgsrc hackery?
+# Does disabling shared glapi help?
+.if !empty(PKG_OPTIONS:Mosmesa)
+PLIST.osmesa= yes
+CONFIGURE_ARGS+=	--enable-osmesa
+.else
+CONFIGURE_ARGS+=        --disable-osmesa
+.endif
+
 .if !empty(PKG_OPTIONS:Mdri)
 
 CONFIGURE_ARGS+=	--enable-dri
@@ -67,15 +86,13 @@
 .include "../../graphics/MesaLib/dri.mk"
 
 DRI_DRIVERS=		#
-GALLIUM_DRIVERS=	#
 
 # Software rasterizer
+# It is all DRI?! The DRI-less gallium swrast (softpipe) does not have those
+# PLIST files.
+PLIST.swrast=		yes
 PLIST.swrast_dri=	yes
 DRI_DRIVERS+=		swrast
-.if ${OPSYS} != "Darwin"
-PLIST.swrast=		yes
-GALLIUM_DRIVERS+=	swrast
-.endif
 
 # x86 only drivers
 .if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} != "Darwin"
@@ -149,7 +166,6 @@
 CONFIGURE_ARGS+=	--with-egl-platforms=x11,drm
 .endif
 
-CONFIGURE_ARGS+=	--with-gallium-drivers=${GALLIUM_DRIVERS:ts,}
 CONFIGURE_ARGS+=	--with-dri-drivers=${DRI_DRIVERS:ts,}
 
 .if !empty(PKG_OPTIONS:Mllvm)
@@ -187,7 +203,6 @@
 CONFIGURE_ARGS+=	--disable-r600-llvm-compiler
 .endif # llvm
 .else # !dri
-CONFIGURE_ARGS+=	--with-gallium-drivers=
 CONFIGURE_ARGS+=	--with-dri-drivers=
 CONFIGURE_ARGS+=	--disable-dri
 CONFIGURE_ARGS+=	--disable-dri3
@@ -198,5 +213,10 @@
 CONFIGURE_ARGS+=	--enable-xlib-glx
 .if !empty(PKG_OPTIONS:Mllvm)
 PKG_FAIL_REASON+=	"The llvm PKG_OPTION must also be disabled when dri is disabled"
+.else
+# There is non-DRI llvm use that should be explicitly disabled.
+CONFIGURE_ARGS+=	--disable-gallium-llvm
 .endif
 .endif
+
+CONFIGURE_ARGS+=	--with-gallium-drivers=${GALLIUM_DRIVERS:ts,}

Attachment: smime.p7s
Description: S/MIME cryptographic signature



Home | Main Index | Thread Index | Old Index