Skip to content

Commit

Permalink
new package: astrometry.net
Browse files Browse the repository at this point in the history
  • Loading branch information
knyipab authored and licy183 committed Feb 26, 2024
1 parent ae99eb1 commit 6867fb1
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tur/astrometry.net/0001-gsl-an-configure-cross-compile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/gsl-an/Makefile b/gsl-an/Makefile
index 8b9ced0..cf1995f 100644
--- a/gsl-an/Makefile
+++ b/gsl-an/Makefile
@@ -201,7 +201,7 @@ $(GSL_LIB): config.h $(GSL_OBJS)
$(RANLIB) $@

config.h: configure config.h.in
- ./configure --enable-shared=no --prefix=`pwd`/stage
+ ./configure --disable-rpath --disable-rpath-hack --enable-shared=no --host=x86_64-linux-android --prefix=`pwd`/stage
touch $@

config.h.in: ;
13 changes: 13 additions & 0 deletions tur/astrometry.net/0002-solver-landroid-glob.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/solver/Makefile b/solver/Makefile
index f225256..d5dfbcd 100644
--- a/solver/Makefile
+++ b/solver/Makefile
@@ -315,7 +315,7 @@ unpermute-stars: unpermute-stars-main.o $(SLIB)
ALL_OBJ += unpermute-stars-main.o

astrometry-engine: engine-main.o $(SLIB)
- $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS)
+ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -landroid-glob

solve-field: solve-field.o augment-xylist.o image2xy-files.o $(SLIB) $(CFITS_SLIB)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(CFITS_LIB) $(LDLIBS)
16 changes: 16 additions & 0 deletions tur/astrometry.net/0003-ioutils-TMPDIR.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/util/ioutils.c b/util/ioutils.c
index 3a9bd48..91b8832 100644
--- a/util/ioutils.c
+++ b/util/ioutils.c
@@ -638,7 +638,11 @@ char* shell_escape(const char* str) {
}

static char* get_temp_dir() {
+#ifdef __TERMUX__
+ char* dir = getenv("TMPDIR");
+#else
char* dir = getenv("TMP");
+#endif
if (!dir) {
dir = "/tmp";
}
31 changes: 31 additions & 0 deletions tur/astrometry.net/0004-bypass-netpbm-test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/util/Makefile b/util/Makefile
index c35a8da..0338b8f 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -267,11 +267,7 @@ $(INCLUDE_DIR)/os-features-config.h: os-features-test.c
@echo " NETPBM_INC is $(NETPBM_INC_ORIG)"
@echo " NETPBM_LIB is $(NETPBM_LIB_ORIG)"
@echo "Testing netpbm..." >> os-features.log
- (($(CC) -o os-features-test-netpbm \
- $(CPPFLAGS) $(CFLAGS) $(NETPBM_INC_ORIG) $^ $(LDFLAGS) $(NETPBM_LIB_ORIG) >> os-features.log && \
- ./os-features-test-netpbm >> os-features.log && \
- echo "#define HAVE_NETPBM 1") \
- || echo "#define HAVE_NETPBM 0") >> [email protected]
+ echo "#define HAVE_NETPBM 1" >> [email protected]
@echo "--------------- End of expected error messages -----------------"
@echo
mv [email protected] $@
@@ -297,12 +293,4 @@ makefile.os-features: os-features-test.c
- (($(CC) -o os-features-test-netpbm-make \
- $(CPPFLAGS) $(CFLAGS) $(NETPBM_INC_ORIG) $^ $(LDFLAGS) $(NETPBM_LIB_ORIG) >> os-features-makefile.log && \
- ./os-features-test-netpbm-make >> os-features-makefile.log && \
- echo "HAVE_NETPBM := yes") \
- || (echo "# Astrometry.net didn't find netpbm; not setting HAVE_NETPBM."; \
- echo "# See os-features-makefile.log for details."; \
- echo "# To re-run this test, do 'make reconfig; make makefile.os-features' (in the 'util' directory)"; \
- echo "# Or to do it yourself, just uncomment this line:"; \
- echo "# HAVE_NETPBM := yes")) \
+ echo "HAVE_NETPBM := yes" \
; \
echo) > [email protected]
@echo "--------------- End of expected error messages -----------------"
24 changes: 24 additions & 0 deletions tur/astrometry.net/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
TERMUX_PKG_HOMEPAGE=https://astrometry.net/
TERMUX_PKG_DESCRIPTION="automatic recognition of astronomical images"
TERMUX_PKG_LICENSE="custom"
TERMUX_PKG_LICENSE_FILE="LICENSE"
TERMUX_PKG_MAINTAINER="@termux-user-repository"
TERMUX_PKG_VERSION="0.94"
TERMUX_PKG_SRCURL=https://github.com/dstndstn/astrometry.net/releases/download/${TERMUX_PKG_VERSION}/astrometry.net-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=38c0d04171ecae42033ce5c9cd0757d8c5fc1418f2004d85e858f29aee383c5f
TERMUX_PKG_DEPENDS="cfitsio, curl, file, libandroid-glob, libbz2, libcairo, libjpeg-turbo, libpng, netpbm, python, python-numpy, python-fitsio, swig, wcslib, zlib"
TERMUX_PKG_SUGGESTS="astrometry.net-data-basic"
TERMUX_PKG_PYTHON_COMMON_DEPS="wheel, setuptools, numpy"
TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_BLACKLISTED_ARCHES="arm" # FIXME: arm cross-compile C compiler fails for unknown reason

termux_step_make () {
make TERMUX_HOST_PLATFORM="$TERMUX_HOST_PLATFORM"
make py CAIRO_INC=-I"$TERMUX_PREFIX"/include/cairo
make extra CAIRO_INC=-I"$TERMUX_PREFIX"/include/cairo
}

termux_step_make_install () {
make install INSTALL_DIR="$TERMUX_PREFIX" CAIRO_INC=-I"$TERMUX_PREFIX"/include/cairo
}

0 comments on commit 6867fb1

Please sign in to comment.