summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Danckaert <thomas.danckaert@gmail.com>2016-03-03 10:55:23 (GMT)
committerThomas Danckaert <thomas.danckaert@gmail.com>2016-03-07 14:32:02 (GMT)
commit3b26de48c85eff9a73f7fb55f5172f77a98e4607 (patch)
tree3c0f1879c2c8455fa2b18b5e8a3c2b5799d81f67
parent372cf0e09f679684182fe3a019827265af056b6e (diff)
downloadmxe-3b26de48c85eff9a73f7fb55f5172f77a98e4607.zip
mxe-3b26de48c85eff9a73f7fb55f5172f77a98e4607.tar.gz
mxe-3b26de48c85eff9a73f7fb55f5172f77a98e4607.tar.bz2
Add package 'coda'.
https://stcorp.nl/coda "The Common Data Access toolbox (CODA) provides a set of interfaces for reading remote sensing data from earth observation data files. These interfaces consist of command line applications, libraries, interfaces to scientific applications (such as IDL and MATLAB), and interfaces to programming languages (such as C, Fortran, Python, and Java)."
-rw-r--r--index.html4
-rw-r--r--src/coda-1-use-stdint.patch22
-rw-r--r--src/coda-test.c22
-rw-r--r--src/coda.mk38
4 files changed, 86 insertions, 0 deletions
diff --git a/index.html b/index.html
index 4febb82..f52a574 100644
--- a/index.html
+++ b/index.html
@@ -1222,6 +1222,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
<td class="website"><a href="http://devernay.free.fr/hacks/cminpack/cminpack.html">cminpack</a></td>
</tr>
<tr>
+ <td class="package">coda</td>
+ <td class="website"><a href="https://stcorp.nl/coda/">CODA</a></td>
+ </tr>
+ <tr>
<td class="package">coin</td>
<td class="website"><a href="https://bitbucket.org/Coin3D/">Coin3D</a></td>
</tr>
diff --git a/src/coda-1-use-stdint.patch b/src/coda-1-use-stdint.patch
new file mode 100644
index 0000000..77e306a
--- /dev/null
+++ b/src/coda-1-use-stdint.patch
@@ -0,0 +1,22 @@
+This file is part of MXE.
+See index.html for further information.
+
+This patch has been taken from https://github.com/stcorp/coda/pull/9
+
+diff --git a/libcoda/coda.h.in b/libcoda/coda.h.in
+index 1587c61..b7dce21 100644
+--- a/libcoda/coda.h.in
++++ b/libcoda/coda.h.in
+@@ -33,9 +33,9 @@ extern "C"
+ #ifdef WIN32
+ #include <windows.h>
+
+-#if (_MSC_VER < 1600)
+-/* For Visual Studio we can use stdint.h as of Visual Studio 2010
+- * For earlier versions we need to provide our own defines
++#if (_MSC_VER < 1600) && !defined(__MINGW32__)
++/* For Visual Studio > 2010 and MinGW we can use stdint.h
++ * For earlier versions of Visual Studio we need to provide our own defines
+ */
+ #ifndef int8_t
+ #define int8_t signed char
diff --git a/src/coda-test.c b/src/coda-test.c
new file mode 100644
index 0000000..f5da782
--- /dev/null
+++ b/src/coda-test.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of MXE.
+ * See index.html for further information.
+ */
+
+#include <stdio.h>
+#include <coda.h>
+
+int main() {
+
+ printf("Testing CODA version %s\n", libcoda_version);
+
+ int rc = coda_init();
+
+ if (rc) {
+ printf("coda_init returned error '%d' -- '%s'", coda_errno, coda_errno_to_string(coda_errno) );
+ }
+
+ coda_done();
+
+ return 0;
+}
diff --git a/src/coda.mk b/src/coda.mk
new file mode 100644
index 0000000..ecba702
--- /dev/null
+++ b/src/coda.mk
@@ -0,0 +1,38 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := coda
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 2.15.1
+$(PKG)_CHECKSUM := 51076ff958ec15633d741ea021761fc6d8c6492f931175c489288481e37ac810
+$(PKG)_SUBDIR := coda-$($(PKG)_VERSION)
+$(PKG)_FILE := coda-$($(PKG)_VERSION).tar.gz
+$(PKG)_URL := https://github.com/stcorp/coda/releases/download/$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc
+
+define $(PKG)_UPDATE
+ echo 'TODO: write update script for $(PKG).' >&2;
+ echo $($(PKG)_VERSION)
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && ./configure \
+ $(MXE_CONFIGURE_OPTS) \
+ --disable-idl \
+ --disable-matlab \
+ --disable-python \
+ --without-hdf5 \
+ --without-hdf4
+
+ # Fortran includes are generated by the tool 'generate-finc',
+ # which needs to run natively:
+ cd '$(1)' && $(CC) -I . -o generate-finc fortran/generate-finc.c
+
+ $(MAKE) -C '$(1)' -j '$(JOBS)'
+ $(MAKE) -C '$(1)' -j 1 install-libLTLIBRARIES install-nodist_includeHEADERS install-fortranDATA
+
+ '$(TARGET)-gcc' \
+ -std=c99 -W -Wall -Werror -pedantic \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-coda.exe' \
+ -lcoda
+endef