summaryrefslogtreecommitdiffstats
path: root/sound/squeezelite/Makefile
blob: 8a1274ccfe63da384062447b0370fbc381e4efe8 (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
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=squeezelite
PKG_VERSION:=1.8
PKG_RELEASE=1

PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=LICENSE.txt
PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://code.google.com/p/squeezelite/
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=8b8dfe6918ebe45ade5f3d9b68d453d7b8128d99
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)

PKG_BUILD_DEPENDS:=libflac libvorbis libmad libfaad2 SQUEEZELITE_WMA:libffmpeg-audio-dec

include $(INCLUDE_DIR)/package.mk

define Package/squeezelite/default
    SECTION:=sound
    CATEGORY:=Sound
    TITLE:=Headless squeezebox emulator
    PROVIDES:=squeezelite
    URL:=https://code.google.com/p/squeezelite/
    DEPENDS:= +alsa-lib +SQUEEZELITE_RESAMPLE:libsoxr
    MENU:=1
endef

define Package/squeezelite-full
    $(call Package/squeezelite/default)
    TITLE+= (full)
    DEPENDS+= +libflac +libvorbis +libmad +libfaad2 \
              +SQUEEZELITE_WMA:libffmpeg-audio-dec
    VARIANT:=full
endef

define Package/squeezelite-mini
    $(call Package/squeezelite/default)
    TITLE+= (minimal)
    VARIANT:=mini
endef

define Package/squeezelite/config/default

	config SQUEEZELITE_WMA
	    bool "WMA/ALAC decode support"
	    help
		Include WMA and ALAC decoding using ffmpeg
	    default n

	config SQUEEZELITE_RESAMPLE
	    bool "Resample support"
	    help
		Include support for resampling using libsoxr
	    default n

	config SQUEEZELITE_DSD
	    bool "DSD playback over PCM (DoP)"
	    help
		Include support for DSD over PCM for compatible DAC"
	    default n
endef

define Package/squeezelite-full/config
    if PACKAGE_squeezelite-full
	$(call Package/squeezelite/config/default)
    endif
endef

define Package/squeezelite-mini/config
    if PACKAGE_squeezelite-mini
	$(call Package/squeezelite/config/default)
    endif
endef

define Package/squeezelite/description/default
    Squeezelite is a small headless squeezebox emulator for linux using alsa audio output 
    It is aimed at supporting high quality audio at multiple sample rates including 
    44.1/48/88.2/96/176.4/192k/352.8/384kHz 
    Supported codecs: mp3, flac, ogg, aac, (wma and alac via ffmpeg) 
    Native support for PCM builtin
    Optional support of DSD playback via PCM for DoP capable DAC
    Optional resampling to match sound device
endef

define Package/squeezelite/description
    $(call Package/squeezelite/description/default)
    .
    This package has all the audio codecs compiled in.
endef

define Package/squeezelite-mini/description
    $(call Package/squeezelite/description/default)
    .
    This package will dynamically load installed codecs.
endef

#ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
#    PKG_BUILD_DEPENDS+= libffmpeg-audio-dec
#endif

TARGET_CFLAGS+= -Wall -fPIC -O2 -DSELFPIPE

ifeq ($(CONFIG_SQUEEZELITE_WMA),y)
    TARGET_CFLAGS+= -DFFMPEG
endif

ifeq ($(CONFIG_SQUEEZELITE_DSD),y)
    TARGET_CFLAGS+= -DDSD
endif

ifeq ($(CONFIG_SQUEEZELITE_RESAMPLE),y)
    TARGET_CFLAGS+= -DRESAMPLE
endif

TARGET_LDFLAGS+= -lasound -lpthread -lm -lrt

ifeq ($(BUILD_VARIANT),full)
    TARGET_CFLAGS+= -DLINKALL
endif

define Package/squeezelite/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/squeezelite $(1)/usr/bin
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/squeezelite.init $(1)/etc/init.d/squeezelite
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) ./files/squeezelite.conf $(1)/etc/config/squeezelite
endef

Package/squeezelite-mini/install=$(Package/squeezelite/install)
Package/squeezelite-full/install=$(Package/squeezelite/install)

$(eval $(call BuildPackage,squeezelite-mini))
$(eval $(call BuildPackage,squeezelite-full))