[PATCH] cmus music player Makefile
[openwrt/svn-archive/archive.git] / sound / cmus / Makefile
1 #
2 # Copyright (C) 2011 Johannes Wei├čl <jargon@molb.org>
3 # Copyright (C) 2006-2011 OpenWrt.org
4 #
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
7 #
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=cmus
12 PKG_VERSION:=2.4.0
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=@SF/cmus
17 PKG_MD5SUM:=0c5a9f4032e632e5f6b6a49f53df1e7e
18
19 PKG_INSTALL:=1
20 PKG_BUILD_DIR:=$(BUILD_DIR)/cmus-v$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23 include $(INCLUDE_DIR)/nls.mk
24
25 define Package/cmus
26 SECTION:=sound
27 CATEGORY:=Sound
28 DEPENDS:= \
29 +libpthread +librt +libncurses $(ICONV_DEPENDS) \
30 +AUDIO_SUPPORT:alsa-lib \
31 +BUILD_PATENTED:libmad +libvorbisidec +libflac
32 TITLE:=C* Music Player
33 URL:=http://cmus.sourceforge.net/
34 endef
35
36 define Package/cmus/description
37 C* Music Player is a modular and very configurable ncurses-based
38 audio player. It has some interesting features like configurable
39 colorscheme, mp3 and ogg streaming, it can be controlled with an
40 UNIX socket, filters, album/artists sorting and a vi-like
41 configuration interface.
42 endef
43
44 define Build/Configure
45 # this is *NOT* GNU configure
46 ( cd $(PKG_BUILD_DIR); \
47 CROSS="$(TARGET_CROSS)" \
48 CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -I$(ICONV_PREFIX)/include" \
49 LDFLAGS="$(TARGET_LDFLAGS) -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -L$(ICONV_PREFIX)/lib" \
50 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
51 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig" \
52 ./configure \
53 prefix="/usr" \
54 CONFIG_FLAC=a \
55 CONFIG_MAD=$(if $(CONFIG_BUILD_PATENTED),a,n) \
56 CONFIG_MODPLUG=n \
57 CONFIG_MIKMOD=n \
58 CONFIG_MPC=n \
59 CONFIG_VORBIS=a \
60 CONFIG_TREMOR=y \
61 CONFIG_WAVPACK=n \
62 CONFIG_MP4=n \
63 CONFIG_AAC=n \
64 CONFIG_FFMPEG=n \
65 CONFIG_ROAR=n \
66 CONFIG_PULSE=n \
67 CONFIG_ALSA=$(if $(CONFIG_AUDIO_SUPPORT),a,n) \
68 CONFIG_AO=n \
69 CONFIG_ARTS=n \
70 CONFIG_OSS=y \
71 CONFIG_SUN=n \
72 CONFIG_WAVEOUT=n \
73 DEBUG=0 \
74 )
75 endef
76
77 define Build/Compile
78 $(MAKE) -C $(PKG_BUILD_DIR) \
79 DESTDIR="$(PKG_INSTALL_DIR)" \
80 V=$(V) \
81 install
82 endef
83
84 define Package/cmus/install
85 $(INSTALL_DIR) $(1)/usr/bin
86 $(INSTALL_DIR) $(1)/usr/lib/cmus/ip
87 $(INSTALL_DIR) $(1)/usr/lib/cmus/op
88 $(INSTALL_DIR) $(1)/usr/share/cmus
89 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cmus $(1)/usr/bin/
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmus/ip/*.so $(1)/usr/lib/cmus/ip/
91 $(CP) $(PKG_INSTALL_DIR)/usr/lib/cmus/op/*.so $(1)/usr/lib/cmus/op/
92 $(CP) $(PKG_INSTALL_DIR)/usr/share/cmus/{rc,default.theme} $(1)/usr/share/cmus/
93 endef
94
95 $(eval $(call BuildPackage,cmus))
96