summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/libgles/libgles-omap3.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-graphics/libgles/libgles-omap3.inc')
-rw-r--r--recipes-graphics/libgles/libgles-omap3.inc280
1 files changed, 280 insertions, 0 deletions
diff --git a/recipes-graphics/libgles/libgles-omap3.inc b/recipes-graphics/libgles/libgles-omap3.inc
new file mode 100644
index 00000000..2868fabe
--- /dev/null
+++ b/recipes-graphics/libgles/libgles-omap3.inc
@@ -0,0 +1,280 @@
1DESCRIPTION = "libGLES for the omap3"
2LICENSE = "proprietary-binary"
3# 'TSPA.txt' might not be the best file to md5sum
4LIC_FILES_CHKSUM = "file://TSPA.txt;md5=c0d5d9c1e38b41677144c4e24d6ddee1"
5
6PR = "r15"
7
8COMPATIBLE_MACHINE = "(omap3|ti816x)"
9
10DEPENDS = "virtual/libx11 libxau libxdmcp"
11
12PROVIDES += "virtual/egl"
13
14SRC_URI = "http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/${SGXPV}/exports/OMAP35x_Graphics_SDK_setuplinux_${SGXPV}.bin \
15 file://cputype \
16 file://rc.pvr \
17 file://sample.desktop \
18 file://99-bufferclass.rules \
19"
20
21S = "${WORKDIR}/OMAP35x_Graphics_SDK_${SGXPV}"
22
23# Logic to unpack installjammer file
24TI_BIN_UNPK_CMDS="Y: qY:workdir:Y"
25require ../../recipes-ti/includes/ti-eula-unpack.inc
26
27BINLOCATION ?= "${S}/gfx_rel"
28ES2LOCATION ?= "${S}/gfx_rel_es2.x"
29ES3LOCATION ?= "${S}/gfx_rel_es3.x"
30ES5LOCATION ?= "${S}/gfx_rel_es5.x"
31ES6LOCATION ?= "${S}/gfx_rel_es6.x"
32
33do_configure() {
34 # Attempt to fix up the worst offenders for file permissions
35 for i in $(find ${S} -name "*.h") $(find ${S} -name "*.c") $(find ${S} -name "Make*") ; do
36 chmod 0644 $i
37 done
38
39 # Attempt to create proper library softlinks
40 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
41 if [ "$(readlink -n ${sofile})" = "" ] ; then
42 mv $sofile ${sofile}.${IMGPV}
43 ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}
44 ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1}')
45 ln -sf $(basename ${sofile}.${IMGPV}) ${sofile}$(echo ${IMGPV} | awk -F. '{print "." $1 "." $2}')
46 fi
47 done
48
49 # Due to recursive make PLAT_* isn't always passed down correctly, so use sed to fix those
50 for mak in $(find ${S} -name "*.mak") ; do
51 sed -i -e s:arm-none-linux-gnueabi-:${TARGET_PREFIX}:g $mak
52 done
53
54 # clear out old stuff
55 find Binaries/ | xargs rm -f || true
56}
57
58# Force in GNU_HASH and paths to libs
59TARGET_CC_ARCH += " ${TARGET_LINK_HASH_STYLE} -Wl,-rpath-link,${BINLOCATION} -L${BINLOCATION} \
60-L${STAGING_DIR_TARGET}${libdir} -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir}"
61PARALLEL_MAKE = ""
62
63do_compile() {
64 export X11ROOT="${STAGING_DIR_HOST}/usr"
65 export TOOLCHAIN="${TOOLCHAIN_PATH}"
66 export PLATFORM="LinuxOMAP3"
67
68 export PLAT_CC="${CC}"
69 export PLAT_CPP="${CXX}"
70 export PLAR_AR="${AR}"
71
72 mkdir -p ${S}/demos/raw
73 mkdir -p ${S}/demos/x11
74
75 # Rebuild demos for both Raw and X11
76 for X11BUILD in 0 1 ; do
77 for demo in ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Demos/* ; do
78 cd $demo/OGLES/Build/LinuxGeneric
79 oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
80 rm $demo/OGLES/Build/LinuxOMAP3/Release*/*.o
81 install -m 0755 $demo/OGLES/Build/LinuxOMAP3/ReleaseX11/* ${S}/demos/x11 || true
82 sed -e s:NAME:$(basename $demo): \
83 -e s:EXEC:${bindir}/SGX/demos/X11/$(basename $demo/OGLES/Build/LinuxOMAP3/ReleaseX11/*): \
84 ${WORKDIR}/sample.desktop > ${WORKDIR}/$(basename $demo).desktop
85 install -m 0755 $demo/OGLES/Build/LinuxOMAP3/ReleaseRaw/* ${S}/demos/raw || true
86 done
87 for demo in ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Demos/* ; do
88 cd $demo/OGLES2/Build/LinuxGeneric
89 oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
90 rm -f $demo/OGLES2/Build/LinuxOMAP3/Release*/*.o
91 install -m 0755 $demo/OGLES2/Build/LinuxOMAP3/ReleaseX11/* ${S}/demos/x11 || true
92 sed -e s:NAME:$(basename $demo): \
93 -e s:EXEC:${bindir}/SGX/demos/X11/$(basename $demo/OGLES2/Build/LinuxOMAP3/ReleaseX11/*): \
94 ${WORKDIR}/sample.desktop > ${WORKDIR}/$(basename $demo).desktop
95 install -m 0755 $demo/OGLES2/Build/LinuxOMAP3/ReleaseRaw/* ${S}/demos/raw || true
96 done
97 done
98
99 mkdir -p ${S}/trainingcourses/raw
100 mkdir -p ${S}/trainingcourses/x11
101
102 find ${S} -name "*_org" -delete
103
104 # Build OGLES2 Trainingcourses for both Raw and X11
105 for X11BUILD in 0 1 ; do
106 for training in ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/TrainingCourse/* ; do
107 if [ -e $training/OGLES2/Build/LinuxGeneric/Makefile ] ; then
108 cd $training/OGLES2/Build/LinuxGeneric
109 fi
110
111 if [ -e $training/OGLES2/Build/LinuxOMAP3/Makefile ] ; then
112 cd $training/OGLES2/Build/LinuxOMAP3
113 fi
114
115 oe_runmake Common=1 PLATFORM=$PLATFORM X11BUILD=$X11BUILD
116 rm -f $training/OGLES2/Build/LinuxOMAP3/Release*/*.o
117 install -m 0755 $training/OGLES2/Build/LinuxOMAP3/ReleaseX11/* ${S}/trainingcourses/x11 || true
118 install -m 0755 $training/OGLES2/Build/LinuxOMAP3/ReleaseRaw/* ${S}/trainingcourses/raw || true
119 done
120 done
121
122}
123
124do_install () {
125 install -d ${D}${libdir}
126 cp -pPR ${BINLOCATION}/*.so* ${D}${libdir}
127 install -m 0644 ${BINLOCATION}/*.a ${D}${libdir}
128
129 install -d ${D}${bindir}/
130 install -m 0755 ${WORKDIR}/cputype ${D}${bindir}/
131
132 install -m 0755 ${BINLOCATION}/*_test ${D}${bindir}/
133 install -m 0755 ${BINLOCATION}/gl* ${D}${bindir}/
134 install -m 0755 ${BINLOCATION}/p[dv]* ${D}${bindir}/
135 install -m 0755 ${BINLOCATION}/xgles1test1 ${D}${bindir}/
136
137 install -m 0755 ${BINLOCATION}/freedesktop/kdrive/usr/X11R6_SGX/bin/Xsgx ${D}${bindir}/|| true
138
139 install -d ${D}${includedir}
140 cp -pPR ${S}/GFX_Linux_KM/include4 ${D}${includedir}/
141 cp -pPR ${S}/GFX_Linux_KM/services4 ${D}${includedir}/
142
143 cp -pPR ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/* ${D}${includedir}/
144 cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/* ${D}${includedir}/
145 cp -pPR ${S}/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES/ || true
146 cp -pPr ${S}/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/GLES/* ${D}${includedir}/GLES2/ || true
147 cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/v* ${D}${includedir}/ || true
148 cp -pPr ${S}/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/V* ${D}${includedir}/ || true
149 cp -pPr ${S}/include/*.h ${D}${includedir} || true
150 cp -pPr ${S}/include/wsegl/*.h ${D}${includedir} || true
151
152 install -d ${D}${sysconfdir}/init.d/
153 cp -pP ${WORKDIR}/rc.pvr ${D}${sysconfdir}/init.d/pvr-init
154
155 install -d ${D}${sysconfdir}
156 echo "[default]" > ${D}${sysconfdir}/powervr.ini
157 echo "WindowSystem=libpvrPVR2D_FRONTWSEGL.so.1" >> ${D}${sysconfdir}/powervr.ini
158
159 # The ES2.x, ES3.x, ES5.x and ES6.x CPUs have different SGX hardware, so we need to install multiple sets of userspace
160
161 install -d ${D}${libdir}/ES6.0
162 install -d ${D}${libdir}/ES5.0
163 install -d ${D}${libdir}/ES3.0
164 install -d ${D}${libdir}/ES2.0
165
166 install -d ${D}${bindir}/ES6.0
167 install -d ${D}${bindir}/ES5.0
168 install -d ${D}${bindir}/ES3.0
169 install -d ${D}${bindir}/ES2.0
170
171
172 cp -pPR ${ES2LOCATION}/lib*${IMGPV} ${D}${libdir}/ES2.0/
173 cp ${ES2LOCATION}/p[dv]* ${D}${bindir}/ES2.0/
174
175 cp -pPR ${D}${libdir}/lib*${IMGPV} ${D}${libdir}/ES3.0/
176 cp ${D}${bindir}/p[dv]* ${D}${bindir}/ES3.0
177
178 if [ -e ${ES5LOCATION} ] ; then
179 cp -pPR ${ES5LOCATION}/lib*${IMGPV} ${D}${libdir}/ES5.0/
180 cp ${ES5LOCATION}/p[dv]* ${D}${bindir}/ES5.0/
181 fi
182
183 if [ -e ${ES6LOCATION} ] ; then
184 cp -pPR ${ES6LOCATION}/lib*${IMGPV} ${D}${libdir}/ES6.0/
185 cp ${ES6LOCATION}/p[dv]* ${D}${bindir}/ES6.0/
186 fi
187
188 rm ${D}${bindir}/ES*/*.h ${D}${bindir}/ES*/pdsasm ${D}${bindir}/pdsasm -f || true
189
190 install -d ${D}${prefix}/share/applications
191 cp ${WORKDIR}/*.desktop ${D}${prefix}/share/applications
192 rm ${D}${prefix}/share/applications/sample.desktop
193
194 install -d ${D}${bindir}/SGX/demos/X11/
195 install -d ${D}${bindir}/SGX/demos/Raw/
196 install -m 0755 ${S}/demos/x11/* ${D}${bindir}/SGX/demos/X11/
197 install -m 0755 ${S}/demos/raw/* ${D}${bindir}/SGX/demos/Raw/
198
199 install -d ${D}${bindir}/SGX/trainingcourses/Raw
200 install -d ${D}${bindir}/SGX/trainingcourses/X11
201 install -m 0755 ${S}/trainingcourses/x11/* ${D}${bindir}/SGX/trainingcourses/X11/
202 install -m 0755 ${S}/trainingcourses/raw/* ${D}${bindir}/SGX/trainingcourses/Raw/
203
204 # Delete objects and linker scripts hidden between the headers
205 find ${D} -name "*.o" -delete
206 find ${D} -name "*.o.cmd" -delete
207
208 install -d ${D}${sysconfdir}/udev/rules.d
209 install -m 0644 ${WORKDIR}/99-bufferclass.rules ${D}${sysconfdir}/udev/rules.d/
210
211}
212
213PACKAGES =+ "${PN}-rawdemos \
214 ${PN}-x11demos \
215 ${PN}-rawtrainingcourses \
216 ${PN}-x11trainingcourses \
217"
218
219PACKAGES += "xserver-kdrive-powervrsgx \
220 ${PN}-tests "
221
222PACKAGES =+ "${PN}-blitwsegl ${PN}-flipwsegl ${PN}-frontwsegl ${PN}-linuxfbwsegl ${PN}-x11wsegl"
223
224FILES_${PN}-blitwsegl = "${libdir}/libpvrPVR2D_BLITWSEGL.so.* ${libdir}/*/libpvrPVR2D_BLITWSEGL.so.*"
225FILES_${PN}-flipwsegl = "${libdir}/libpvrPVR2D_FLIPWSEGL.so.* ${libdir}/*/libpvrPVR2D_FLIPWSEGL.so.*"
226FILES_${PN}-frontwsegl = "${libdir}/libpvrPVR2D_FRONTWSEGL.so.* ${libdir}/*/libpvrPVR2D_FRONTWSEGL.so.*"
227FILES_${PN}-linuxfbwsegl = "${libdir}/libpvrPVR2D_LINUXFBWSEGL.so.* ${libdir}/*/libpvrPVR2D_LINUXFBWSEGL.so.*"
228FILES_${PN}-x11wsegl = "${libdir}/libpvrPVR2D_X11WSEGL.so* ${libdir}/*/libpvrPVR2D_X11WSEGL.so*"
229
230CONFFILES_${PN} = "${sysconfdir}/powervr.ini"
231
232FILES_${PN} = "${sysconfdir} ${libdir}/lib*.so.* ${libdir}/ES*/* ${bindir}/pvrsrvinit ${bindir}/cputype ${bindir}/*/*"
233FILES_xserver-kdrive-powervrsgx = "${bindir}/Xsgx"
234FILES_${PN}-tests = "${bindir}/*"
235FILES_${PN}-dbg = "${libdir}/.debug/* ${bindir}/.debug/* \
236 ${libdir}/ES*/.debug ${bindir}/*/.debug\
237 ${bindir}/SGX/demos/*/.debug/* \
238 ${bindir}/SGX/trainingcourses/*/.debug/* \
239 "
240
241FILES_${PN}-rawdemos = "${bindir}/SGX/demos/Raw/*"
242FILES_${PN}-x11demos = "${bindir}/SGX/demos/X11/* ${prefix}/share/applications "
243RRECOMMENDS_${PN}-x11demos = "${PN}-x11wsegl"
244
245FILES_${PN}-rawtrainingcourses = "${bindir}/SGX/trainingcourses/Raw/*"
246FILES_${PN}-x11trainingcourses = "${bindir}/SGX/trainingcourses/X11/*"
247RRECOMMENDS_${PN}-x11trainingcourses = "${PN}-x11wsegl"
248
249# The libs need the kernel-modules
250RRECOMMENDS_${PN} = "omap3-sgx-modules"
251
252# The initscript calls fbset, cputype calls devmem2
253RDEPENDS_${PN} += "fbset devmem2"
254
255#HACK! These are binaries, so we can't guarantee that LDFLAGS match :(
256INSANE_SKIP_${PN} = True
257INSANE_SKIP_${PN}-blitwsegl = True
258INSANE_SKIP_${PN}-flipwsegl = True
259INSANE_SKIP_${PN}-frontwsegl = True
260INSANE_SKIP_${PN}-linuxfbwsegl = True
261INSANE_SKIP_${PN}-x11wsegl = True
262INSANE_SKIP_${PN}-tests = True
263INSANE_SKIP_xserver-kdrive-powervrsgx = True
264
265# Quality control is really poor on these SDKs, so hack around the latest madness:
266FILES_${PN} += "${libdir}/*.so "
267FILES_${PN}-dev = "${includedir}"
268
269inherit update-rc.d
270
271INITSCRIPT_NAME = "pvr-init"
272INITSCRIPT_PARAMS = "start 30 5 2 . stop 40 0 1 6 ."
273
274# Append to update-rc.d postinst
275pkg_postinst_${PN}_append() {
276rm -f /etc/powervr-esrev
277
278ln -sf /usr/lib/libXdmcp.so.6.0.0 /usr/lib/libXdmcp.so.0
279ln -sf /usr/lib/libXau.so.6.0.0 /usr/lib/libXau.so.0
280}