1 DESCRIPTION = "libGLES for the omap3"
2 LICENCE = "proprietary-binary"
4 COMPATIBLE_MACHINE = "(am3517-evm|beagleboard|cm-t35|igep0020|omap3-pandora|omap3-touchbook|omap3evm|omapzoom|omapzoom2|overo|palmpre)"
6 DEPENDS = "virtual/libx11 libxau libxdmcp"
8 PROVIDES += "virtual/egl"
10 # some hints to get you going. as this isnt a totally "open" library, you need
11 # to do some work. follow the steps below.
13 # 1. if you don't already have a ti account get one here. it's free:
14 # http://www.ti.com/hdr_my_ti
15 # 2. fetch the gl-es bin from here:
16 # https://www-a.ti.com/downloads/sds_support/targetcontent/dvsdk/oslinux_dvsdk/v3_00_3530/OMAP35x_Graphics_SDK_setuplinux_3_00_00_06.bin
17 # (replace version in .bin file as appropriate)
18 # 3. put the OMAP35x_*.bin file in libgles-omap3/
19 # mv OMAP35x_Graphics_SDK_setuplinux_3_00_00_06.bin ./libgles-omap3/
23 SRC_URI = "file://OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin \
26 file://sample.desktop \
29 S = "${WORKDIR}/OMAP35x_Graphics_SDK_${SGXPV}"
31 # Logic to unpack installjammer file
32 TI_BIN_UNPK_CMDS="Y: qY:workdir:Y"
33 require ../ti/ti-eula-unpack.inc
35 BINLOCATION ?= "${S}/gfx_rel"
36 ES2LOCATION ?= "${S}/gfx_rel_es2.x"
37 ES3LOCATION ?= "${S}/gfx_rel_es3.x"
38 ES5LOCATION ?= "${S}/gfx_rel_es5.x"
41 # Attempt to fix up the worst offenders for file permissions
42 for i in $(find ${S} -name "*.h") $(find ${S} -name "*.c") $(find ${S} -name "Make*") ; do
46 # Attempt to create proper library softlinks
47 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
48 if [ "$(readlink -n ${sofile})" = "" ] ; then
49 mv $sofile ${sofile}.${IMGPV}
50 ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}
51 ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1}')
52 ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1 "." $2}')
56 # Due to recursive make PLAT_* isn't always passed down correctly, so use sed to fix those
57 for mak in $(find ${S} -name "*.mak") ; do
58 sed -i -e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g $mak
62 find Binaries/ | xargs rm -f || true
65 # Force in GNU_HASH and paths to libs
66 TARGET_CC_ARCH += " ${TARGET_LINK_HASH_STYLE} -Wl,-rpath-link,${BINLOCATION} -L${BINLOCATION}"
70 export X11ROOT="${STAGING_INCDIR}"
71 export PLATFORM="LinuxOMAP3"
73 export PLAT_CC="${CC}"
74 export PLAT_CPP="${CXX}"
75 export PLAR_AR="${AR}"
77 mkdir -p ${S}/demos/raw
78 mkdir -p ${S}/demos/x11
80 # Rebuild demos for both Raw and X11
81 for X11BUILD in 0 1 ; do
82 for demo in ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Demos/* ; do
83 cd $demo/OGLES/Build/LinuxGeneric
84 oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
85 rm $demo/OGLES/Build/LinuxOMAP3/Release*/*.o
86 install -m 0755 $demo/OGLES/Build/LinuxOMAP3/ReleaseX11/* ${S}/demos/x11 || true
87 sed -e s:NAME:$(basename $demo): \
88 -e s:EXEC:${bindir}/SGX/demos/X11/$(basename $demo/OGLES/Build/LinuxOMAP3/ReleaseX11/*): \
89 ${WORKDIR}/sample.desktop > ${WORKDIR}/$(basename $demo).desktop
90 install -m 0755 $demo/OGLES/Build/LinuxOMAP3/ReleaseRaw/* ${S}/demos/raw || true
92 for demo in ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Demos/* ; do
93 cd $demo/OGLES2/Build/LinuxGeneric
94 oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
95 rm $demo/OGLES2/Build/LinuxOMAP3/Release*/*.o
96 install -m 0755 $demo/OGLES2/Build/LinuxOMAP3/ReleaseX11/* ${S}/demos/x11 || true
97 sed -e s:NAME:$(basename $demo): \
98 -e s:EXEC:${bindir}/SGX/demos/X11/$(basename $demo/OGLES2/Build/LinuxOMAP3/ReleaseX11/*): \
99 ${WORKDIR}/sample.desktop > ${WORKDIR}/$(basename $demo).desktop
100 install -m 0755 $demo/OGLES2/Build/LinuxOMAP3/ReleaseRaw/* ${S}/demos/raw || true
104 mkdir -p ${S}/trainingcourses/raw
105 mkdir -p ${S}/trainingcourses/x11
107 # Build OGLES2 Trainingcourses for both Raw and X11
108 for X11BUILD in 0 1 ; do
109 for training in ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/TrainingCourse/* ; do
110 if [ -e $training/OGLES2/Build/LinuxGeneric/Makefile ] ; then
111 cd $training/OGLES2/Build/LinuxGeneric
114 if [ -e $training/OGLES2/Build/LinuxOMAP3/Makefile ] ; then
115 cd $training/OGLES2/Build/LinuxOMAP3
118 oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
119 rm $training/OGLES2/Build/LinuxOMAP3/Release*/*.o
120 install -m 0755 $training/OGLES2/Build/LinuxOMAP3/ReleaseX11/* ${S}/trainingcourses/x11 || true
121 install -m 0755 $training/OGLES2/Build/LinuxOMAP3/ReleaseRaw/* ${S}/trainingcourses/raw || true
128 install -d ${D}${libdir}
129 cp -pPR ${BINLOCATION}/*.so* ${D}${libdir}
130 install -m 0644 ${BINLOCATION}/*.a ${D}${libdir}
132 install -d ${D}${bindir}/
133 install -m 0755 ${WORKDIR}/cputype ${D}${bindir}/
135 install -m 0755 ${BINLOCATION}/*_test ${D}${bindir}/
136 install -m 0755 ${BINLOCATION}/gl* ${D}${bindir}/
137 install -m 0755 ${BINLOCATION}/p[dv]* ${D}${bindir}/
138 install -m 0755 ${BINLOCATION}/xgles1test1 ${D}${bindir}/
140 install -m 0755 ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/|| true
142 install -d ${D}${includedir}
143 cp -pPR ${S}/GFX_Linux_KM/include4 ${D}${includedir}/
144 cp -pPR ${S}/GFX_Linux_KM/services4 ${D}${includedir}/
146 cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/* ${D}${includedir}/
147 cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${D}${includedir}/
148 cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES/ || true
149 cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES2/ || true
150 cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/v* ${D}${includedir}/ || true
151 cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/V* ${D}${includedir}/ || true
152 cp -pPr ${S}/include/*.h ${D}${includedir} || true
154 install -d ${D}${sysconfdir}/init.d/
155 cp -pP ${WORKDIR}/rc.pvr ${D}${sysconfdir}/init.d/pvr-init
157 install -d ${D}${sysconfdir}
158 echo "[default]" > ${D}${sysconfdir}/powervr.ini
159 echo "WindowSystem=libpvrPVR2D_FRONTWSEGL.so" >> ${D}${sysconfdir}/powervr.ini
161 # The ES2.x, ES3.x and ES5.x CPUs have different SGX hardware, so we need to install 2 sets of userspace
163 install -d ${D}${libdir}/ES5.0
164 install -d ${D}${libdir}/ES3.0
165 install -d ${D}${libdir}/ES2.0
167 install -d ${D}${bindir}/ES5.0
168 install -d ${D}${bindir}/ES3.0
169 install -d ${D}${bindir}/ES2.0
172 cp -pPR ${ES2LOCATION}/lib*${IMGPV} ${D}${libdir}/ES2.0/
173 cp ${ES2LOCATION}/p[dv]* ${D}${bindir}/ES2.0/
175 cp -pPR ${D}${libdir}/lib*${IMGPV} ${D}${libdir}/ES3.0/
176 cp ${D}${bindir}/p[dv]* ${D}${bindir}/ES3.0
178 if [ -e ${ES5LOCATION} ] ; then
179 cp -pPR ${ES5LOCATION}/lib*${IMGPV} ${D}${libdir}/ES5.0/
180 cp ${ES5LOCATION}/p[dv]* ${D}${bindir}/ES5.0/
183 install -d ${D}${prefix}/share/applications
184 cp ${WORKDIR}/*.desktop ${D}${prefix}/share/applications
185 rm ${D}${prefix}/share/applications/sample.desktop
187 install -d ${D}${bindir}/SGX/demos/X11/
188 install -d ${D}${bindir}/SGX/demos/Raw/
189 install -m 0755 ${S}/demos/x11/* ${D}${bindir}/SGX/demos/X11/
190 install -m 0755 ${S}/demos/raw/* ${D}${bindir}/SGX/demos/Raw/
192 install -d ${D}${bindir}/SGX/trainingcourses/Raw
193 install -d ${D}${bindir}/SGX/trainingcourses/X11
194 install -m 0755 ${S}/trainingcourses/x11/* ${D}${bindir}/SGX/trainingcourses/X11/
195 install -m 0755 ${S}/trainingcourses/raw/* ${D}${bindir}/SGX/trainingcourses/Raw/
197 # Delete objects and linker scripts hidden between the headers
198 find ${D} -name "*.o" -delete
199 find ${D} -name "*.o.cmd" -delete
202 PACKAGES =+ "${PN}-rawdemos \
204 ${PN}-rawtrainingcourses \
205 ${PN}-x11trainingcourses \
208 PACKAGES += "xserver-kdrive-powervrsgx \
211 FILES_${PN} = "${sysconfdir} ${libdir}/lib*.so.* ${libdir}/ES*/* ${bindir}/pvrsrvinit ${bindir}/cputype ${bindir}/*/*"
212 FILES_xserver-kdrive-powervrsgx = "${bindir}/Xsgx"
213 FILES_${PN}-tests = "${bindir}/*"
214 FILES_${PN}-dbg = "${libdir}/.debug/* ${bindir}/.debug/* \
215 ${libdir}/ES*/.debug ${bindir}/*/.debug\
216 ${bindir}/SGX/demos/*/.debug/* \
217 ${bindir}/SGX/trainingcourses/*/.debug/* \
220 FILES_${PN}-rawdemos = "${bindir}/SGX/demos/Raw/*"
221 FILES_${PN}-x11demos = "${bindir}/SGX/demos/X11/* ${prefix}/share/applications "
223 FILES_${PN}-rawtrainingcourses = "${bindir}/SGX/trainingcourses/Raw/*"
224 FILES_${PN}-x11trainingcourses = "${bindir}/SGX/trainingcourses/X11/*"
226 # The libs need the kernel-modules
227 RRECOMMENDS_${PN} = "omap3-sgx-modules"
229 # The initscript calls fbset, cputype calls devmem2
230 RDEPENDS_${PN} += "fbset devmem2"
232 #HACK! These are binaries, so we can't guarantee that LDFLAGS match :(
233 INSANE_SKIP_${PN} = True
234 INSANE_SKIP_${PN}-tests = True
235 INSANE_SKIP_xserver-kdrive-powervrsgx = True
237 # Quality control is really poor on these SDKs, so hack around the latest madness:
238 FILES_${PN} += "${libdir}/*.so "
239 FILES_${PN}-dev = "${includedir}"
243 INITSCRIPT_NAME = "pvr-init"
244 INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."
246 # Append to update-rc.d postinst
247 pkg_postinst_${PN}_append() {
248 rm -f /etc/powervr-esrev
250 ln -sf /usr/lib/libXdmcp.so.6.0.0 /usr/lib/libXdmcp.so.0
251 ln -sf /usr/lib/libXau.so.6.0.0 /usr/lib/libXau.so.0