increase dvbapp PR.
[vuplus_openembedded] / recipes / mplayer / mplayer_git.bb
1 DESCRIPTION = "Open Source multimedia player."
2 SECTION = "multimedia"
3 PRIORITY = "optional"
4 HOMEPAGE = "http://www.mplayerhq.hu/"
5 DEPENDS = "live555 libdvdread libtheora virtual/libsdl ffmpeg xsp zlib libpng jpeg liba52 freetype fontconfig alsa-lib lzo ncurses lame libxv virtual/libx11 virtual/kernel \
6            ${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'libmad liba52 lame', d)}"
7
8 RDEPENDS = "mplayer-common"
9 LICENSE = "GPL"
10 SRC_URI = "git://repo.or.cz/mplayer.git;protocol=git;branch=master"
11 SRC_URI_om-gta02 = "git://repo.or.cz/mplayer/glamo.git;protocol=git;branch=master \
12    file://makefile-nostrip-svn.patch;patch=1 \
13    "
14
15 SRC_URI_append = " \
16            file://pld-onlyarm5-svn.patch;patch=1 \
17            file://makefile-nostrip-svn.patch;patch=1 \
18            "
19
20 SRC_URI_append_armv7a = " \
21                 file://omapfb.patch;patch=1 \
22            file://vo_omapfb.c \
23            file://yuv.S \
24           "
25
26 # This is required for the collie machine only as all stacks in that
27 # machine seem to be set to executable by the toolchain. If someone
28 # discovers this is more general than please make this more general
29 # ie. for all armv4 machines.
30 SRC_URI_append_collie = "file://disable-executable-stack-test.patch;patch=1"
31
32 SRCREV_om-gta02 = "71807fcbb1eb35c337ef03f4f62d181963173550"
33 SRCREV = "e5bcd70bc5b0557635ae51c7093f0e887493d4ba"
34
35 PACKAGE_ARCH_collie = "collie"
36 PACKAGE_ARCH_c7x0 = "c7x0"
37 PACKAGE_ARCH_hx4700 = "hx4700"
38
39 ARM_INSTRUCTION_SET = "ARM"
40
41 RCONFLICTS_${PN} = "mplayer-atty"
42 RREPLACES_${PN} = "mplayer-atty"
43
44 PV = "0.0+1.0rc3+gitr${SRCREV}"
45 PR = "r0"
46 DEFAULT_PREFERENCE = "-1"
47 DEFAULT_PREFERENCE_om-gta02 = "1"
48
49 PARALLEL_MAKE = ""
50
51 S = "${WORKDIR}/git"
52
53 PACKAGES =+ "mencoder"
54
55 FILES_${PN} = "${bindir}/mplayer ${libdir} /usr/etc/mplayer/"
56 FILES_mencoder = "${bindir}/mencoder"
57 CONFFILES_${PN} += "/usr/etc/mplayer/input.conf \
58                     /usr/etc/mplayer/example.conf \
59                     /usr/etc/mplayer/codecs.conf \
60                    "
61
62 inherit autotools pkgconfig
63
64 # We want a kernel header for armv7a, but we don't want to make mplayer machine specific for that
65 STAGING_KERNEL_DIR = "${STAGING_DIR}/${MACHINE_ARCH}${TARGET_VENDOR}-${TARGET_OS}/kernel"
66
67 EXTRA_OECONF = " \
68         --prefix=/usr \
69         --mandir=${mandir} \
70         --target=${SIMPLE_TARGET_SYS} \
71         \
72         --enable-mencoder \
73         --disable-gui \
74         --enable-largefiles \
75         --disable-linux-devfs \
76         --disable-lirc \
77         --disable-lircc \
78         --disable-joystick \
79         --disable-vm \
80         --disable-xf86keysym \
81         --enable-tv \
82         --enable-tv-v4l1 \       
83         --enable-tv-v4l2 \
84         --disable-tv-bsdbt848 \
85         --enable-rtc \
86         --enable-network \
87         --disable-smb \
88         --enable-live \
89         --disable-dvdnav \
90         --enable-dvdread \
91         --disable-dvdread-internal \
92         --enable-libdvdcss-internal \
93         --disable-cdparanoia \
94         --enable-freetype \
95         --enable-menu \
96         --enable-sortsub \
97         --disable-fribidi \
98         --disable-enca \
99         --disable-ftp \
100         --disable-vstream \
101         \
102         --disable-gif \
103         --enable-png \
104         --enable-jpeg \
105         --disable-libcdio \
106         --disable-liblzo \
107         --disable-qtx \
108         --disable-xanim \
109         --disable-real \
110         --disable-xvid \
111         --disable-x264 \
112         \
113         --enable-tremor-low \
114         \
115         --disable-speex \
116         --enable-theora \
117         --disable-faac \
118         --disable-ladspa \
119         --disable-libdv \
120         --enable-mad \
121         --disable-toolame \
122         --disable-twolame \
123         --disable-xmms \
124         --disable-mp3lib \
125         --enable-libmpeg2 \
126         --disable-musepack \
127         \
128         --disable-gl \
129         --disable-vesa \
130         --disable-svga \
131         --enable-sdl \
132         --disable-aa \
133         --disable-caca \
134         --disable-ggi \
135         --disable-ggiwmh \
136         --disable-directx \
137         --disable-dxr2 \
138         --disable-dxr3 \
139         --disable-dvb \
140         --disable-dvbhead \
141         --disable-mga \
142         --disable-xmga \
143         --enable-xv \
144         --disable-xvmc \
145         --disable-vm \
146         --disable-xinerama \
147         --enable-x11 \
148         --enable-fbdev \
149         --disable-mlib \
150         --disable-3dfx \
151         --disable-tdfxfb \
152         --disable-s3fb \
153         --disable-directfb \
154         --disable-zr \
155         --disable-bl \
156         --disable-tdfxvid \
157         --disable-tga \
158         --disable-pnm \
159         --disable-md5sum \
160         \
161         --enable-alsa \
162         --enable-ossaudio \
163         --disable-arts \
164         --disable-esd \
165         --disable-pulse \
166         --disable-jack \
167         --disable-openal \
168         --disable-nas \
169         --disable-sgiaudio \
170         --disable-sunaudio \
171         --disable-win32waveout \
172         --enable-select \
173         \
174         --extra-libs=' -lBasicUsageEnvironment -lUsageEnvironment -lgroupsock -lliveMedia -lstdc++' \
175 "
176
177 EXTRA_OECONF_append_armv6 = " --enable-armv6"
178 EXTRA_OECONF_append_armv7a = " --enable-armv6 --enable-neon"
179
180 EXTRA_OECONF_append_om-gta02 = " --enable-glamo"
181
182 #build with support for the iwmmxt instruction and pxa270fb overlay support (pxa270 and up)
183 #not every iwmmxt machine has the lcd connected to pxafb, but building the module doesn't hurt 
184 MY_ARCH := "${PACKAGE_ARCH}"
185 PACKAGE_ARCH = "${@base_contains('MACHINE_FEATURES', 'iwmmxt', 'iwmmxt', '${MY_ARCH}',d)}"
186
187 MY_TARGET_CC_ARCH := "${TARGET_CC_ARCH}"
188 TARGET_CC_ARCH = "${@base_contains('MACHINE_FEATURES', 'iwmmxt', '-march=iwmmxt -mtune=iwmmxt', '${MY_TARGET_CC_ARCH}',d)}"
189
190 EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'iwmmxt', ' --enable-iwmmxt', '',d)} "
191 EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'x86', '--enable-runtime-cpudetection', '',d)} "
192
193 FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O4 -ffast-math"
194 FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations  -ftree-vectorize -fomit-frame-pointer -O4 -ffast-math"
195 BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
196
197 do_configure_prepend_armv7a() {
198         cp ${WORKDIR}/yuv.S ${S}/libvo
199         cp ${WORKDIR}/vo_omapfb.c ${S}/libvo
200         cp ${STAGING_KERNEL_DIR}/arch/arm/plat-omap/include/mach/omapfb.h ${S}/libvo/omapfb.h || true
201         cp ${STAGING_KERNEL_DIR}/include/asm-arm/arch-omap/omapfb.h ${S}/libvo/omapfb.h || true
202         cp ${STAGING_KERNEL_DIR}/include/linux/omapfb.h ${S}/libvo/omapfb.h || true
203         sed -e 's/__user//g' -i ${S}/libvo/omapfb.h || true
204 }
205
206 CFLAGS_append = " -I${S}/libdvdread4 "
207
208 do_configure() {
209         sed -i 's|/usr/include|${STAGING_INCDIR}|g' ${S}/configure
210         sed -i 's|/usr/lib|${STAGING_LIBDIR}|g' ${S}/configure
211         sed -i 's|/usr/\S*include[\w/]*||g' ${S}/configure
212         sed -i 's|/usr/\S*lib[\w/]*||g' ${S}/configure
213         sed -i 's|HOST_CC|BUILD_CC|' ${S}/Makefile
214
215         export SIMPLE_TARGET_SYS="$(echo ${TARGET_SYS} | sed s:${TARGET_VENDOR}::g)"
216         ./configure ${EXTRA_OECONF}
217         
218 }
219
220 do_compile () {
221         oe_runmake
222 }
223
224 do_install_append() {
225         install -d ${D}/usr/etc/mplayer
226         install ${S}/etc/input.conf ${D}/usr/etc/mplayer/
227         install ${S}/etc/example.conf ${D}/usr/etc/mplayer/
228         install ${S}/etc/codecs.conf ${D}/usr/etc/mplayer/
229 }