summaryrefslogtreecommitdiffstats
path: root/rules/mplayer.make
blob: 6e1b8fb2248ae675814efcf7fabef0ae104c1fc2 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# -*-makefile-*-
# $Id: template 3345 2005-11-14 17:14:19Z rsc $
#
# Copyright (C) 2005 by Sascha Hauer
#          
# See CREDITS for details about who has contributed to this project.
#
# For further information about the PTXdist project and license conditions
# see the README file.
#

#
# We provide this package
#
PACKAGES-$(PTXCONF_MPLAYER) += mplayer

#
# Paths and names
#
MPLAYER_VERSION	= 1.0pre7try2
MPLAYER		= MPlayer-$(MPLAYER_VERSION)
MPLAYER_SUFFIX	= tar.bz2
MPLAYER_URL	= http://ftp5.mplayerhq.hu/mplayer/releases/$(MPLAYER).$(MPLAYER_SUFFIX)
MPLAYER_SOURCE	= $(SRCDIR)/$(MPLAYER).$(MPLAYER_SUFFIX)
MPLAYER_DIR	= $(BUILDDIR)/$(MPLAYER)

-include $(call package_depfile)

# ----------------------------------------------------------------------------
# Get
# ----------------------------------------------------------------------------

mplayer_get: $(STATEDIR)/mplayer.get

mplayer_get_deps = $(MPLAYER_SOURCE)

$(STATEDIR)/mplayer.get: $(mplayer_get_deps)
	@$(call targetinfo, $@)
	@$(call touch, $@)

$(MPLAYER_SOURCE):
	@$(call targetinfo, $@)
	@$(call get, $(MPLAYER_URL))

# ----------------------------------------------------------------------------
# Extract
# ----------------------------------------------------------------------------

mplayer_extract: $(STATEDIR)/mplayer.extract

mplayer_extract_deps = $(STATEDIR)/mplayer.get

$(STATEDIR)/mplayer.extract: $(mplayer_extract_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(MPLAYER_DIR))
	@$(call extract, $(MPLAYER_SOURCE))
	@$(call patchin, $(MPLAYER))
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------

mplayer_prepare: $(STATEDIR)/mplayer.prepare

#
# dependencies
#
mplayer_prepare_deps = \
	$(STATEDIR)/mplayer.extract \
	$(STATEDIR)/virtual-xchain.install

MPLAYER_PATH	=  PATH=$(CROSS_PATH)
MPLAYER_ENV 	=  $(CROSS_ENV)
MPLAYER_ENV	+= PKG_CONFIG_PATH=$(CROSS_LIB_DIR)/lib/pkgconfig

#
# autoconf
#
#MPLAYER_AUTOCONF = $(CROSS_AUTOCONF_USR)

MPLAYER_AUTOCONF =  --cc=$(PTXCONF_GNU_TARGET)-gcc
MPLAYER_AUTOCONF += --as=$(PTXCONF_GNU_TARGET)-as
MPLAYER_AUTOCONF += --host-cc=$(HOSTCC)
MPLAYER_AUTOCONF += --target=$(PTXCONF_ARCH)
MPLAYER_AUTOCONF += --disable-mencoder
MPLAYER_AUTOCONF += --enable-fbdev

$(STATEDIR)/mplayer.prepare: $(mplayer_prepare_deps)
	@$(call targetinfo, $@)
	@$(call clean, $(MPLAYER_DIR)/config.cache)
	cd $(MPLAYER_DIR) && \
		$(MPLAYER_PATH) $(MPLAYER_ENV) \
		./configure $(MPLAYER_AUTOCONF)
	@echo 
	@echo FIXME: this is necessary with gcc 3.4.4 which runs into OOM with -O4
	@echo
#	sed -ie "s/[ \t]-O4[ \t]/ -O2 /g" $(MPLAYER_DIR)/config.mak
	@echo
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Compile
# ----------------------------------------------------------------------------

mplayer_compile: $(STATEDIR)/mplayer.compile

mplayer_compile_deps = $(STATEDIR)/mplayer.prepare

$(STATEDIR)/mplayer.compile: $(mplayer_compile_deps)
	@$(call targetinfo, $@)
	cd $(MPLAYER_DIR) && $(MPLAYER_ENV) $(MPLAYER_PATH) make
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------

mplayer_install: $(STATEDIR)/mplayer.install

$(STATEDIR)/mplayer.install: $(STATEDIR)/mplayer.compile
	@$(call targetinfo, $@)
	@$(call install, MPLAYER)
	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Target-Install
# ----------------------------------------------------------------------------

mplayer_targetinstall: $(STATEDIR)/mplayer.targetinstall

mplayer_targetinstall_deps = $(STATEDIR)/mplayer.compile

$(STATEDIR)/mplayer.targetinstall: $(mplayer_targetinstall_deps)
	@$(call targetinfo, $@)

	@$(call install_init,default)
	@$(call install_fixup,PACKAGE,mplayer)
	@$(call install_fixup,PRIORITY,optional)
	@$(call install_fixup,VERSION,$(MPLAYER_VERSION))
	@$(call install_fixup,SECTION,base)
	@$(call install_fixup,AUTHOR,"Robert Schwebel <r.schwebel\@pengutronix.de>")
	@$(call install_fixup,DEPENDS,)
	@$(call install_fixup,DESCRIPTION,missing)

	@$(call install_copy, 0, 0, 0755, $(MPLAYER_DIR)/mplayer, /usr/bin/mplayer)

	@$(call install_finish)

	@$(call touch, $@)

# ----------------------------------------------------------------------------
# Clean
# ----------------------------------------------------------------------------

mplayer_clean:
	rm -rf $(STATEDIR)/mplayer.*
	rm -rf $(IMAGEDIR)/mplayer_*
	rm -rf $(MPLAYER_DIR)

# vim: syntax=make