diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index e6bc1a73..47c4223e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 - name: Install build tools - run: brew install automake autoconf libtool pkg-config + run: brew install automake autoconf libtool pkg-config gettext - name: Install gperf, bison and flex # macOS has ancient versions of bison and flex, so we need a newer from @@ -58,6 +58,7 @@ jobs: # We configure a non-privileged setup, since how to add a "owntone" system # user in macOS isn't clear to me (useradd etc. isn't available) run: | + export ACLOCAL_PATH="$(brew --prefix)/share/gettext/m4:$ACLOCAL_PATH" export CFLAGS="-I$(brew --prefix)/include -I$(brew --prefix sqlite)/include" export LDFLAGS="-L$(brew --prefix)/lib -L$(brew --prefix sqlite)/lib" autoreconf -fi diff --git a/.github/workflows/macos_12.yml b/.github/workflows/macos_12.yml index b2e9ee8b..d96c51c7 100644 --- a/.github/workflows/macos_12.yml +++ b/.github/workflows/macos_12.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - name: Install build tools - run: brew install automake autoconf libtool pkg-config + run: brew install automake autoconf libtool pkg-config gettext - name: Install gperf, bison and flex # macOS has ancient versions of bison and flex, so we need a newer from diff --git a/src/inputs/librespot-c/configure.ac b/src/inputs/librespot-c/configure.ac index 9925515b..1ced5f35 100644 --- a/src/inputs/librespot-c/configure.ac +++ b/src/inputs/librespot-c/configure.ac @@ -3,6 +3,9 @@ AC_CONFIG_AUX_DIR([.]) AM_INIT_AUTOMAKE([foreign subdir-objects]) AM_SILENT_RULES([yes]) +dnl Defines _GNU_SOURCE globally when needed +AC_USE_SYSTEM_EXTENSIONS + AC_PROG_CC AM_PROG_AR AC_PROG_RANLIB diff --git a/src/inputs/librespot-c/src/channel.c b/src/inputs/librespot-c/src/channel.c index 659fe61d..ca0e0b3c 100644 --- a/src/inputs/librespot-c/src/channel.c +++ b/src/inputs/librespot-c/src/channel.c @@ -123,10 +123,10 @@ channel_new(struct sp_channel **new_channel, struct sp_session *session, const c if (ret < 0) goto error; - if (fcntl(channel->audio_fd[0], F_SETFL, O_CLOEXEC | O_NONBLOCK) < 0) + if (fcntl(channel->audio_fd[0], F_SETFL, FD_CLOEXEC | O_NONBLOCK) < 0) goto error; - if (fcntl(channel->audio_fd[1], F_SETFL, O_CLOEXEC | O_NONBLOCK) < 0) + if (fcntl(channel->audio_fd[1], F_SETFL, FD_CLOEXEC | O_NONBLOCK) < 0) goto error; channel->audio_write_ev = event_new(evbase, channel->audio_fd[1], EV_WRITE, write_cb, session); diff --git a/src/inputs/librespot-c/src/connection.c b/src/inputs/librespot-c/src/connection.c index f4afa54c..38feee7d 100644 --- a/src/inputs/librespot-c/src/connection.c +++ b/src/inputs/librespot-c/src/connection.c @@ -1,5 +1,3 @@ -#define _GNU_SOURCE // For asprintf and vasprintf - #include #include #include diff --git a/src/inputs/librespot-c/src/http.c b/src/inputs/librespot-c/src/http.c index 39bae6e7..a9b155ef 100644 --- a/src/inputs/librespot-c/src/http.c +++ b/src/inputs/librespot-c/src/http.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE // For asprintf and vasprintf #include #include #include diff --git a/src/outputs/airplay.c b/src/outputs/airplay.c index bc2bacde..3463ca31 100644 --- a/src/outputs/airplay.c +++ b/src/outputs/airplay.c @@ -861,6 +861,7 @@ request_headers_add(struct evrtsp_request *req, struct airplay_session *rs, enum { char buf[64]; const char *user_agent; + const char *client_name; const char *method; const char *url; int ret; @@ -873,6 +874,9 @@ request_headers_add(struct evrtsp_request *req, struct airplay_session *rs, enum user_agent = cfg_getstr(cfg_getsec(cfg, "general"), "user_agent"); evrtsp_add_header(req->output_headers, "User-Agent", user_agent); + client_name = cfg_getstr(cfg_getsec(cfg, "library"), "name"); + evrtsp_add_header(req->output_headers, "X-Apple-Client-Name", client_name); + // If we have a realm + nonce it means that the device told us in the reply to // SETUP that www authentication with password is required if (rs->realm && rs->nonce) @@ -2640,6 +2644,12 @@ static int payload_make_pin_start(struct evrtsp_request *req, struct airplay_session *rs, void *arg) { DPRINTF(E_LOG, L_AIRPLAY, "Starting device pairing for '%s', go to the web interface and enter PIN\n", rs->devname); + + if (rs->pair_type == PAIR_CLIENT_HOMEKIT_NORMAL) + evrtsp_add_header(req->output_headers, "X-Apple-HKP", "3"); + else if (rs->pair_type == PAIR_CLIENT_HOMEKIT_TRANSIENT) + evrtsp_add_header(req->output_headers, "X-Apple-HKP", "4"); + return 0; } diff --git a/src/outputs/raop.c b/src/outputs/raop.c index a4b8f310..5eeb97bc 100644 --- a/src/outputs/raop.c +++ b/src/outputs/raop.c @@ -1109,6 +1109,7 @@ raop_add_headers(struct raop_session *rs, struct evrtsp_request *req, enum evrts const char *method; const char *url; const char *user_agent; + const char *client_name; int ret; method = evrtsp_method(req_method); @@ -1121,6 +1122,9 @@ raop_add_headers(struct raop_session *rs, struct evrtsp_request *req, enum evrts user_agent = cfg_getstr(cfg_getsec(cfg, "general"), "user_agent"); evrtsp_add_header(req->output_headers, "User-Agent", user_agent); + client_name = cfg_getstr(cfg_getsec(cfg, "library"), "name"); + evrtsp_add_header(req->output_headers, "X-Apple-Client-Name", client_name); + /* Add Authorization header */ url = (req_method == EVRTSP_REQ_OPTIONS) ? "*" : rs->session_url;