summaryrefslogtreecommitdiff
path: root/extra/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'extra/mesa')
-rw-r--r--extra/mesa/PKGBUILD30
-rw-r--r--extra/mesa/mesa-7.5-mips-wmb.patch11
-rw-r--r--extra/mesa/mesa-loongson.patch11
3 files changed, 48 insertions, 4 deletions
diff --git a/extra/mesa/PKGBUILD b/extra/mesa/PKGBUILD
index dbc313875..0e5fa22f6 100644
--- a/extra/mesa/PKGBUILD
+++ b/extra/mesa/PKGBUILD
@@ -4,6 +4,7 @@
pkgbase=mesa
pkgname=('mesa' 'libgl' 'libglapi' 'libgles' 'libegl' 'ati-dri' 'intel-dri' 'unichrome-dri' 'mach64-dri' 'mga-dri' 'r128-dri' 'savage-dri' 'sis-dri' 'tdfx-dri' 'nouveau-dri') # 'llvm-dri')
+[[ "$CARCH" = "mips64el" ]] && pkgname=('mesa' 'libgl' 'libgles' 'libegl')
#_git=true
_git=false
@@ -15,9 +16,10 @@ if [ "${_git}" = "true" ]; then
pkgver=7.11
fi
pkgrel=1
-arch=('i686' 'x86_64')
+arch=('i686' 'x86_64' 'mips64el')
makedepends=('glproto>=1.4.14' 'libdrm>=2.4.26' 'libxxf86vm>=1.1.1' 'libxdamage>=1.1.3' 'expat>=2.0.1' 'libx11>=1.4.3' 'libxt>=1.1.1'
- 'gcc-libs>=4.6.1' 'dri2proto>=2.6' 'python2' 'libxml2' 'imake' 'llvm' 'udev')
+ 'gcc-libs>=4.6.1' 'python2' 'libxml2' 'imake' 'udev')
+[[ "$CARCH" = "mips64el" ]] || makedepends+=('dri2proto=2.6' 'llvm')
url="http://mesa3d.sourceforge.net"
license=('custom')
source=(LICENSE)
@@ -29,12 +31,26 @@ if [ "${_git}" = "true" ]; then
source=(${source[@]} "ftp://ftp.freedesktop.org/pub/mesa/${pkgver}/MesaLib-${pkgver}.tar.bz2"
)
fi
-md5sums=('5c65a0fe315dd347e09b1f2826a1df5a'
- 'ff03aca82d0560009a076a87c888cf13')
build() {
cd ${srcdir}/?esa-*
+ # WMB for MIPS patch from Fedora and Gentoo
+ patch -Np1 -i $srcdir/mesa-7.5-mips-wmb.patch
+ patch -Np1 -i $srcdir/mesa-loongson.patch
+
+if [ "$CARCH" = "mips64el" ]; then
+ ./configure --prefix=/usr \
+ --enable-glx-tls \
+ --with-driver=xlib \
+ --enable-xcb \
+ --with-state-trackers=glx \
+ --disable-glut \
+ --enable-gles1 \
+ --enable-gles2 \
+ --enable-egl \
+ --disable-gallium-egl
+else
if [ "${_git}" = "true" ]; then
autoreconf -vfi
./autogen.sh --prefix=/usr \
@@ -71,6 +87,7 @@ if [ "${_git}" = "true" ]; then
--enable-texture-float \
--enable-shared-dricore
fi
+fi
make
}
@@ -78,6 +95,7 @@ fi
package_libgl() {
depends=('libdrm>=2.4.26' 'libxxf86vm>=1.1.1' 'libxdamage>=1.1.3' 'expat>=2.0.1' 'libglapi' 'gcc-libs')
pkgdesc="Mesa 3-D graphics library and DRI software rasterizer"
+ [[ "$CARCH" = "mips64el" ]] && pkgdesc="Mesa 3-D graphics library (Xlib)"
cd ${srcdir}/?esa-*
install -m755 -d "${pkgdir}/usr/lib"
@@ -87,6 +105,8 @@ package_libgl() {
bin/minstall lib/libdricore.so* "${pkgdir}/usr/lib/"
bin/minstall lib/libglsl.so* "${pkgdir}/usr/lib/"
+ if [ "$CARCH" != "mips64el" ]; then
+
cd src/mesa/drivers/dri
#make -C swrast DESTDIR="${pkgdir}" install
if [ "${_git}" = "true" ]; then
@@ -97,6 +117,8 @@ fi
ln -s swrastg_dri.so "${pkgdir}/usr/lib/xorg/modules/dri/swrast_dri.so"
ln -s libglx.xorg "${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so"
+ fi
+
install -m755 -d "${pkgdir}/usr/share/licenses/libgl"
install -m644 "${srcdir}/LICENSE" "${pkgdir}/usr/share/licenses/libgl/"
}
diff --git a/extra/mesa/mesa-7.5-mips-wmb.patch b/extra/mesa/mesa-7.5-mips-wmb.patch
new file mode 100644
index 000000000..06c3d1835
--- /dev/null
+++ b/extra/mesa/mesa-7.5-mips-wmb.patch
@@ -0,0 +1,11 @@
+--- mesa-20090921/src/mesa/drivers/dri/sis/sis_context.h.orig 2010-03-31 23:31:37.252554011 +0800
++++ mesa-20090921/src/mesa/drivers/dri/sis/sis_context.h 2010-03-31 23:32:06.616553941 +0800
+@@ -404,6 +404,8 @@
+ #define MMIO_WMB() __asm __volatile("" : : : "memory")
+ #elif defined(__ia64__)
+ #define MMIO_WMB() __asm __volatile("mf" : : : "memory")
++#elif defined(__mips__)
++#define MMIO_WMB() __asm __volatile("" : : : "memory")
+ #else
+ #error platform needs WMB
+ #endif
diff --git a/extra/mesa/mesa-loongson.patch b/extra/mesa/mesa-loongson.patch
new file mode 100644
index 000000000..fa82abe49
--- /dev/null
+++ b/extra/mesa/mesa-loongson.patch
@@ -0,0 +1,11 @@
+--- Mesa-6.5.2/include/GL/internal/sarea.h.orig 2007-03-01 05:27:22.000000000 +0800
++++ Mesa-6.5.2/include/GL/internal/sarea.h 2007-03-01 05:27:49.000000000 +0800
+@@ -44,6 +44,8 @@
+ /* SAREA area needs to be at least a page */
+ #if defined(__alpha__)
+ #define SAREA_MAX 0x2000
++#elif defined(__mips__)
++#define SAREA_MAX 0x4000
+ #elif defined(__ia64__)
+ #define SAREA_MAX 0x10000 /* 64kB */
+ #else