diff options
author | Koen Kooi <koen@openembedded.org> | 2010-02-23 16:04:51 +0100 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2010-02-24 12:06:59 +0100 |
commit | 32799b8fb20c213dd932780bf21148d050d772f4 (patch) | |
tree | 905c698018af48ae6aa94094a67badfa5aa674bc /recipes/powervr-drivers/libgles-omap3.inc | |
parent | 23681e960148d0edff965eaef30044678eed111e (diff) |
libgles-omap3: complete overhaul
* convert to new-style staging
* (re)build demos with proper toolchain and flags
* build trainingcourses
* generate .desktop files on the fly
* delete old versions
Diffstat (limited to 'recipes/powervr-drivers/libgles-omap3.inc')
-rw-r--r-- | recipes/powervr-drivers/libgles-omap3.inc | 243 |
1 files changed, 158 insertions, 85 deletions
diff --git a/recipes/powervr-drivers/libgles-omap3.inc b/recipes/powervr-drivers/libgles-omap3.inc index 27f732ba27..dd222df411 100644 --- a/recipes/powervr-drivers/libgles-omap3.inc +++ b/recipes/powervr-drivers/libgles-omap3.inc @@ -2,13 +2,8 @@ DESCRIPTION = "libGLES for the omap3" LICENCE = "proprietary-binary" COMPATIBLE_MACHINE = "(am3517-evm|beagleboard|cm-t35|igep0020|omap3-pandora|omap3-touchbook|omap3evm|omapzoom|omapzoom2|overo|palmpre)" -RDEPENDS_${PN} += "devmem2 fbset" -#HACK! These are binaries, so we can't guarantee that LDFLAGS match :( -INSANE_SKIP_${PN} = True -INSANE_SKIP_${PN}-tests = True -INSANE_SKIP_${PN}-demos = True -INSANE_SKIP_xserver-kdrive-powervrsgx = True +DEPENDS = "virtual/libx11 libxau libxdmcpdev" PROVIDES += "virtual/egl" @@ -22,87 +17,119 @@ PROVIDES += "virtual/egl" # (replace version in .bin file as appropriate) # 3. put the OMAP35x_*.bin file in libgles-omap3/ # mv OMAP35x_Graphics_SDK_setuplinux_3_00_00_06.bin ./libgles-omap3/ -# 4. make it executable: -# chmod a+x ./libgles-omap3/OMAP35x_Graphics_SDK_setuplinux_3_00_00_06.bin # # voila! SRC_URI = "file://OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin \ - file://cputype \ - file://rc.pvr \ - file://chameleonman.desktop \ - file://evilskull.desktop \ - file://fivespheres.desktop \ - file://lighting.desktop \ - file://mouse.desktop \ - file://optimizemesh.desktop \ - file://particles.desktop \ - file://polybump.desktop \ - file://shadowtechniques.desktop \ - file://skybox.desktop \ - file://trilinear.desktop \ - file://userclipplanes.desktop \ - file://vase.desktop \ - file://shaders.desktop \ - file://skybox2.desktop \ - " + file://cputype \ + file://rc.pvr \ + file://sample.desktop \ + " S = "${WORKDIR}/OMAP35x_Graphics_SDK_${SGXPV}" +# Logic to unpack installjammer file TI_BIN_UNPK_CMDS="Y: qY:workdir:Y" require ../ti/ti-eula-unpack.inc BINLOCATION ?= "${S}/gfx_rel" -PACKAGES += " xserver-kdrive-powervrsgx ${PN}-tests ${PN}-demos" - -FILES_${PN} = "${sysconfdir} ${libdir}/lib*.so.* ${libdir}/ES*/* ${bindir}/pvrsrvinit ${bindir}/cputype ${bindir}/*/*" -FILES_xserver-kdrive-powervrsgx = "${bindir}/Xsgx" -FILES_${PN}-tests = "${bindir}" -FILES_${PN}-demos = "${prefix}/demos ${prefix}/share/applications " -FILES_${PN}-dbg = "${libdir}/.debug/* ${bindir}/.debug/* ${libdir}/ES*/.debug ${bindir}/*/.debug\ - ${prefix}/demos/OGLES/*/.debug/* \ - ${prefix}/demos/OGLES2/*/.debug/* \ - " - -RRECOMMENDS_${PN} = "${PN}-tests \ - omap3-sgx-modules" - -inherit update-rc.d - -INITSCRIPT_NAME = "pvr-init" -INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ." +do_configure() { + # Attempt to fix up the worst offenders for file permissions + for i in $(find ${S} -name "*.h") $(find ${S} -name "*.c") $(find ${S} -name "Make*") ; do + chmod 0644 $i + done + + # Attempt to create proper library softlinks + for sofile in $(find ${S} -name "lib*Open*.so") $(find ${S} -name "lib*srv*.so") $(find ${S} -name "lib*gl*.so") $(find ${S} -name "libpvr*.so") $(find ${S} -name "lib*GL*.so"); do + if [ "$(readlink -n ${sofile})" = "" ] ; then + mv $sofile ${sofile}.${IMGPV} + ln -sf $(basename ${sofile}.${IMGPV}) ${sofile} + ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1}') + ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1 "." $2}') + fi + done + + # Due to recursive make PLAT_* isn't always passed down correctly, so use sed to fix those + for mak in $(find ${S} -name "*.mak") ; do + sed -i -e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g $mak + done + + # clear out old stuff + find Binaries/ | xargs rm -f || true +} +# Force in GNU_HASH and paths to libs +TARGET_CC_ARCH += " ${TARGET_LINK_HASH_STYLE} -Wl,-rpath-link,${BINLOCATION} -L${BINLOCATION}" +PARALLEL_MAKE = "" do_compile() { - for i in $(find ${S} -name "*.h") $(find ${S} -name "*.c") $(find ${S} -name "Make*") ; do - chmod 0644 $i - done - - for sofile in $(find ${S} -name "lib*Open*.so") $(find ${S} -name "lib*srv*.so") $(find ${S} -name "lib*gl*.so") $(find ${S} -name "libpvr*.so") $(find ${S} -name "lib*GL*.so"); do - if [ "$(readlink -n ${sofile})" = "" ] ; then - mv $sofile ${sofile}.${IMGPV} - ln -sf $(basename ${sofile}.${IMGPV}) ${sofile} - fi - done + export X11ROOT="${STAGING_INCDIR}" + export PLATFORM="LinuxOMAP3" + + export PLAT_CC="${CC}" + export PLAT_CPP="${CXX}" + export PLAR_AR="${AR}" + + mkdir -p ${S}/demos/raw + mkdir -p ${S}/demos/x11 + + # Rebuild demos for both Raw and X11 + for X11BUILD in 0 1 ; do + for demo in ${S}/GFX_Linux_SDK/OGLES*/SDKPackage/Demos/* ; do + cd $demo/OGLES*/Build/LinuxGeneric + oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD + rm $demo/OGLES*/Build/LinuxOMAP3/Release*/*.o + install -m 0755 $demo/OGLES*/Build/LinuxOMAP3/ReleaseX11/* ${S}/demos/x11 || true + sed -e s:NAME:$(basename $demo/OGLES*/Build/LinuxOMAP3/ReleaseX11/*): \ + -e s:EXEC:${bindir}/SGX/demos/X11/$(basename $demo/OGLES*/Build/LinuxOMAP3/ReleaseX11/*): \ + ${WORKDIR}/sample.desktop > ${WORKDIR}/$(basename $demo/OGLES*/Build/LinuxOMAP3/ReleaseX11/*).desktop + install -m 0755 $demo/OGLES*/Build/LinuxOMAP3/ReleaseRaw/* ${S}/demos/raw || true + done + done + + mkdir -p ${S}/trainingcourses/raw + mkdir -p ${S}/trainingcourses/x11 + + # Build OGLES2 Trainingcourses for both Raw and X11 + for X11BUILD in 0 1 ; do + for training in ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/TrainingCourse/* ; do + if [ -e $training/OGLES*/Build/LinuxGeneric/Makefile ] ; then + cd $training/OGLES*/Build/LinuxGeneric + fi + + if [ -e $training/OGLES*/Build/LinuxOMAP3/Makefile ] ; then + cd $training/OGLES*/Build/LinuxOMAP3 + fi + + oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD + rm $training/OGLES*/Build/LinuxOMAP3/Release*/*.o + install -m 0755 $training/OGLES*/Build/LinuxOMAP3/ReleaseX11/* ${S}/trainingcourses/x11 || true + install -m 0755 $training/OGLES*/Build/LinuxOMAP3/ReleaseRaw/* ${S}/trainingcourses/raw || true + done + done + } do_install () { - install -d ${D}${libdir} - cp -pP ${BINLOCATION}/*.so* ${D}${libdir} + install -m 0755 ${BINLOCATION}/*.so* ${D}${libdir} + install -m 0644 ${BINLOCATION}/*.a ${D}${libdir} install -d ${D}${bindir}/ install -m 0755 ${WORKDIR}/cputype ${D}${bindir}/ - cp -pP ${BINLOCATION}/*_test ${D}${bindir}/ - cp -pP ${BINLOCATION}/gl* ${D}${bindir}/ - cp -pP ${BINLOCATION}/p[dv]* ${D}${bindir}/ - cp -pP ${BINLOCATION}/xgles1test1 ${D}${bindir}/ + install -m 0755 ${BINLOCATION}/*_test ${D}${bindir}/ + install -m 0755 ${BINLOCATION}/gl* ${D}${bindir}/ + install -m 0755 ${BINLOCATION}/p[dv]* ${D}${bindir}/ + install -m 0755 ${BINLOCATION}/xgles1test1 ${D}${bindir}/ - cp -pP ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/|| true + install -m 0755 ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/|| true install -d ${D}${includedir} + cp -pPR ${S}/GFX_Linux_KM/include4 ${D}${includedir}/ + cp -pPR ${S}/GFX_Linux_KM/services4 ${D}${includedir}/ + cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/* ${D}${includedir}/ cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${D}${includedir}/ cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES/ || true @@ -118,36 +145,82 @@ do_install () { echo "[default]" > ${D}${sysconfdir}/powervr.ini echo "WindowSystem=libpvrPVR2D_FRONTWSEGL.so" >> ${D}${sysconfdir}/powervr.ini - install -d ${D}${prefix}/demos/OGLES/ - cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Binaries/CommonX11/Demos/* ${D}${prefix}/demos/OGLES/ + # The ES2.x and ES3.x CPUs have different SGX hardware, so we need to install 2 sets of userspace + + install -d ${D}${libdir}/ES3.0 + install -d ${D}${libdir}/ES2.0 + install -d ${D}${bindir}/ES3.0 + install -d ${D}${bindir}/ES2.0 + + cp ${S}/gfx_rel_es2.x/lib* ${D}${libdir}/ES2.0/ + cp ${S}/gfx_rel_es2.x//p[dv]* ${D}${bindir}/ES2.0/ - install -d ${D}${prefix}/demos/OGLES2 - cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Binaries/X11/Demos/* ${D}${prefix}/demos/OGLES2 + cp ${D}${libdir}/lib*${IMGPV} ${D}${libdir}/ES3.0/ + cp ${D}${bindir}/p[dv]* ${D}${bindir}/ES3.0 install -d ${D}${prefix}/share/applications - cp -pPR ${WORKDIR}/*.desktop ${D}${prefix}/share/applications + cp ${WORKDIR}/*.desktop ${D}${prefix}/share/applications + rm ${D}${prefix}/share/applications/sample.desktop + + install -d ${D}${bindir}/SGX/demos/X11/ + install -d ${D}${bindir}/SGX/demos/Raw/ + install -m 0755 ${S}/demos/x11/* ${D}${bindir}/SGX/demos/X11/ + install -m 0755 ${S}/demos/raw/* ${D}${bindir}/SGX/demos/Raw/ + + install -d ${D}${bindir}/SGX/trainingcourses/Raw + install -d ${D}${bindir}/SGX/trainingcourses/X11 + install -m 0755 ${S}/trainingcourses/x11/* ${D}${bindir}/SGX/trainingcourses/X11/ + install -m 0755 ${S}/trainingcourses/raw/* ${D}${bindir}/SGX/trainingcourses/Raw/ + + # Delete objects and linker scripts hidden between the headers + find ${D} -name "*.o" -delete + find ${D} -name "*.o.cmd" -delete } -do_stage () { - install -d ${STAGING_LIBDIR}/ - cp -pP ${BINLOCATION}/*.so* ${STAGING_LIBDIR} - cp -pP ${BINLOCATION}/*.a ${STAGING_LIBDIR} - - install -d ${STAGING_INCDIR} - cp -pPR ${S}/GFX_Linux_KM/include4 ${STAGING_INCDIR}/ - cp -pPR ${S}/GFX_Linux_KM/services4 ${STAGING_INCDIR}/ - - cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/* ${STAGING_INCDIR}/ - cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${STAGING_INCDIR}/ - cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES/ || true - cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES2/ || true - cp -pPr ${S}/include/*.h ${STAGING_INCDIR} || true - cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/v* ${STAGING_INCDIR}/ || true - cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/V* ${STAGING_INCDIR}/ || true -} +PACKAGES =+ "xserver-kdrive-powervrsgx \ + ${PN}-rawdemos \ + ${PN}-x11demos \ + ${PN}-rawtrainingcourses \ + ${PN}-x11trainingcourses \ + ${PN}-tests " + +FILES_${PN} = "${sysconfdir} ${libdir}/lib*.so.* ${libdir}/ES*/* ${bindir}/pvrsrvinit ${bindir}/cputype ${bindir}/*/*" +FILES_xserver-kdrive-powervrsgx = "${bindir}/Xsgx" +FILES_${PN}-tests = "${bindir}" +FILES_${PN}-dbg = "${libdir}/.debug/* ${bindir}/.debug/* \ + ${libdir}/ES*/.debug ${bindir}/*/.debug\ + ${bindir}/SGX/demos/*/.debug/* \ + ${bindir}/SGX/trainingcourses/*/.debug/* \ + " + +FILES_${PN}-rawdemos = "${bindir}/SGX/demos/Raw/*" +FILES_${PN}-x11demos = "${bindir}/SGX/demos/X11/* ${prefix}/share/applications " + +FILES_${PN}-rawtrainingcourses = "${bindir}/SGX/trainingcourses/Raw/*" +FILES_${PN}-x11trainingcourses = "${bindir}/SGX/trainingcourses/X11/*" + +# The libs need the kernel-modules +RRECOMMENDS_${PN} = "omap3-sgx-modules" + +# The initscript calls fbset +RDEPENDS_${PN} += "fbset" + +#HACK! These are binaries, so we can't guarantee that LDFLAGS match :( +INSANE_SKIP_${PN} = True +INSANE_SKIP_${PN}-tests = True +INSANE_SKIP_xserver-kdrive-powervrsgx = True + +# Quality control is really poor on these SDKs, so hack around the latest madness: +FILES_${PN} += "${libdir}/*.so " +FILES_${PN}-dev = "${includedir}" + +inherit update-rc.d + +INITSCRIPT_NAME = "pvr-init" +INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ." -pkg_postinst() { -#!/bin/sh +# Append to update-rc.d postinst +pkg_postinst_${PN}_append() { ln -sf /usr/lib/libXdmcp.so.6.0.0 /usr/lib/libXdmcp.so.0 ln -sf /usr/lib/libXau.so.6.0.0 /usr/lib/libXau.so.0 } |