pkgsrc-WIP-changes archive

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

sunxi-mali-fb: Import. Makes games in RetroArch run smoothly on my Banana Pi.



Module Name:	pkgsrc-wip
Committed By:	Nia Alarie <nia.alarie%gmail.com@localhost>
Pushed By:	nee
Date:		Tue Jun 6 00:06:58 2017 +0100
Changeset:	abe15c5031e8f44ec2c059f9b382e1d5d957fe5c

Modified Files:
	libretro-parallel-n64/options.mk
	retroarch/Makefile
	retroarch/options.mk
Added Files:
	sunxi-mali-fb/DESCR
	sunxi-mali-fb/Makefile
	sunxi-mali-fb/Makefile.common
	sunxi-mali-fb/PLIST
	sunxi-mali-fb/buildlink3.mk
	sunxi-mali-fb/distinfo

Log Message:
sunxi-mali-fb: Import. Makes games in RetroArch run smoothly on my Banana Pi.

Userspace libraries implementing OpenGL ES for the Mali400 GPUs found in
various Allwinner Technology SoCs (referred to as "sunxi" devices in the
Linux kernel's source code).

The libraries are binary-only and Linux-only.

This package contains the version for using with programs that run in the
framebuffer. The framebuffer has somewhat lower overhead than X11, so
programs run faster.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=abe15c5031e8f44ec2c059f9b382e1d5d957fe5c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 libretro-parallel-n64/options.mk | 26 ++++++++++++++++--
 retroarch/Makefile               |  6 -----
 retroarch/options.mk             | 28 ++++++++++++++++++++
 sunxi-mali-fb/DESCR              |  9 +++++++
 sunxi-mali-fb/Makefile           |  8 ++++++
 sunxi-mali-fb/Makefile.common    | 57 ++++++++++++++++++++++++++++++++++++++++
 sunxi-mali-fb/PLIST              | 21 +++++++++++++++
 sunxi-mali-fb/buildlink3.mk      | 14 ++++++++++
 sunxi-mali-fb/distinfo           | 22 ++++++++++++++++
 9 files changed, 183 insertions(+), 8 deletions(-)

diffs:
diff --git a/libretro-parallel-n64/options.mk b/libretro-parallel-n64/options.mk
index b5518d0984..2fa714f6f4 100644
--- a/libretro-parallel-n64/options.mk
+++ b/libretro-parallel-n64/options.mk
@@ -9,7 +9,7 @@ PKG_OPTIONS_GROUP.graphics=	opengl
 .if !empty(MACHINE_ARCH:M*arm*)
 PKG_OPTIONS_GROUP.graphics+=	rpi
 PKG_SUPPORTED_OPTIONS+=	dynarec
-PKG_SUGGESTED_OPTIONS+=	rpi dynarec
+PKG_SUGGESTED_OPTIONS+=	dynarec
 N64_DYNAREC_ARCH=	arm
 .elif !empty(MACHINE_ARCH:Mi386)
 PKG_SUPPORTED_OPTIONS+=	dynarec
@@ -23,8 +23,29 @@ N64_DYNAREC_ARCH=	x86_64
 PKG_SUGGESTED_OPTIONS+=	opengl
 .endif
 
+.if !empty(MACHINE_PLATFORM:MLinux-*-arm*)
+PKG_OPTIONS_GROUP.graphics+=	sunxi-mali-fb
+.endif
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-arm*)
+PKG_SUGGESTED_OPTIONS+=	rpi
+.endif
+
 .include "../../mk/bsd.options.mk"
 
+#
+# Enable use of the Linux binary Mali GPU driver (framebuffer version)
+#
+.if !empty(PKG_OPTIONS:Msunxi-mali-fb)
+.include "../../wip/sunxi-mali-fb/buildlink3.mk"
+BUILD_MAKE_FLAGS+=	FORCE_GLES=1
+BUILD_MAKE_FLAGS+=	HAVE_NEON=1
+.endif
+
+.if !empty(PKG_OPTIONS:Msunxi-mali-fb) || ${N64_DYNAREC_ARCH} == "arm"
+CFLAGS+=		-marm
+.endif
+
 .if !empty(PKG_OPTIONS:Mopengl)
 .include "../../graphics/MesaLib/buildlink3.mk"
 .endif
@@ -35,5 +56,6 @@ MAKE_ENV+=	platform=rpi
 .endif
 
 .if !empty(PKG_OPTIONS:Mdynarec)
-MAKE_ENV+=	WITH_DYNAREC=${N64_DYNAREC_ARCH}
+BUILD_MAKE_FLAGS+=	WITH_DYNAREC=${N64_DYNAREC_ARCH}
 .endif
+
diff --git a/retroarch/Makefile b/retroarch/Makefile
index cc93ada7d8..844051d61c 100644
--- a/retroarch/Makefile
+++ b/retroarch/Makefile
@@ -33,12 +33,6 @@ DEPENDS+=	retroarch-assets>0:../../wip/retroarch-assets
 EGDIR=		${PREFIX}/share/examples/retroarch
 CONF_FILES+=	${EGDIR}/retroarch.cfg ${PKG_SYSCONFDIR}/retroarch.cfg
 
-SUBST_CLASSES+=		vc
-SUBST_STAGE.vc=		pre-configure
-SUBST_MESSAGE.vc=	Fixing path to VideoCore libraries.
-SUBST_FILES.vc=		qb/config.libs.sh
-SUBST_SED.vc+=		-e 's;/opt/vc;${PREFIX};g'
-
 SUBST_CLASSES+=		cfg
 SUBST_STAGE.cfg=	pre-configure
 SUBST_MESSAGE.cfg=	Setting paths in sample config.
diff --git a/retroarch/options.mk b/retroarch/options.mk
index f4fa6855c4..7939d1c169 100644
--- a/retroarch/options.mk
+++ b/retroarch/options.mk
@@ -8,6 +8,13 @@ PKG_SUGGESTED_OPTIONS+=	sdl2 ffmpeg freetype
 
 .if !empty(MACHINE_ARCH:M*arm*)
 PKG_SUPPORTED_OPTIONS+=	rpi
+.endif
+
+.if !empty(MACHINE_PLATFORM:MLinux-*-arm*)
+PKG_SUPPORTED_OPTIONS+=	sunxi-mali-fb
+.endif
+
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-arm*)
 PKG_SUGGESTED_OPTIONS+=	rpi
 .endif
 
@@ -17,9 +24,30 @@ PKG_SUGGESTED_OPTIONS.Linux+=	alsa
 
 .if !empty(PKG_OPTIONS:Mrpi)
 .include "../../misc/raspberrypi-userland/buildlink3.mk"
+SUBST_CLASSES+=		vc
+SUBST_STAGE.vc=		pre-configure
+SUBST_MESSAGE.vc=	Fixing path to VideoCore libraries.
+SUBST_FILES.vc=		qb/config.libs.sh
+SUBST_SED.vc+=		-e 's;/opt/vc;${PREFIX};g'
+CONFIGURE_ARGS+=	--enable-opengles
+CONFIGURE_ARGS+=	--disable-opengl
+.endif
+
+#
+# Enable use of the Linux binary Mali GPU driver (framebuffer version)
+#
+.if !empty(PKG_OPTIONS:Msunxi-mali-fb)
+.include "../../wip/sunxi-mali-fb/buildlink3.mk"
+CONFIGURE_ARGS+=	--enable-floathard
+CONFIGURE_ARGS+=	--enable-neon
+CONFIGURE_ARGS+=	--enable-opengles
+CONFIGURE_ARGS+=	--enable-mali_fbdev
+CONFIGURE_ARGS+=	--disable-opengl
 .endif
 
+#
 # Legacy shader support
+#
 .if !empty(PKG_OPTIONS:Mlibxml2)
 CONFIGURE_ARGS+=	--enable-libxml2
 .include "../../textproc/libxml2/buildlink3.mk"
diff --git a/sunxi-mali-fb/DESCR b/sunxi-mali-fb/DESCR
new file mode 100644
index 0000000000..3de20e663b
--- /dev/null
+++ b/sunxi-mali-fb/DESCR
@@ -0,0 +1,9 @@
+Userspace libraries implementing OpenGL ES for the Mali400 GPUs found in
+various Allwinner Technology SoCs (referred to as "sunxi" devices in the
+Linux kernel's source code).
+
+The libraries are binary-only and Linux-only.
+
+This package contains the version for using with programs that run in the
+framebuffer. The framebuffer has somewhat lower overhead than X11, so
+programs run faster.
diff --git a/sunxi-mali-fb/Makefile b/sunxi-mali-fb/Makefile
new file mode 100644
index 0000000000..59f0157fe9
--- /dev/null
+++ b/sunxi-mali-fb/Makefile
@@ -0,0 +1,8 @@
+# $NetBSD$
+
+EGL_TYPE=	framebuffer
+EGL_TYPE_SMALL=	fb
+
+.include "Makefile.common"
+
+COMMENT=	Linux OpenGLESv2/EGL binaries for Allwinner framebuffers
diff --git a/sunxi-mali-fb/Makefile.common b/sunxi-mali-fb/Makefile.common
new file mode 100644
index 0000000000..596ec6f266
--- /dev/null
+++ b/sunxi-mali-fb/Makefile.common
@@ -0,0 +1,57 @@
+# $NetBSD$
+
+PKGNAME=	sunxi-mali-${EGL_TYPE_SMALL}-20140326
+CATEGORIES=	graphics
+
+MAINTAINER=	nia.alarie%gmail.com@localhost
+HOMEPAGE=	https://github.com/linux-sunxi/sunxi-mali
+
+ONLY_FOR_PLATFORM=	Linux-*-*arm*
+
+MAIN_TAG=	d343311efc8db166d8371b28494f0f27b6a58724
+BINARY_TAG=	1c5063f43cdc9de341c0d63b2e3921cab86c7742
+
+DISTFILES+=	${MAIN_TAG}.tar.gz
+SITES.${MAIN_TAG}.tar.gz= \
+	${MASTER_SITE_GITHUB:=linux-sunxi/sunxi-mali/archive/}
+
+DISTFILES+=	${BINARY_TAG}.tar.gz
+SITES.${BINARY_TAG}.tar.gz= \
+	${MASTER_SITE_GITHUB:=linux-sunxi/sunxi-mali-proprietary/archive/}
+
+# The headers in the main repos are out of date...
+# See: https://github.com/libretro/RetroArch/issues/415
+# Using newer ones from Khronos.
+
+KHRONOS_GLES2_SITE=	https://www.khronos.org/registry/OpenGL/api/GLES2/
+
+DISTFILES+=	gl2.h
+SITES.gl2.h=	${KHRONOS_GLES2_SITE}
+
+DISTFILES+=	gl2ext.h
+SITES.gl2ext.h=	${KHRONOS_GLES2_SITE}
+
+DISTFILES+=		gl2platform.h
+SITES.gl2platform.h=	${KHRONOS_GLES2_SITE}
+
+USE_LANGUAGES=	# none
+NO_BUILD=	yes
+
+USE_TOOLS+=	gmake
+
+BUILD_TARGET=	config
+MAKE_ENV+=	VERSION=r3p0
+MAKE_ENV+=	ABI=armhf
+MAKE_ENV+=	EGL_TYPE=${EGL_TYPE}
+MAKE_ENV+=	prefix=${PREFIX}/sunxi-mali-${EGL_TYPE_SMALL}/
+
+INSTALLATION_DIRS+=	${PREFIX}/sunxi-mali-${EGL_TYPE_SMALL}/lib
+INSTALLATION_DIRS+=	${PREFIX}/sunxi-mali-${EGL_TYPE_SMALL}/include
+
+WRKSRC=		${WRKDIR}/sunxi-mali-${MAIN_TAG}
+
+post-extract:
+	${MV} ${WRKDIR}/sunxi-mali-proprietary-${BINARY_TAG}/* ${WRKSRC}/lib/mali
+	${MV} ${WRKDIR}/*.h ${WRKSRC}/include/GLES2
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/sunxi-mali-fb/PLIST b/sunxi-mali-fb/PLIST
new file mode 100644
index 0000000000..196611ac09
--- /dev/null
+++ b/sunxi-mali-fb/PLIST
@@ -0,0 +1,21 @@
+@comment $NetBSD$
+sunxi-mali-fb/include/EGL/egl.h
+sunxi-mali-fb/include/EGL/eglext.h
+sunxi-mali-fb/include/EGL/eglplatform.h
+sunxi-mali-fb/include/GLES/gl.h
+sunxi-mali-fb/include/GLES/glext.h
+sunxi-mali-fb/include/GLES/glplatform.h
+sunxi-mali-fb/include/GLES2/gl2.h
+sunxi-mali-fb/include/GLES2/gl2ext.h
+sunxi-mali-fb/include/GLES2/gl2platform.h
+sunxi-mali-fb/include/KHR/khrplatform.h
+sunxi-mali-fb/lib/libEGL.so
+sunxi-mali-fb/lib/libEGL.so.1
+sunxi-mali-fb/lib/libEGL.so.1.4
+sunxi-mali-fb/lib/libGLESv1_CM.so
+sunxi-mali-fb/lib/libGLESv1_CM.so.1
+sunxi-mali-fb/lib/libGLESv1_CM.so.1.1
+sunxi-mali-fb/lib/libGLESv2.so
+sunxi-mali-fb/lib/libGLESv2.so.2
+sunxi-mali-fb/lib/libGLESv2.so.2.0
+sunxi-mali-fb/lib/libMali.so
diff --git a/sunxi-mali-fb/buildlink3.mk b/sunxi-mali-fb/buildlink3.mk
new file mode 100644
index 0000000000..a9a694c59d
--- /dev/null
+++ b/sunxi-mali-fb/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	sunxi-mali-fb
+
+.if !defined(SUNXI_MALI_FB_BUILDLINK3_MK)
+SUNXI_MALI_FB_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.sunxi-mali-fb+=	sunxi-mali-fb>=0
+BUILDLINK_PKGSRCDIR.sunxi-mali-fb?=	../../wip/sunxi-mali-fb
+BUILDLINK_INCDIRS.sunxi-mali-fb+=	sunxi-mali-fb/include
+BUILDLINK_LIBDIRS.sunxi-mali-fb+=	sunxi-mali-fb/lib
+.endif	# SUNXI_MALI_FB_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-sunxi-mali-fb
diff --git a/sunxi-mali-fb/distinfo b/sunxi-mali-fb/distinfo
new file mode 100644
index 0000000000..102e025b36
--- /dev/null
+++ b/sunxi-mali-fb/distinfo
@@ -0,0 +1,22 @@
+$NetBSD$
+
+SHA1 (1c5063f43cdc9de341c0d63b2e3921cab86c7742.tar.gz) = ea5ae82b0d9f0015dd76d4f1f7f3131aae4a7a02
+RMD160 (1c5063f43cdc9de341c0d63b2e3921cab86c7742.tar.gz) = 06ab217f4ddb0c20a90e4a526215c7d902bdfc73
+SHA512 (1c5063f43cdc9de341c0d63b2e3921cab86c7742.tar.gz) = 0c9d74a334d56f57c8cf82ef5063fee4a871e9a2795cb210b985a726a18a08da1a11aa52fbeb49e6d41c97dac526b63bce11eae8ac450b752497890c15fa0ef8
+Size (1c5063f43cdc9de341c0d63b2e3921cab86c7742.tar.gz) = 7264779 bytes
+SHA1 (d343311efc8db166d8371b28494f0f27b6a58724.tar.gz) = ec17eb3d67f3431844449a3664619512fe9225e6
+RMD160 (d343311efc8db166d8371b28494f0f27b6a58724.tar.gz) = 8c9dd985be8290b1d858940c8261588bc85fd4b3
+SHA512 (d343311efc8db166d8371b28494f0f27b6a58724.tar.gz) = d7c41098f8d91db944ba815d47427160747cc2ea3ecccc73ff852d1d062e39c8cb8e1301243ab5fc6f1914c97667b936a0801b84baefe3a3e54544f38e52e52e
+Size (d343311efc8db166d8371b28494f0f27b6a58724.tar.gz) = 33334 bytes
+SHA1 (gl2.h) = 82ed1a38b806652b7b7e0138181e747a14f3bb92
+RMD160 (gl2.h) = 9a2f8cb81546e5805ddda2c51d3633c95534b0cf
+SHA512 (gl2.h) = 0022084bf02e96a081e3abd61b5ee54642c38b0742189fabec751b4583c8eb3d27fefaec625deb667b1d4d53011ccf0e7a235b5be93029155bd8289699d040f3
+Size (gl2.h) = 43972 bytes
+SHA1 (gl2ext.h) = 3dbcad4374e2816ca09c9f8b66cfd55185673c75
+RMD160 (gl2ext.h) = 5eaaebcd3b15bd8ddeac21a669e542f9602de9b0
+SHA512 (gl2ext.h) = a59831450f9452477133b86c97bb32a0263e0288f237bf825b96f9860ac29a45fba0bbc47fc326406ca7495ac6a3ddfdc977c4d1a6937fa06fabbf472e34d8d6
+Size (gl2ext.h) = 196407 bytes
+SHA1 (gl2platform.h) = 0f35bfd24f82e0366e50b8cd077af2e19af932cd
+RMD160 (gl2platform.h) = 8f7516ff0dd4d69dd103b3cb06b11b6c7381f072
+SHA512 (gl2platform.h) = ac7f8b677cac2b67eaf00c32a6e0ef0af2c78a03f4ecc87589b709b5e5381636e81b07cb60c2b4670790b4ad2b4cd7ce6717cd8a4a1cc16f2d982ea3121ecac4
+Size (gl2platform.h) = 1160 bytes


Home | Main Index | Thread Index | Old Index