* New upstream version 1.9.9-1414+git20221121.dbe69eb
* Enable -DOPUS and add build-dep on libopus-dev and libopusfile-dev
tony mancill authored 1 year, 4 months ago
Debian Janitor committed 1 year, 4 months ago
4 | 4 | EXECUTABLE ?= squeezelite |
5 | 5 | |
6 | 6 | # passing one or more of these in $(OPTS) enables optional feature inclusion |
7 | OPT_DSD = -DDSD | |
8 | OPT_FF = -DFFMPEG | |
9 | OPT_ALAC = -DALAC | |
10 | OPT_LINKALL = -DLINKALL | |
11 | OPT_RESAMPLE= -DRESAMPLE | |
12 | OPT_VIS = -DVISEXPORT | |
13 | OPT_IR = -DIR | |
14 | OPT_GPIO = -DGPIO | |
15 | OPT_RPI = -DRPI | |
16 | OPT_NO_FAAD = -DNO_FAAD | |
17 | OPT_SSL = -DUSE_SSL | |
18 | OPT_NOSSLSYM= -DNO_SSLSYM | |
19 | OPT_OPUS = -DOPUS | |
20 | OPT_PORTAUDIO = -DPORTAUDIO | |
7 | OPT_DSD = -DDSD | |
8 | OPT_FF = -DFFMPEG | |
9 | OPT_ALAC = -DALAC | |
10 | OPT_LINKALL = -DLINKALL | |
11 | OPT_RESAMPLE = -DRESAMPLE | |
12 | OPT_VIS = -DVISEXPORT | |
13 | OPT_IR = -DIR | |
14 | OPT_GPIO = -DGPIO | |
15 | OPT_RPI = -DRPI | |
16 | OPT_NO_FAAD = -DNO_FAAD | |
17 | OPT_NO_MAD = -DNO_MAD | |
18 | OPT_NO_MPG123 = -DNO_MPG123 | |
19 | OPT_SSL = -DUSE_SSL | |
20 | OPT_NOSSLSYM = -DNO_SSLSYM | |
21 | OPT_OPUS = -DOPUS | |
22 | OPT_PORTAUDIO = -DPORTAUDIO | |
21 | 23 | OPT_PULSEAUDIO = -DPULSEAUDIO |
22 | 24 | |
23 | 25 | SOURCES = \ |
24 | 26 | main.c slimproto.c buffer.c stream.c utils.c \ |
25 | 27 | output.c output_alsa.c output_pa.c output_stdout.c output_pack.c output_pulse.c decode.c \ |
26 | flac.c pcm.c mad.c vorbis.c mpg.c | |
28 | flac.c pcm.c vorbis.c | |
27 | 29 | |
28 | 30 | SOURCES_DSD = dsd.c dop.c dsd2pcm/dsd2pcm.c |
29 | 31 | SOURCES_FF = ffmpeg.c |
36 | 38 | SOURCES_FAAD = faad.c |
37 | 39 | SOURCES_SSL = sslsym.c |
38 | 40 | SOURCES_OPUS = opus.c |
41 | SOURCES_MAD = mad.c | |
42 | SOURCES_MPG123 = mpg.c | |
39 | 43 | |
40 | 44 | LINK_LINUX = -ldl |
41 | 45 | LINK_ALSA = -lasound |
44 | 48 | LINK_SSL = -lssl -lcrypto |
45 | 49 | LINK_ALAC = -lalac |
46 | 50 | |
47 | LINKALL = -lmad -lmpg123 -lFLAC -lvorbisfile -lvorbis -logg | |
51 | LINKALL = -lFLAC -lvorbisfile -lvorbis -logg | |
48 | 52 | LINKALL_FF = -lavformat -lavcodec -lavutil |
49 | 53 | LINKALL_RESAMPLE = -lsoxr |
50 | 54 | LINKALL_IR = -llirc_client |
51 | 55 | LINKALL_FAAD = -lfaad |
52 | 56 | LINKALL_OPUS = -lopusfile -lopus |
57 | LINKALL_MAD = -lmad | |
58 | LINKALL_MPG123 = -lmpg123 | |
53 | 59 | |
54 | 60 | DEPS = squeezelite.h slimproto.h |
55 | 61 | |
97 | 103 | ifneq (,$(findstring $(OPT_SSL), $(OPTS))) |
98 | 104 | SOURCES += $(SOURCES_SSL) |
99 | 105 | endif |
106 | ifeq (,$(findstring $(OPT_NO_MAD), $(OPTS))) | |
107 | SOURCES += $(SOURCES_MAD) | |
108 | endif | |
109 | ifeq (,$(findstring $(OPT_NO_MPG123), $(OPTS))) | |
110 | SOURCES += $(SOURCES_MPG123) | |
111 | endif | |
100 | 112 | |
101 | 113 | # add optional link options |
102 | 114 | ifneq (,$(findstring $(OPT_LINKALL), $(OPTS))) |
118 | 130 | endif |
119 | 131 | ifneq (,$(findstring $(OPT_SSL), $(OPTS))) |
120 | 132 | LDADD += $(LINK_SSL) |
133 | endif | |
134 | ifeq (,$(findstring $(OPT_NO_MAD), $(OPTS))) | |
135 | LDADD += $(LINKALL_MAD) | |
136 | endif | |
137 | ifeq (,$(findstring $(OPT_NO_MPG123), $(OPTS))) | |
138 | LDADD += $(LINKALL_MPG123) | |
121 | 139 | endif |
122 | 140 | else |
123 | 141 | # if not LINKALL and linux add LINK_LINUX |
0 | 0 | # Contributor: Carl Chave <online@chave.us> |
1 | 1 | # Maintainer: Ralph Irving <ralph.irving@gmail.com> |
2 | 2 | pkgname=squeezelite |
3 | pkgver=1.9.7.1273 | |
4 | pkgrel=1 | |
3 | pkgver=1.9.9.1401 | |
4 | pkgrel=0 | |
5 | 5 | pkgdesc="Lightweight headless squeezebox player for Logitech Media Server" |
6 | 6 | url="https://github.com/ralph-irving/squeezelite" |
7 | 7 | arch="all" |
8 | 8 | license="GPL-3.0-or-later3" |
9 | 9 | options="!check" # No test suite |
10 | depends="flac alsa-lib faad2 mpg123 libvorbis libmad soxr openssl opusfile libalac" | |
11 | makedepends="flac-dev alsa-lib-dev faad2-dev mpg123-dev libvorbis-dev libmad-dev soxr-dev openssl-dev opusfile-dev opus-dev libalac-dev" | |
10 | depends="flac alsa-lib faad2-libs mpg123-libs libvorbis libmad soxr openssl opusfile libalac lirc" | |
11 | makedepends="flac-dev alsa-lib-dev faad2-dev mpg123-dev libvorbis-dev libmad-dev soxr-dev openssl-dev opusfile-dev opus-dev libalac-dev lirc-dev" | |
12 | 12 | install="$pkgname.pre-install" |
13 | 13 | subpackages="$pkgname-doc $pkgname-openrc" |
14 | 14 | source="$pkgname-$pkgver.zip::https://github.com/ralph-irving/squeezelite/archive/master.zip load-libtremor-first.patch $pkgname.confd $pkgname.initd" |
16 | 16 | |
17 | 17 | build() { |
18 | 18 | cd "$builddir" |
19 | make OPTS="-DRESAMPLE -DDSD -DGPIO -DVISEXPORT -DUSE_SSL -DNO_SSLSYM -DOPUS -DALAC -I/usr/include/opus -I/usr/include/alac" | |
19 | make OPTS="-DRESAMPLE -DDSD -DGPIO -DVISEXPORT -DUSE_SSL -DNO_SSLSYM -DOPUS -DALAC -DIR -I/usr/include/opus -I/usr/include/alac" | |
20 | 20 | gcc -Os -fomit-frame-pointer -fcommon -s -o find_servers tools/find_servers.c |
21 | 21 | gcc -Os -fomit-frame-pointer -fcommon -s -o alsacap tools/alsacap.c -lasound |
22 | 22 | } |
44 | 44 | install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/COPYING |
45 | 45 | } |
46 | 46 | |
47 | sha512sums="e72b13714476170108844b84c0043dc06d2ff2e8c9b651a7ad1571d148fc5567aca48048646d16fb82630d6972a31b9328f04e522972b297d1cf8e804785867f fix-arm-segfault.patch | |
47 | sha512sums="271d4c5184c7f48ac79c8f8f9f3bc39f7f970b4d98acda792e40450b687f211094b4dcaea23e034d4deb7ea78713b95e691db9c09fbf31b1be59b6d525ef11a8 fix-arm-segfault.patch | |
48 | 48 | 093379f79b5dc9f5b8aa45826d61738b088d78305a7d514df33851ae34d02ee9034a8ecddf2558fcb1bf4daaf64c620ea4411521908cfc748e31fd0a2d50bbf7 alac-version.patch" |
0 | squeezelite (1.9.9-1414+git20221121.dbe69eb-1) unstable; urgency=medium | |
1 | ||
2 | * New upstream version 1.9.9-1414+git20221121.dbe69eb | |
3 | * Enable -DOPUS and add build-dep on libopus-dev and libopusfile-dev | |
4 | ||
5 | -- tony mancill <tmancill@debian.org> Sat, 10 Dec 2022 16:19:57 -0800 | |
6 | ||
0 | 7 | squeezelite (1.9.9-1395+git20220104.874e4f9-1) unstable; urgency=medium |
1 | 8 | |
2 | 9 | * New upstream version 1.9.9-1395+git20220104.874e4f9 |
11 | 11 | liblircclient-dev, |
12 | 12 | libmad0-dev, |
13 | 13 | libmpg123-dev, |
14 | libopus-dev, | |
15 | libopusfile-dev, | |
14 | 16 | libpulse-dev, |
15 | 17 | libsoxr-dev, |
16 | 18 | libssl-dev, |
3 | 3 | # Uncomment this to turn on verbose mode. |
4 | 4 | #export DH_VERBOSE=1 |
5 | 5 | |
6 | # Enable ffmpeg, soxr resampling, visualisation export and disable dlopening | |
7 | # libraries | |
8 | export OPTS := -DDSD -DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL -DIR -DUSE_SSL | |
6 | # Enable ffmpeg, sox resampling, visualisation export, opus, | |
7 | # and disable dlopening libraries | |
8 | export OPTS := -DDSD -DFFMPEG -DRESAMPLE -DVISEXPORT -DLINKALL -DIR -DUSE_SSL -DOPUS -I/usr/include/opus | |
9 | 9 | |
10 | 10 | # Enable all hardening build flags |
11 | 11 | export DEB_BUILD_MAINT_OPTIONS := hardening=+all |
0 | 0 | version=4 |
1 | 1 | # debian/watch |
2 | # Disabled because upstream does not want to apply tags. See requests: | |
2 | # Upstream does not apply tags. See requests: | |
3 | 3 | # - https://github.com/ralph-irving/squeezelite/issues/29 |
4 | 4 | # - https://github.com/ralph-irving/squeezelite/issues/55 |
5 | 5 | # - https://github.com/ralph-irving/squeezelite/issues/63 |
8 | 8 | # Upstream repo: |
9 | 9 | # https://github.com/ralph-irving/squeezelite |
10 | 10 | # |
11 | # The orig.tar.gz is created using `git archive` - for example: | |
12 | # git archive --format=tgz --prefix=squeezelite-1.9+git2021216.e02fa87/ --output=../squeezelite_1.9+git20201216.e02fa87.orig.tar.gz e02fa87128debc65e26c582f1a017a20a53d1bcf | |
11 | # The orig.tar.gz is created using `git archive` against the upstream repo - for example: | |
12 | # git archive --format=tgz --prefix=squeezelite-1.9.9-1414+git20221121.dbe69eb/ --output=../squeezelite_1.9.9-1414+git20221121.dbe69eb.orig.tar.gz dbe69eb8aa88f644cfb46541d6cef72fa666570d | |
13 | # | |
14 | # the major, minor, and micro versions are taken from https://github.com/ralph-irving/squeezelite/blob/master/squeezelite.h | |
15 | ||
16 | opts="mode=git,pgpmode=none,pretty=1.9.9-xxxx+git%cd.%h" \ | |
17 | https://github.com/ralph-irving/squeezelite heads/master debian |
182 | 182 | if (!strstr(exclude_codecs, "pcm") && (!include_codecs || (order_codecs = strstr(include_codecs, "pcm")))) |
183 | 183 | sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_pcm()); |
184 | 184 | |
185 | #if !defined(NO_MAD) && !defined(NO_MPG123) | |
185 | 186 | // try mad then mpg for mp3 unless command line option passed |
186 | 187 | if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mad")) && |
187 | 188 | (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mad")))) |
189 | 190 | else if (!(strstr(exclude_codecs, "mp3") || strstr(exclude_codecs, "mpg")) && |
190 | 191 | (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")) || (order_codecs = strstr(include_codecs, "mpg")))) |
191 | 192 | sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg()); |
193 | #elif !defined(NO_MAD) | |
194 | if (!strstr(exclude_codecs, "mp3") && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")))) | |
195 | sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mad()); | |
196 | #elif !defined(NO_MPG123) | |
197 | if (!strstr(exclude_codecs, "mp3") && (!include_codecs || (order_codecs = strstr(include_codecs, "mp3")))) | |
198 | sort_codecs((include_codecs ? order_codecs - include_codecs : i), register_mpg()); | |
199 | #endif | |
192 | 200 | |
193 | 201 | LOG_DEBUG("include codecs: %s exclude codecs: %s", include_codecs ? include_codecs : "", exclude_codecs); |
194 | 202 |
751 | 751 | |
752 | 752 | static struct codec ret = { |
753 | 753 | 'w', // id |
754 | "wma,wmap", // types | |
754 | "wma,wmap,wmal", // types | |
755 | 755 | READ_SIZE, // min read |
756 | 756 | WRITE_SIZE, // min space |
757 | 757 | ff_open_wma, // open |
759 | 759 | ff_decode, // decode |
760 | 760 | }; |
761 | 761 | |
762 | LOG_INFO("using ffmpeg to decode wma,wmap"); | |
762 | LOG_INFO("using ffmpeg to decode wma,wmap,wmal"); | |
763 | 763 | return &ret; |
764 | 764 | } |
765 | 765 |
281 | 281 | |
282 | 282 | static bool load_flac() { |
283 | 283 | #if !LINKALL |
284 | void *handle = dlopen(LIBFLAC, RTLD_NOW); | |
284 | void *handle = NULL; | |
285 | char name[30]; | |
285 | 286 | char *err; |
287 | ||
288 | sprintf(name, LIBFLAC, FLAC_API_VERSION_CURRENT < 12 ? 8 : 12); | |
289 | ||
290 | handle = dlopen(name, RTLD_NOW); | |
286 | 291 | |
287 | 292 | if (!handle) { |
288 | 293 | LOG_INFO("dlerror: %s", dlerror()); |
304 | 309 | return false; |
305 | 310 | } |
306 | 311 | |
307 | LOG_INFO("loaded "LIBFLAC); | |
312 | LOG_INFO("loaded %s", name); | |
308 | 313 | #endif |
309 | 314 | |
310 | 315 | return true; |
27 | 27 | |
28 | 28 | #define TITLE "Squeezelite " VERSION ", Copyright 2012-2015 Adrian Smith, 2015-2021 Ralph Irving." |
29 | 29 | |
30 | #define CODECS_BASE "flac,pcm,mp3,ogg" | |
30 | #define CODECS_BASE "flac,pcm,ogg" | |
31 | 31 | #if NO_FAAD |
32 | 32 | #define CODECS_AAC "" |
33 | 33 | #else |
50 | 50 | #else |
51 | 51 | #define CODECS_DSD "" |
52 | 52 | #endif |
53 | #define CODECS_MP3 " (mad,mpg for specific mp3 codec)" | |
53 | #if !defined(NO_MAD) && !defined(NO_MPG123) | |
54 | #define CODECS_MP3 ",mp3 (mad,mpg for specific mp3 codec)" | |
55 | #elif defined(NO_MAD) && defined(NO_MPG123) | |
56 | #define CODECS_MP3 "" | |
57 | #else | |
58 | #define CODECS_MP3 ",mp3" | |
59 | #endif | |
54 | 60 | |
55 | 61 | #define CODECS CODECS_BASE CODECS_AAC CODECS_FF CODECS_OPUS CODECS_DSD CODECS_MP3 |
56 | 62 | |
219 | 225 | #endif |
220 | 226 | #if NO_SSLSYM |
221 | 227 | " NO_SSLSYM" |
228 | #endif | |
229 | #if NO_MPG123 | |
230 | " NO_MPG123" | |
231 | #endif | |
232 | #if NO_MAD | |
233 | " NO_MAD" | |
222 | 234 | #endif |
223 | 235 | #if LINKALL |
224 | 236 | " LINKALL" |
44 | 44 | |
45 | 45 | struct opus { |
46 | 46 | struct OggOpusFile *of; |
47 | bool end; | |
47 | 48 | #if FRAME_BUF |
48 | 49 | u8_t *write_buf; |
49 | 50 | #endif |
118 | 119 | |
119 | 120 | LOCK_S; |
120 | 121 | |
121 | if (stream.state <= DISCONNECT && !_buf_used(streambuf)) { | |
122 | if (stream.state <= DISCONNECT && u->end) { | |
122 | 123 | UNLOCK_S; |
123 | 124 | return DECODE_COMPLETE; |
124 | 125 | } |
170 | 171 | frames = process.max_in_frames; |
171 | 172 | write_buf = process.inbuf; |
172 | 173 | ); |
174 | ||
175 | u->end = frames == 0; | |
173 | 176 | |
174 | 177 | // write the decoded frames into outputbuf then unpack them (they are 16 bits) |
175 | 178 | n = OP(u, read, u->of, (opus_int16*) write_buf, frames * channels, NULL); |
272 | 275 | free(u->write_buf); |
273 | 276 | u->write_buf = NULL; |
274 | 277 | #endif |
278 | u->end = false; | |
275 | 279 | } |
276 | 280 | |
277 | 281 | static bool load_opus(void) { |
25 | 25 | |
26 | 26 | #define MAJOR_VERSION "1.9" |
27 | 27 | #define MINOR_VERSION "9" |
28 | #define MICRO_VERSION "1395" | |
28 | #define MICRO_VERSION "1414" | |
29 | 29 | |
30 | 30 | #if defined(CUSTOM_VERSION) |
31 | 31 | #define VERSION "v" MAJOR_VERSION "." MINOR_VERSION "-" MICRO_VERSION STR(CUSTOM_VERSION) |
189 | 189 | // dynamically loaded libraries at run time |
190 | 190 | |
191 | 191 | #if LINUX |
192 | #define LIBFLAC "libFLAC.so.8" | |
192 | #define LIBFLAC "libFLAC.so.%d" | |
193 | 193 | #define LIBMAD "libmad.so.0" |
194 | 194 | #define LIBMPG "libmpg123.so.0" |
195 | 195 | #define LIBVORBIS "libvorbisfile.so.3" |
204 | 204 | #endif |
205 | 205 | |
206 | 206 | #if OSX |
207 | #define LIBFLAC "libFLAC.8.dylib" | |
207 | #define LIBFLAC "libFLAC.%d.dylib" | |
208 | 208 | #define LIBMAD "libmad.0.dylib" |
209 | 209 | #define LIBMPG "libmpg123.0.dylib" |
210 | 210 | #define LIBVORBIS "libvorbisfile.3.dylib" |
232 | 232 | #endif |
233 | 233 | |
234 | 234 | #if FREEBSD |
235 | #define LIBFLAC "libFLAC.so.8" | |
235 | #define LIBFLAC "libFLAC.so.%d" | |
236 | 236 | #define LIBMAD "libmad.so.0" |
237 | 237 | #define LIBMPG "libmpg123.so.0" |
238 | 238 | #define LIBVORBIS "libvorbisfile.so.3" |
50 | 50 | struct streamstate stream; |
51 | 51 | |
52 | 52 | #if USE_SSL |
53 | #if WIN | |
54 | #define _last_error() WSAGetLastError() | |
55 | #define ERROR_WOULDBLOCK WSAEWOULDBLOCK | |
56 | #else | |
53 | 57 | #define _last_error() ERROR_WOULDBLOCK |
54 | ||
58 | #endif | |
55 | 59 | static SSL_CTX *SSLctx; |
56 | 60 | SSL *ssl; |
57 | 61 | |
392 | 396 | // stream body into streambuf |
393 | 397 | } else { |
394 | 398 | int n; |
399 | int error; | |
395 | 400 | |
396 | 401 | space = min(_buf_space(streambuf), _buf_cont_write(streambuf)); |
397 | 402 | if (stream.meta_interval) { |
403 | 408 | LOG_INFO("end of stream (%u bytes)", stream.bytes); |
404 | 409 | _disconnect(DISCONNECT, DISCONNECT_OK); |
405 | 410 | } |
406 | if (n < 0 && _last_error() != ERROR_WOULDBLOCK) { | |
407 | LOG_INFO("error reading: %s", strerror(last_error())); | |
408 | _disconnect(DISCONNECT, REMOTE_DISCONNECT); | |
411 | if (n < 0) { | |
412 | error = _last_error(); | |
413 | if (error != ERROR_WOULDBLOCK) { | |
414 | LOG_INFO("error reading: %s (%d)", strerror(error), error); | |
415 | _disconnect(DISCONNECT, REMOTE_DISCONNECT); | |
416 | } | |
409 | 417 | } |
410 | 418 | |
411 | 419 | if (n > 0) { |
53 | 53 | |
54 | 54 | struct vorbis { |
55 | 55 | OggVorbis_File *vf; |
56 | bool opened; | |
56 | bool opened, end; | |
57 | 57 | #if FRAME_BUF |
58 | 58 | u8_t *write_buf; |
59 | 59 | #endif |
139 | 139 | |
140 | 140 | LOCK_S; |
141 | 141 | |
142 | if (stream.state <= DISCONNECT && !_buf_used(streambuf)) { | |
142 | if (stream.state <= DISCONNECT && v->end) { | |
143 | 143 | UNLOCK_S; |
144 | 144 | return DECODE_COMPLETE; |
145 | 145 | } |
203 | 203 | ); |
204 | 204 | |
205 | 205 | bytes = frames * 2 * channels; // samples returned are 16 bits |
206 | v->end = frames == 0; | |
206 | 207 | |
207 | 208 | // write the decoded frames into outputbuf even though they are 16 bits per sample, then unpack them |
208 | 209 | #ifdef TREMOR_ONLY |
310 | 311 | v->opened = false; |
311 | 312 | } |
312 | 313 | } |
314 | v->end = false; | |
313 | 315 | } |
314 | 316 | |
315 | 317 | static void vorbis_close(void) { |