summaryrefslogtreecommitdiff
path: root/recipes/trdx-nv-binaries/nvsamples.bb
blob: 159ae28f508fa24634362da50b3e49188a8d9ff9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
SECTION = "graphical/utils"
DESCRIPTION = "Nvidia samples for OpenGL ES, OpenGL ES  headers"
LICENSE = "CLOSED"
DEPENDS = "trdx-nv-binaries"
RDEPENDS = "trdx-nv-binaries"

PR = "r0"

SRC_URI = "http://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Samples/nvsamples.tar.bz2 \
	   file://nvsamples-oe.patch \
	   file://nvsamples-no-binary-shaders.patch \
	   file://nvsamples-hardfp.patch \
"

S = "${WORKDIR}/nvsamples"

SRC_URI[md5sum] = "240b0beb0056dde2e6ac1538dc8b6684"
SRC_URI[sha256sum] = "2638beea80fd85fdc5f9443e6959c210e275e627f662266cd404ce7c68b0806d"

#no gnu_hash in NVIDIA binaries, skip QA for this package
INSANE_SKIP_${PN} = "dev-so ldflags"

FILES_${PN} += " \
        /home/root/textures/* \
        /home/root/shaders/* \
"

do_compile () {
	cd ${S}/samples/tools/nvtexfont2
	oe_runmake clean
	oe_runmake WORKDIR=${WORKDIR}
	mv -f libnvtexfont2.a ${S}/lib-target/

	cd ${S}/samples/tools/nvgl2demo_common
	oe_runmake clean
	oe_runmake WORKDIR=${WORKDIR}
	mv -f libnvgl2demo_common.a ${S}/lib-target/

	cd ${S}/samples/opengles2
	oe_runmake clean
	oe_runmake WORKDIR=${WORKDIR}
}

do_install () {
# install the sample code
	install -d ${D}${bindir}
	install -d ${D}/home/root/textures
	install -d ${D}/home/root/shaders
        install -m 0755 ${S}/samples/opengles2/ctree/ctree ${D}${bindir}
        install -m 0644 ${S}/samples/opengles2/ctree/textures/* ${D}/home/root/textures
        install -m 0644 ${S}/samples/opengles2/ctree/*.glsl? ${D}/home/root/shaders
        install -m 0755 ${S}/samples/opengles2/bubble/bubble ${D}${bindir}
        install -m 0644 ${S}/samples/opengles2/bubble/textures/* ${D}/home/root/textures
        install -m 0644 ${S}/samples/opengles2/bubble/*.glsl? ${D}/home/root/shaders
        install -m 0755 ${S}/samples/opengles2/gears/gears ${D}${bindir}
        install -m 0644 ${S}/samples/opengles2/gears/*.glsl? ${D}/home/root/shaders

# export OpenGL ES headers
# maybe replace with http://www.khronos.org/registry/omxil/api/1.2.0/OpenMAX_IL_1_2_0_Header.zip, http://www.khronos.org/registry/khronos_headers.tgz
	for dir in EGL GLES2 KD KHR OpenMAX/il OpenMAX/ilclient
	do
		install -d ${D}${includedir}/$dir 
		install -m 0644 ${S}/include/$dir/* ${D}${includedir}/$dir
	done
}