libgles-omap3: provide virtual/egl
[vuplus_openembedded] / packages / powervr-drivers / libgles-omap3.inc
1 DESCRIPTION = "libGLES for the omap3"
2 LICENCE = "proprietary-binary"
3
4 PROVIDES += "virtual/egl"
5
6 # Put "OMAP35x_Graphics_SDK_setuplinux_3_00_00_05.bin" in the same directory as this recipe
7 SRC_URI = "file://OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin \
8            file://rc.pvr \
9           "
10 S = "${WORKDIR}/OMAP35x_Graphics_SDK_${SGXPV}"
11
12 BINLOCATION ?= "${S}/gfx_rel"
13
14 PACKAGES += " xserver-kdrive-powervrsgx ${PN}-tests"
15
16 FILES_${PN} = "${sysconfdir} ${libdir}/lib*.so.* ${bindir}/pvrsrvinit"
17 FILES_xserver-kdrive-powervrsgx = "${bindir}/Xsgx"
18 FILES_${PN}-tests = "${bindir}/*"
19
20 RRECOMMENDS_${PN} = "${PN}-tests \
21                      omap3-sgx-modules"
22
23 inherit update-rc.d
24
25 INITSCRIPT_NAME = "pvr-init"
26 INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."
27
28 do_accept_license() {
29         export HOME="${WORKDIR}"
30         echo "Y
31 Y
32 ${S}" | ${WORKDIR}/OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin
33 }
34
35 addtask accept_license after do_unpack before do_configure
36
37 do_compile() {
38     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
39         if [ "$(readlink -n ${sofile})" = "" ] ; then
40             mv $sofile ${sofile}.${IMGPV}
41             ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}
42         fi
43     done
44 }
45
46 do_install () {
47
48         install -d ${D}${libdir}
49         cp -pP ${BINLOCATION}/*.so* ${D}${libdir}
50
51         install -d ${D}${bindir}/
52         cp -pP ${BINLOCATION}/*_test ${D}${bindir}/
53         cp -pP ${BINLOCATION}/gl2info ${D}${bindir}/
54         cp -pP ${BINLOCATION}/gles1test1 ${D}${bindir}/
55         cp -pP ${BINLOCATION}/gles1_texture_stream ${D}${bindir}/
56         cp -pP ${BINLOCATION}/gles2test1 ${D}${bindir}/
57         cp -pP ${BINLOCATION}/pvrsrvinit ${D}${bindir}/
58         cp -pP ${BINLOCATION}/xgles1test1 ${D}${bindir}/
59
60         cp -pP ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx || true
61         cp -pP ${BINLOCATION}/freedesktop/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/ || true
62
63         install -d ${D}${includedir}
64         cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/* ${D}${includedir}/
65         cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${D}${includedir}/
66         cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES/
67         cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES2/
68         
69         install -d ${D}${sysconfdir}/init.d/
70         cp -pP ${WORKDIR}/rc.pvr ${D}${sysconfdir}/init.d/pvr-init
71
72         install -d ${D}${sysconfdir}
73         echo "[default]" > ${D}${sysconfdir}/powervr.ini
74         echo "WindowSystem=libpvrPVR2D_FRONTWSEGL.so" >> ${D}${sysconfdir}/powervr.ini
75 }
76
77 do_stage () {
78         install -d ${STAGING_LIBDIR}/
79         cp -pP ${BINLOCATION}/*.so* ${STAGING_LIBDIR}
80         cp -pP ${BINLOCATION}/*.a ${STAGING_LIBDIR}
81
82         install -d ${STAGING_INCDIR}
83         cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/*  ${STAGING_INCDIR}/
84     cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${STAGING_INCDIR}/
85     cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES/
86     cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${STAGING_INCDIR}/GLES2/
87 }
88
89 pkg_postinst() {
90 #!/bin/sh
91 ln -sf /usr/lib/libXdmcp.so.6.0.0 /usr/lib/libXdmcp.so.0 
92 ln -sf /usr/lib/libXau.so.6.0.0 /usr/lib/libXau.so.0
93 }