Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(main/predict): prevent opportunistic inclusion of asoundlib.h #22049

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/predict/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="A Satellite Tracking/Orbital Prediction Program"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.3.1
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://www.qsl.net/kd2bd/predict-${TERMUX_PKG_VERSION}-termux.tar.gz
TERMUX_PKG_SHA256=6eecccb21117e6ae57941659ac5d1d5f8cf99103ec8448e4fd8c076620bbd77b
TERMUX_PKG_DEPENDS="ncurses, ncurses-ui-libs,play-audio,wget"
Expand Down
26 changes: 26 additions & 0 deletions packages/predict/disable-alsa.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
I don't think that the upstream developer should copy and paste this patch
directly into their code if they see it. I think they should move around some
of their code blocks in a different way in order to make future release archives
not have this problem, but writing the patch for the current version of this
package with only 2 lines of changes keeps the patch file small.

--- a/predict.c
+++ b/predict.c
@@ -38,7 +38,7 @@
#include "predict.h"

#if defined __has_include
- #if __has_include(<alsa/asoundlib.h>)
+ #if __has_include(<alsa/asoundlib.h>) && !defined(__ANDROID__)
#include <alsa/asoundlib.h>
#elif defined (__ANDROID__)
char wavestring[1024];
@@ -269,7 +269,7 @@ tle_t tle;
/* "Vocalizer" functions for Linux/Unix */

#if defined __has_include
- #if __has_include(<alsa/asoundlib.h>)
+ #if __has_include(<alsa/asoundlib.h>) && !defined(__ANDROID__)

unsigned long buffer2long(int indx)
{