c176f01039c7110fed8d895ef15a951f4cf31576
[feed/packages.git] / sound / shairport-sync / Makefile
1 #
2 # This is free software, licensed under the GNU General Public License v2.
3 # See /LICENSE for more information.
4 # updated to work with latest source from abrasive
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=shairport-sync
10 PKG_VERSION:=4.3.2
11 PKG_RELEASE:=4
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=https://codeload.github.com/mikebrady/shairport-sync/tar.gz/$(PKG_VERSION)?
15 PKG_HASH:=dfb485c0603398032a00e51f84b874749bbf155b257adda3d270d5989de08bfd
16
17 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>, \
18 Mike Brady <mikebrady@eircom.net>
19 PKG_LICENSE:=MIT
20 PKG_LICENSE_FILES:=COPYING LICENSES shairport.c
21
22 PKG_FIXUP:=autoreconf
23 PKG_INSTALL:=1
24 PKG_BUILD_PARALLEL:=1
25
26 include $(INCLUDE_DIR)/package.mk
27
28 define Package/shairport-sync/default
29 SECTION:=sound
30 CATEGORY:=Sound
31 TITLE:=AirPlay compatible audio player
32 DEPENDS:=@AUDIO_SUPPORT +libpthread +alsa-lib +libconfig +libdaemon +libpopt +libplist +libsodium +libgcrypt +libffmpeg-full +libuuid +nqptp
33 PROVIDES:=shairport-sync
34 URL:=https://github.com/mikebrady/shairport-sync
35 endef
36
37 define Package/shairport-sync-openssl
38 $(Package/shairport-sync/default)
39 TITLE+= (openssl)
40 DEPENDS+= +libopenssl +libavahi-client +libsoxr
41 VARIANT:=openssl
42 endef
43
44 define Package/shairport-sync-mbedtls
45 $(Package/shairport-sync/default)
46 TITLE+= (mbed TLS)
47 DEPENDS+= +libmbedtls +libavahi-client +libsoxr
48 VARIANT:=mbedtls
49 DEFAULT_VARIANT:=1
50 endef
51
52 define Package/shairport-sync-mini
53 $(Package/shairport-sync/default)
54 TITLE+= (minimal)
55 DEPENDS+= +libmbedtls
56 VARIANT:=mini
57 endef
58
59 define Package/shairport-sync/default/description
60 Shairport Sync plays audio from iTunes and AirPlay sources, including
61 iOS devices, Quicktime Player and third party sources such as forkedDaapd.
62 Audio played by a Shairport Sync-powered device stays synchronised with the source
63 and hence with similar devices playing the same source.
64
65 Shairport Sync does not support AirPlay video or photo streaming.
66 Ensure Kernel Modules > Sound Support > kmod-sound-core is selected.
67 Also select kmod-usb-audio if you want to use USB-connected sound cards.
68 endef
69 Package/shairport-sync-openssl/description = $(Package/shairport-sync/default/description)
70 Package/shairport-sync-mbedtls/description = $(Package/shairport-sync/default/description)
71
72 define Package/shairport-sync-mini/description
73 $(Package/shairport-sync/default/description)
74
75 Minimal version uses mbed TLS and does not include libsoxr and avahi support.
76 endef
77
78 CONFIGURE_ARGS += \
79 --with-alsa \
80 --with-libdaemon \
81 --with-airplay-2 \
82 --with-pipe \
83 --with-metadata
84
85 ifeq ($(BUILD_VARIANT),openssl)
86 CONFIGURE_ARGS+= --with-ssl=openssl
87 endif
88
89 ifeq ($(BUILD_VARIANT),mbedtls)
90 CONFIGURE_ARGS+= --with-ssl=mbedtls
91 endif
92
93 ifeq ($(BUILD_VARIANT),mini)
94 CONFIGURE_ARGS+= --with-ssl=mbedtls --with-tinysvcmdns
95 else
96 CONFIGURE_ARGS+= --with-avahi --with-soxr
97 endif
98
99 TARGET_LDFLAGS += -Wl,--as-needed
100
101 define Package/shairport-sync/default/conffiles
102 /etc/config/shairport-sync
103 /etc/shairport-sync.conf
104 endef
105
106 Package/shairport-sync-openssl/conffiles = $(Package/shairport-sync/default/conffiles)
107 Package/shairport-sync-mbedtls/conffiles = $(Package/shairport-sync/default/conffiles)
108 Package/shairport-sync-mini/conffiles = $(Package/shairport-sync/default/conffiles)
109
110 define Package/shairport-sync/default/install
111 $(INSTALL_DIR) $(1)/usr/bin
112 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/shairport-sync $(1)/usr/bin/
113 $(INSTALL_DIR) $(1)/etc
114 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/shairport-sync.conf $(1)/etc/shairport-sync.conf
115 $(INSTALL_DIR) $(1)/etc/init.d
116 $(INSTALL_BIN) ./files/shairport-sync.init $(1)/etc/init.d/shairport-sync
117 $(INSTALL_DIR) $(1)/etc/config
118 $(INSTALL_CONF) ./files/shairport-sync.config $(1)/etc/config/shairport-sync
119 endef
120
121 Package/shairport-sync-openssl/install = $(Package/shairport-sync/default/install)
122 Package/shairport-sync-mbedtls/install = $(Package/shairport-sync/default/install)
123 Package/shairport-sync-mini/install = $(Package/shairport-sync/default/install)
124
125 $(eval $(call BuildPackage,shairport-sync-openssl))
126 $(eval $(call BuildPackage,shairport-sync-mbedtls))
127 $(eval $(call BuildPackage,shairport-sync-mini))