Skip to content

Commit

Permalink
fix(main/predict): prevent opportunistic inclusion of asoundlib.h
Browse files Browse the repository at this point in the history
  • Loading branch information
robertkirkman committed Oct 31, 2024
1 parent bfa7794 commit ce71538
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
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)
{

0 comments on commit ce71538

Please sign in to comment.