-
Notifications
You must be signed in to change notification settings - Fork 1
/
indi-3rdparty.patch
245 lines (225 loc) · 9.95 KB
/
indi-3rdparty.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1ae6e3..d46e241 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,6 +18,11 @@ include_directories( "/usr/local/include")
include_directories("${CMAKE_INSTALL_PREFIX}/include")
endif(APPLE)
+if(ANDROID OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
+ set(ANDROID ON)
+ add_definitions(-DANDROID)
+endif()
+
set(LIBRARIES_FOUND TRUE)
include(CMakeCommon)
@@ -67,7 +72,6 @@ option(WITH_EQMOD "Install EQMod Driver" On)
option(WITH_STARBOOK "Install Starbook Driver" On)
option(WITH_STARBOOK_TEN "Install Starbook Ten Driver" On)
option(WITH_CAUX "Install Celestron AUX Driver" On)
-option(WITH_SX "Install StarLight Xpress Driver" On)
option(WITH_MAXDOME "Install MaxDomeII Driver" On)
option(WITH_NEXDOME "Install NexDome Driver" On)
option(WITH_SPECTRACYBER "Install Spectracyber Driver" On)
@@ -75,41 +79,45 @@ option(WITH_CLOUDWATCHER "Install AAG Cloud Watcher Driver" On)
option(WITH_MI "Install Moravian Driver" On)
option(WITH_FLI "Install FLI Driver" On)
option(WITH_SBIG "Install SBIG Driver" On)
-option(WITH_INOVAPLX "Install i.Nova PLx Driver" On)
option(WITH_APOGEE "Install Apogee Driver" On)
-option(WITH_FFMV "Install Point Grey FireFly MV Driver" On)
option(WITH_QHY "Install QHY Driver" On)
option(WITH_GPHOTO "Install GPhoto Driver" On)
option(WITH_QSI "Install QSI Driver" On)
option(WITH_DUINO "Install Ariduino Driver" On)
option(WITH_FISHCAMP "Install Fishcamp Driver" On)
-option(WITH_GPSD "Install GPSD Driver" On)
-option(WITH_GIGE "Install GiGE machine vision Driver" Off)
option(WITH_DSI "Install Meade DSI Driver" On)
-option(WITH_ASICAM "Install ZWO Optics ASI Driver" On)
-option(WITH_MGEN "Install MGen Autoguider" On)
option(WITH_ASTROMECHFOC "Install Astromechanics Focuser" On)
option(WITH_LIMESDR "Install LIME-SDR Receiver" On)
option(WITH_RADIOSIM "Install RadioSim Receiver" On)
-option(WITH_GPSNMEA "Install GPS NMEA Driver" On)
-option(WITH_RTKLIB "Install RTKLIB Driver" On)
option(WITH_ARMADILLO "Install Armadillo & Platypus Driver" On)
option(WITH_NIGHTSCAPE "Install Nightscape 8300 Driver" On)
-option(WITH_ATIK "Install Atik Driver" On)
-option(WITH_TOUPBASE "Install Toupbase Driver" On)
option(WITH_DREAMFOCUSER "Install DreamFocuser Driver" On)
option(WITH_AVALON "Install Avalon StarGO Driver" On)
option(WITH_BEEFOCUS "Install Bee Focuser Driver" On)
option(WITH_SHELYAK "Install Shelyak Spectrograph Driver" On)
option(WITH_SKYWALKER "Install AOK SkyWalker Mount Driver" On)
option(WITH_TALON6 "Install Talon6 Mount Driver" On)
-option(WITH_PENTAX "Install Pentax Driver" On)
-option(WITH_ASTROLINK4 "Install AstroLink4 Driver" On)
-option(WITH_AHP_XC "Install AHP XC Correlators Driver" On)
option(WITH_ORION_SSG3 "Install Orion StarShoot G3 Driver" On)
-option(WITH_SV305 "Install SVBONY SV305 Camera Driver" On)
option(WITH_BRESSEREXOS2 "Install Bresser Exos 2 GoTo Mount Driver" On)
-option(WITH_PLAYERONE "Install Player One Astronomy's Camera Driver" On)
+
+if(ANDROID)
+ option(WITH_SX "Install StarLight Xpress Driver" Off)
+ option(WITH_INOVAPLX "Install i.Nova PLx Driver" Off)
+ option(WITH_FFMV "Install Point Grey FireFly MV Driver" Off)
+ option(WITH_GIGE "Install GiGE machine vision Driver" Off)
+ option(WITH_GPSD "Install GPSD Driver" Off)
+ option(WITH_ASICAM "Install ZWO Optics ASI Driver" Off)
+ option(WITH_MGEN "Install MGen Autoguider" Off)
+ option(WITH_GPSNMEA "Install GPS NMEA Driver" Off)
+ option(WITH_RTKLIB "Install RTKLIB Driver" Off)
+ option(WITH_TOUPBASE "Install Toupbase Driver" Off)
+ option(WITH_ATIK "Install Atik Driver" Off)
+ option(WITH_PENTAX "Install Pentax Driver" Off)
+ option(WITH_ASTROLINK4 "Install AstroLink4 Driver" Off)
+ option(WITH_AHP_XC "Install AHP XC Correlators Driver" Off)
+ option(WITH_SV305 "Install SVBONY SV305 Camera Driver" Off)
+ option(WITH_PLAYERONE "Install Player One Astronomy's Camera Driver" Off)
+endif(ANDROID)
# FFMPEG required for INDI Webcam driver
find_package(FFmpeg)
diff --git a/cmake_modules/CMakeCommon.cmake b/cmake_modules/CMakeCommon.cmake
index b7be23d..345cd61 100644
--- a/cmake_modules/CMakeCommon.cmake
+++ b/cmake_modules/CMakeCommon.cmake
@@ -47,8 +47,10 @@ IF (UNIX OR APPLE OR ANDROID)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${SEC_COMP_FLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEC_COMP_FLAGS}")
SET(SEC_LINK_FLAGS "")
- IF (NOT APPLE AND NOT CYGWIN)
+ IF (NOT APPLE AND NOT CYGWIN AND NOT ANDROID)
SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,nodump -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
+ ELSEIF(ANDROID)
+ SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed -landroid-wordexp")
ENDIF ()
IF (NOT ANDROID AND NOT APPLE)
SET(SEC_LINK_FLAGS "${SEC_LINK_FLAGS} -pie")
diff --git a/indi-dsi/CMakeLists.txt b/indi-dsi/CMakeLists.txt
index 5924d1d..1c386be 100644
--- a/indi-dsi/CMakeLists.txt
+++ b/indi-dsi/CMakeLists.txt
@@ -7,7 +7,9 @@ include(GNUInstallDirs)
IF(APPLE)
set(FIRMWARE_INSTALL_DIR "/usr/local/lib/indi/DriverSupport/dsi")
-ELSE(APPLE)
+ELSEIF(ANDROID)
+set(FIRMWARE_INSTALL_DIR "/data/data/com.termux/files/usr/lib/firmware")
+ELSE(ANDROID)
set(RULES_INSTALL_DIR "/lib/udev/rules.d")
set(FIRMWARE_INSTALL_DIR "/lib/firmware")
ENDIF()
diff --git a/indi-gphoto/CMakeLists.txt b/indi-gphoto/CMakeLists.txt
index 92f76b6..73822bc 100644
--- a/indi-gphoto/CMakeLists.txt
+++ b/indi-gphoto/CMakeLists.txt
@@ -115,6 +115,6 @@ set_target_properties(indi_gphoto_ccd PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CUR
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/indi_gphoto.xml DESTINATION ${INDI_DATA_DIR})
# Disable automount for DSLR cameras
-IF (UNIX AND NOT APPLE)
+IF (UNIX AND NOT APPLE AND NOT ANDROID)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/85-disable-dslr-automout.rules DESTINATION ${UDEVRULES_INSTALL_DIR})
ENDIF ()
diff --git a/indi-gphoto/gphoto_ccd.cpp b/indi-gphoto/gphoto_ccd.cpp
index bed27c2..a40c327 100644
--- a/indi-gphoto/gphoto_ccd.cpp
+++ b/indi-gphoto/gphoto_ccd.cpp
@@ -42,6 +42,12 @@
#define FOCUS_TIMER 50
#define MAX_RETRIES 3
+#ifdef ANDROID
+#define TMP_DIR "/data/local/tmp"
+#else
+#define TMP_DIR "/tmp"
+#endif
+
extern char * __progname;
@@ -1232,7 +1238,7 @@ bool GPhotoCCD::grabImage()
}
else if (TransferFormatS[FORMAT_FITS].s == ISS_ON)
{
- char filename[MAXRBUF] = "/tmp/indi_XXXXXX";
+ char filename[MAXRBUF] = TMP_DIR "/indi_XXXXXX";
const char *extension = "unknown";
if (isSimulation())
{
diff --git a/indi-nightscape/nightscape.cpp b/indi-nightscape/nightscape.cpp
index d6564ad..b1d4d50 100644
--- a/indi-nightscape/nightscape.cpp
+++ b/indi-nightscape/nightscape.cpp
@@ -18,7 +18,7 @@
*/
-#ifdef _DARWIN_C_SOURCE
+#if defined(_DARWIN_C_SOURCE_) || defined(__ANDROID__)
#define ___secure_getenv getenv
#else
#define ___secure_getenv secure_getenv
diff --git a/libapogee/CMakeLists.txt b/libapogee/CMakeLists.txt
index e9d60d2..a5c707b 100644
--- a/libapogee/CMakeLists.txt
+++ b/libapogee/CMakeLists.txt
@@ -12,7 +12,9 @@ set(APOGEE_SOVERSION "3")
IF(APPLE)
set(CONF_DIR "/usr/local/lib/indi/DriverSupport/" CACHE STRING "Base configuration directory")
-ELSE(APPLE)
+ELSEIF(ANDROID)
+set(CONF_DIR "/data/data/com.termux/files/usr/etc" CACHE STRING "Base configuration directory")
+ELSE(ANDROID)
set(CONF_DIR "/etc" CACHE STRING "Base configuration directory")
set(UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")
ENDIF()
@@ -62,6 +64,6 @@ install(
file(INSTALL DESTINATION ${CONF_DIR}/Apogee/camera TYPE FILE FILES \${APOGEE_CONF})"
)
-IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT ANDROID)
install(FILES 99-apogee.rules DESTINATION ${UDEVRULES_INSTALL_DIR})
ENDIF()
diff --git a/libfishcamp/CMakeLists.txt b/libfishcamp/CMakeLists.txt
index 4f9fa7b..850c833 100644
--- a/libfishcamp/CMakeLists.txt
+++ b/libfishcamp/CMakeLists.txt
@@ -15,7 +15,9 @@ set(FIRMWARE_INSTALL_DIR "/usr/local/lib/indi/DriverSupport/fishcamp")
include_directories( "/usr/local/include")
## This one is needed for Craft
include_directories("${CMAKE_INSTALL_PREFIX}/include")
-ELSE(APPLE)
+ELSEIF(ANDROID)
+set(FIRMWARE_INSTALL_DIR "/data/data/com.termux/files/usr/lib/firmware")
+ELSE(ANDROID)
set(FIRMWARE_INSTALL_DIR "/lib/firmware")
set(UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")
ENDIF(APPLE)
@@ -43,7 +45,7 @@ INSTALL(FILES fishcamp.h fishcamp_common.h DESTINATION include/libfishcamp)
INSTALL(TARGETS fishcamp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install( FILES gdr_usb.hex Guider_mono_rev16_intel.srec DESTINATION ${FIRMWARE_INSTALL_DIR})
-IF(NOT APPLE)
+IF(NOT APPLE AND NOT ANDROID)
install(FILES 99-fishcamp.rules DESTINATION ${UDEVRULES_INSTALL_DIR})
-ENDIF(NOT APPLE)
+ENDIF(NOT APPLE AND NOT ANDROID)
diff --git a/libqhy/CMakeLists.txt b/libqhy/CMakeLists.txt
index 04dc8f5..39350ce 100644
--- a/libqhy/CMakeLists.txt
+++ b/libqhy/CMakeLists.txt
@@ -36,7 +36,11 @@ if (APPLE)
elseif (UNIX AND NOT WIN32)
- set (FIRMWARE_INSTALL_DIR "/lib/firmware/qhy" CACHE STRING "QHY firmware installation directory")
+ if(ANDROID)
+ set (FIRMWARE_INSTALL_DIR "/data/data/com.termux/files/usr/lib/firmware/qhy" CACHE STRING "QHY firmware installation directory")
+ else(ANDROID)
+ set (FIRMWARE_INSTALL_DIR "/lib/firmware/qhy" CACHE STRING "QHY firmware installation directory")
+ endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "armv+")
set_property (TARGET qhyccd PROPERTY IMPORTED_LOCATION "libqhyccd_armv6.bin")
@@ -49,8 +53,10 @@ elseif (UNIX AND NOT WIN32)
endif ()
# Install udev rules
- set (UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")
- install (FILES 85-qhyccd.rules DESTINATION ${UDEVRULES_INSTALL_DIR})
+ if (NOT ANDROID)
+ set (UDEVRULES_INSTALL_DIR "/lib/udev/rules.d" CACHE STRING "Base directory for udev rules")
+ install (FILES 85-qhyccd.rules DESTINATION ${UDEVRULES_INSTALL_DIR})
+ endif()
endif ()