mesa-dri: fix 6.5.2 cross compilation error, add 7.0.3
authorPhil Blundell <philb@gnu.org>
Sun, 27 Jul 2008 10:43:51 +0000 (10:43 +0000)
committerPhil Blundell <philb@gnu.org>
Sun, 27 Jul 2008 10:43:51 +0000 (10:43 +0000)
packages/mesa/files/mklib-cross.patch [new file with mode: 0644]
packages/mesa/mesa-dri_6.5.2.bb
packages/mesa/mesa-dri_7.0.3.bb [new file with mode: 0644]

diff --git a/packages/mesa/files/mklib-cross.patch b/packages/mesa/files/mklib-cross.patch
new file mode 100644 (file)
index 0000000..fbe86e3
--- /dev/null
@@ -0,0 +1,14 @@
+--- s/bin/mklib~       2008-02-19 15:30:18.000000000 +0000
++++ s/bin/mklib        2008-07-27 11:15:25.000000000 +0100
+@@ -204,9 +204,9 @@
+       if [ "x$LINK" = "x" ] ; then
+           # -linker was not specified so set default link command now
+             if [ $CPLUSPLUS = 1 ] ; then
+-                LINK=g++
++                LINK=$CXX
+             else
+-                LINK=gcc
++                LINK=$CC
+             fi
+       fi
index fffbfee..29d169b 100644 (file)
@@ -1,5 +1,7 @@
 include mesa-common.inc
 
+SRC_URI += " file://mklib-cross.patch;patch=1"
+
 FILESPATH = "${FILE_DIRNAME}/mesa-${PV}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
 
 PACKAGES_DYNAMIC = "mesa-dri-driver-*"
diff --git a/packages/mesa/mesa-dri_7.0.3.bb b/packages/mesa/mesa-dri_7.0.3.bb
new file mode 100644 (file)
index 0000000..87b3dcf
--- /dev/null
@@ -0,0 +1,42 @@
+include mesa-common.inc
+
+# suppress mklib-rpath-link patch from mesa-common
+SRC_URI = "${SOURCEFORGE_MIRROR}/mesa3d/MesaLib-${PV}.tar.bz2 file://mklib-cross.patch;patch=1"
+
+FILESPATH = "${FILE_DIRNAME}/mesa-${PV}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
+
+PACKAGES_DYNAMIC = "mesa-dri-driver-*"
+
+PR = "r0"
+
+DEPENDS += "libdrm"
+# DRI is useless without the kernel drivers
+RRECOMMENDS += " kernel-module-drm kernel-module-radeon "
+
+do_configure() {
+       cd configs
+
+       ln -sf linux-dri current
+       sed -e "s%CC *= *.*%CC = ${CC}%" -i current
+       sed -e "s%CXX *= *.*%CXX = ${CXX}%" -i current
+       sed -e "s%LD *= *.*%LD = ${LD}%" -i current
+       sed -e "s%OPT_FLAGS *= *.*%OPT_FLAGS = ${TARGET_CFLAGS}%" -i current
+       sed -e "s%X11_INCLUDES *= *.*%X11_INCLUDES = -I${STAGING_INCDIR}/X11%" -i current
+       sed -e "s%EXTRA_LIB_PATH *= *.*%EXTRA_LIB_PATH = ${LDFLAGS}%" -i current
+       sed -i s:\$\(CC\):gcc:g  ../src/mesa/x86/Makefile
+       echo "SRC_DIRS = mesa" >> current
+       echo "DRI_DRIVER_INSTALL_DIR = ${D}${libdir}/dri" >> current
+}
+
+do_install() {
+       oe_runmake -C src/mesa/drivers/dri install
+}
+
+FILES_${PN}-dbg += "${libdir}/dri/.debug"
+
+python populate_packages_prepend () {
+        import re, os.path
+
+        do_split_packages(d, root=bb.data.expand('${libdir}/dri', d), file_regex='(.*)_dri\.so', output_pattern='mesa-dri-driver-%s', description='%s DRI driver')
+}
+