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