[eccodes] 35/106: refresh patches
Alastair McKinstry
mckinstry at moszumanska.debian.org
Fri Jul 28 09:05:10 UTC 2017
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository eccodes.
commit 06672c168bd64c51ed524319ed913ebb01205917
Author: Alastair McKinstry <mckinstry at debian.org>
Date: Sun Oct 23 06:01:48 2016 +0100
refresh patches
---
debian/changelog | 1 +
debian/patches/disable-download-tests.patch | 55 ++--
debian/patches/grib_bits.diff | 12 +-
debian/patches/hurd.patch | 12 +-
debian/patches/numpy-fixes.patch | 193 +++-----------
debian/patches/openjpeg2.patch | 379 ----------------------------
debian/patches/py3-fixes.patch | 102 +-------
debian/patches/python3.patch | 232 ++---------------
debian/patches/reproducible.patch | 85 +++----
debian/patches/series | 1 -
debian/patches/static-fix.patch | 187 +++-----------
debian/patches/static-libs.patch | 35 ++-
12 files changed, 221 insertions(+), 1073 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 1db28b6..2e8fc6b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
eccodes (2.0.0-2) UNRELEASED; urgency=medium
* New upstream release
+ - Openjpeg2 patch now merged upstream
-- Alastair McKinstry <mckinstry at debian.org> Sun, 23 Oct 2016 04:33:15 +0100
diff --git a/debian/patches/disable-download-tests.patch b/debian/patches/disable-download-tests.patch
index 0e12da7..7503cbd 100644
--- a/debian/patches/disable-download-tests.patch
+++ b/debian/patches/disable-download-tests.patch
@@ -1,50 +1,71 @@
Author: Alastair McKinstry <mckinstry at debian.org>
Description: Disable downloading grib files; already present
-Last-Updated: 2016-04-27
+Last-Updated: 2016-10-27
Forwarded: not-needed
-Index: eccodes-0.16.0/tests/CMakeLists.txt
+Index: eccodes-2.0.0/tests/CMakeLists.txt
===================================================================
---- eccodes-0.16.0.orig/tests/CMakeLists.txt
-+++ eccodes-0.16.0/tests/CMakeLists.txt
-@@ -116,7 +116,7 @@ foreach( test ${tests2} )
+--- eccodes-2.0.0.orig/tests/CMakeLists.txt
++++ eccodes-2.0.0/tests/CMakeLists.txt
+@@ -141,8 +141,8 @@ foreach( test ${tests2} )
TYPE SCRIPT
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
RESOURCES asca_139.t1.ref
-- TEST_DEPENDS eccodes_get_gribs eccodes_get_tigge_gribs eccodes_get_bufrs eccodes_get_metars eccodes_get_gts
-+ # TEST_DEPENDS eccodes_get_gribs eccodes_get_tigge_gribs eccodes_get_bufrs eccodes_get_metars eccodes_get_gts
+- TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs
+- eccodes_download_bufrs eccodes_download_metars eccodes_download_gts
++ # TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs
++ # eccodes_download_bufrs eccodes_download_metars eccodes_download_gts
)
endforeach()
-@@ -126,7 +126,7 @@ ecbuild_add_test( TARGET eccodes_t_lamb_
+@@ -161,7 +161,7 @@ if( HAVE_PYTHON AND ENABLE_EXTRA_TESTS )
+ TYPE SCRIPT
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
+ ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} PYTHONPATH=${PROJECT_BINARY_DIR}/python
+- TEST_DEPENDS eccodes_download_bufrs
++ # TEST_DEPENDS eccodes_download_bufrs
+ )
+ endforeach()
+ endif()
+@@ -172,7 +172,7 @@ ecbuild_add_test( TARGET eccodes_t_lamb_
TYPE SCRIPT
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lamb_az_eq_area.sh
RESOURCES lamb_az_eq_area.ref
-- TEST_DEPENDS eccodes_get_gribs
-+ # TEST_DEPENDS eccodes_get_gribs
+- TEST_DEPENDS eccodes_download_gribs
++ # TEST_DEPENDS eccodes_download_gribs
)
# These ones are conditional
-@@ -134,19 +134,19 @@ ecbuild_add_test( TARGET eccodes_t_grib_
+@@ -181,28 +181,28 @@ ecbuild_add_test( TARGET eccodes_t_grib_
TYPE SCRIPT
CONDITION HAVE_NETCDF
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh
-- TEST_DEPENDS eccodes_get_gribs
-+ # TEST_DEPENDS eccodes_get_gribs
+- TEST_DEPENDS eccodes_download_gribs
++ # TEST_DEPENDS eccodes_download_gribs
)
ecbuild_add_test( TARGET eccodes_t_jpeg
TYPE SCRIPT
CONDITION HAVE_JPEG
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jpeg.sh
-- TEST_DEPENDS eccodes_get_gribs
-+ # TEST_DEPENDS eccodes_get_gribs
+- TEST_DEPENDS eccodes_download_gribs
++ # TEST_DEPENDS eccodes_download_gribs
+ )
+
+ ecbuild_add_test( TARGET eccodes_t_grib_png
+ TYPE SCRIPT
+ CONDITION HAVE_PNG
+ COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_png.sh
+- TEST_DEPENDS eccodes_download_gribs
++ # TEST_DEPENDS eccodes_download_gribs
)
ecbuild_add_test( TARGET eccodes_t_ccsds
TYPE SCRIPT
CONDITION HAVE_AEC
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ccsds.sh
-- TEST_DEPENDS eccodes_get_gribs
-+ # TEST_DEPENDS eccodes_get_gribs
+- TEST_DEPENDS eccodes_download_gribs
++ # TEST_DEPENDS eccodes_download_gribs
)
+
+ ecbuild_add_test( TARGET eccodes_t_grib_check_param_concepts
diff --git a/debian/patches/grib_bits.diff b/debian/patches/grib_bits.diff
index 083a55f..3988020 100644
--- a/debian/patches/grib_bits.diff
+++ b/debian/patches/grib_bits.diff
@@ -33,10 +33,10 @@ Proposed patch fixes these corner-cases by setting the result of shift
operation to 0 if right operand is greater than or equal to size of long
(actually, no shifting is performed, the result is set to zero).
-Index: eccodes-0.16.0/src/grib_bits.c
+Index: eccodes-2.0.0/src/grib_bits.c
===================================================================
---- eccodes-0.16.0.orig/src/grib_bits.c
-+++ eccodes-0.16.0/src/grib_bits.c
+--- eccodes-2.0.0.orig/src/grib_bits.c
++++ eccodes-2.0.0/src/grib_bits.c
@@ -24,12 +24,11 @@
long GRIB_MASK = -1; /* Mask of sword bits */
@@ -51,10 +51,10 @@ Index: eccodes-0.16.0/src/grib_bits.c
static unsigned long dmasks[] = { 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x00, };
static int max_nbits = sizeof(unsigned long)*8;
-Index: eccodes-0.16.0/src/grib_bits_fast_big_endian.c
+Index: eccodes-2.0.0/src/grib_bits_fast_big_endian.c
===================================================================
---- eccodes-0.16.0.orig/src/grib_bits_fast_big_endian.c
-+++ eccodes-0.16.0/src/grib_bits_fast_big_endian.c
+--- eccodes-2.0.0.orig/src/grib_bits_fast_big_endian.c
++++ eccodes-2.0.0/src/grib_bits_fast_big_endian.c
@@ -123,9 +123,16 @@ int grib_encode_unsigned_long(unsigned c
countOfLeftmostBits = max_nbits - startBit;
startBit = max_nbits - remainingBits;
diff --git a/debian/patches/hurd.patch b/debian/patches/hurd.patch
index abae3cf..96edb76 100644
--- a/debian/patches/hurd.patch
+++ b/debian/patches/hurd.patch
@@ -3,10 +3,10 @@ Description: Fix for GNU/Hurd
Last-Updated: 2016-04-27
Forwarded: https://software.ecmwf.int/issues/browse/SUP-1588
-Index: eccodes-0.16.0/src/grib_api_internal.h
+Index: eccodes-2.0.0/src/grib_api_internal.h
===================================================================
---- eccodes-0.16.0.orig/src/grib_api_internal.h
-+++ eccodes-0.16.0/src/grib_api_internal.h
+--- eccodes-2.0.0.orig/src/grib_api_internal.h
++++ eccodes-2.0.0/src/grib_api_internal.h
@@ -21,6 +21,7 @@
extern "C" {
#endif
@@ -32,10 +32,10 @@ Index: eccodes-0.16.0/src/grib_api_internal.h
#ifndef NDEBUG
#define DebugAssertAccess(array, index, size) \
-Index: eccodes-0.16.0/tools/grib_tools.h
+Index: eccodes-2.0.0/tools/grib_tools.h
===================================================================
---- eccodes-0.16.0.orig/tools/grib_tools.h
-+++ eccodes-0.16.0/tools/grib_tools.h
+--- eccodes-2.0.0.orig/tools/grib_tools.h
++++ eccodes-2.0.0/tools/grib_tools.h
@@ -8,6 +8,8 @@
* virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
*/
diff --git a/debian/patches/numpy-fixes.patch b/debian/patches/numpy-fixes.patch
index d3a7b98..74d17d1 100644
--- a/debian/patches/numpy-fixes.patch
+++ b/debian/patches/numpy-fixes.patch
@@ -4,10 +4,10 @@ Description: Update the numpy.i from a copy in numpy.git to add
Last-Updated: 2016-06-12
Forwarded: no
-Index: eccodes-0.16.0/python/numpy.i
+Index: eccodes-2.0.0/python/numpy.i
===================================================================
---- eccodes-0.16.0.orig/python/numpy.i
-+++ eccodes-0.16.0/python/numpy.i
+--- eccodes-2.0.0.orig/python/numpy.i
++++ eccodes-2.0.0/python/numpy.i
@@ -1,11 +1,46 @@
/* -*- C -*- (not really, but good for syntax highlighting) */
+
@@ -1135,54 +1135,28 @@ Index: eccodes-0.16.0/python/numpy.i
/***************************/
/* In-Place Array Typemaps */
/***************************/
-@@ -1187,41 +1637,107 @@
+@@ -1187,6 +1637,72 @@
$4 = (DIM_TYPE) array_size(array,2);
}
--/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
-- * DATA_TYPE* INPLACE_ARRAY3)
+/* Typemap suite for (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
+ * DIM_TYPE DIM3)
- */
- %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
- fragment="NumPy_Macros")
-- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
++ */
++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
++ fragment="NumPy_Macros")
+ (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- {
-- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
-- DATA_TYPECODE);
++{
+ $1 = PySequence_Check($input);
- }
- %typemap(in,
- fragment="NumPy_Fragments")
-- (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
-- (PyArrayObject* array=NULL)
++}
++%typemap(in,
++ fragment="NumPy_Fragments")
+ (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+ (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL)
- {
-- array = obj_to_array_no_conversion($input, DATA_TYPECODE);
-- if (!array || !require_dimensions(array,3) || !require_contiguous(array)
-- || !require_native(array)) SWIG_fail;
-- $1 = (DIM_TYPE) array_size(array,0);
-- $2 = (DIM_TYPE) array_size(array,1);
-- $3 = (DIM_TYPE) array_size(array,2);
-- $4 = (DATA_TYPE*) array_data(array);
--}
++{
+ npy_intp size[2] = { -1, -1 };
+ PyArrayObject* temp_array;
+ Py_ssize_t i;
-
--/* Typemap suite for (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
-- * DIM_TYPE DIM3)
-- */
--%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
-- fragment="NumPy_Macros")
-- (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
--{
-- $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
-- DATA_TYPECODE);
--}
--%typemap(in,
++
+ /* length of the list */
+ $2 = PyList_Size($input);
+
@@ -1231,44 +1205,9 @@ Index: eccodes-0.16.0/python/numpy.i
+ if (object_array$argnum!=NULL) free(object_array$argnum);
+}
+
-+/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
-+ * DATA_TYPE* INPLACE_ARRAY3)
-+ */
-+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
-+ fragment="NumPy_Macros")
-+ (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
-+{
-+ $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
-+ DATA_TYPECODE);
-+}
-+%typemap(in,
-+ fragment="NumPy_Fragments")
-+ (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
-+ (PyArrayObject* array=NULL)
-+{
-+ array = obj_to_array_no_conversion($input, DATA_TYPECODE);
-+ if (!array || !require_dimensions(array,3) || !require_contiguous(array)
-+ || !require_native(array)) SWIG_fail;
-+ $1 = (DIM_TYPE) array_size(array,0);
-+ $2 = (DIM_TYPE) array_size(array,1);
-+ $3 = (DIM_TYPE) array_size(array,2);
-+ $4 = (DATA_TYPE*) array_data(array);
-+}
-+
-+/* Typemap suite for (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
-+ * DIM_TYPE DIM3)
-+ */
-+%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
-+ fragment="NumPy_Macros")
-+ (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
-+{
-+ $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
-+ DATA_TYPECODE);
-+}
-+%typemap(in,
- fragment="NumPy_Fragments")
- (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
- (PyArrayObject* array=NULL)
+ /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
+ * DATA_TYPE* INPLACE_ARRAY3)
+ */
@@ -1259,6 +1775,195 @@
$4 = (DATA_TYPE*) array_data(array);
}
@@ -1786,7 +1725,7 @@ Index: eccodes-0.16.0/python/numpy.i
{
$1 = &dim1_temp;
$2 = &dim2_temp;
-@@ -1581,54 +2319,843 @@
+@@ -1581,12 +2319,803 @@
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
{
npy_intp dims[3] = { *$1, *$2, *$3 };
@@ -1800,26 +1739,9 @@ Index: eccodes-0.16.0/python/numpy.i
$result = SWIG_Python_AppendOutput($result,obj);
}
--%enddef /* %numpy_typemaps() macro */
--/* *************************************************************** */
--
--/* Concrete instances of the %numpy_typemaps() macro: Each invocation
-- * below applies all of the typemaps above to the specified data type.
+/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+ DIM_TYPE* DIM3, DIM_TYPE* DIM4)
- */
--%numpy_typemaps(signed char , NPY_BYTE , int)
--%numpy_typemaps(unsigned char , NPY_UBYTE , int)
--%numpy_typemaps(short , NPY_SHORT , int)
--%numpy_typemaps(unsigned short , NPY_USHORT , int)
--%numpy_typemaps(int , NPY_INT , int)
--%numpy_typemaps(unsigned int , NPY_UINT , int)
--%numpy_typemaps(long , NPY_LONG , int)
--%numpy_typemaps(unsigned long , NPY_ULONG , int)
--%numpy_typemaps(long long , NPY_LONGLONG , int)
--%numpy_typemaps(unsigned long long, NPY_ULONGLONG, int)
--%numpy_typemaps(float , NPY_FLOAT , int)
--%numpy_typemaps(double , NPY_DOUBLE , int)
++ */
+%typemap(in,numinputs=0)
+ (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 )
+ (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp)
@@ -1837,35 +1759,14 @@ Index: eccodes-0.16.0/python/numpy.i
+ npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
+ PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
+ PyArrayObject* array = (PyArrayObject*) obj;
-
--/* ***************************************************************
-- * The follow macro expansion does not work, because C++ bool is 4
-- * bytes and NPY_BOOL is 1 byte
-- *
-- * %numpy_typemaps(bool, NPY_BOOL, int)
-- */
++
+ if (!array) SWIG_fail;
+ $result = SWIG_Python_AppendOutput($result,obj);
+}
-
--/* ***************************************************************
-- * On my Mac, I get the following warning for this macro expansion:
-- * 'swig/python detected a memory leak of type 'long double *', no destructor found.'
-- *
-- * %numpy_typemaps(long double, NPY_LONGDOUBLE, int)
++
+/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4,
+ DATA_TYPE** ARGOUTVIEW_ARRAY4)
- */
--
--/* ***************************************************************
-- * Swig complains about a syntax error for the following macro
-- * expansions:
-- *
-- * %numpy_typemaps(complex float, NPY_CFLOAT , int)
-- *
-- * %numpy_typemaps(complex double, NPY_CDOUBLE, int)
-- *
-- * %numpy_typemaps(complex long double, NPY_CLONGDOUBLE, int)
++ */
+%typemap(in,numinputs=0)
+ (DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 , DIM_TYPE* DIM4 , DATA_TYPE** ARGOUTVIEW_ARRAY4)
+ (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL )
@@ -2226,7 +2127,7 @@ Index: eccodes-0.16.0/python/numpy.i
+
+/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+ DIM_TYPE* DIM3)
- */
++ */
+%typemap(in,numinputs=0)
+ (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1 , DIM_TYPE* DIM2 , DIM_TYPE* DIM3 )
+ (DATA_TYPE* data_temp = NULL , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
@@ -2628,39 +2529,23 @@ Index: eccodes-0.16.0/python/numpy.i
+ for (i=0; i < array_numdims(array); ++i) $2 *= array_size(array,i);
+}
+
-+%enddef /* %numpy_typemaps() macro */
-+/* *************************************************************** */
-+
-+/* Concrete instances of the %numpy_typemaps() macro: Each invocation
-+ * below applies all of the typemaps above to the specified data type.
-+ */
-+%numpy_typemaps(signed char , NPY_BYTE , int)
-+%numpy_typemaps(unsigned char , NPY_UBYTE , int)
-+%numpy_typemaps(short , NPY_SHORT , int)
-+%numpy_typemaps(unsigned short , NPY_USHORT , int)
-+%numpy_typemaps(int , NPY_INT , int)
-+%numpy_typemaps(unsigned int , NPY_UINT , int)
-+%numpy_typemaps(long , NPY_LONG , int)
-+%numpy_typemaps(unsigned long , NPY_ULONG , int)
-+%numpy_typemaps(long long , NPY_LONGLONG , int)
-+%numpy_typemaps(unsigned long long, NPY_ULONGLONG, int)
-+%numpy_typemaps(float , NPY_FLOAT , int)
-+%numpy_typemaps(double , NPY_DOUBLE , int)
-+
-+/* ***************************************************************
-+ * The follow macro expansion does not work, because C++ bool is 4
-+ * bytes and NPY_BOOL is 1 byte
-+ *
-+ * %numpy_typemaps(bool, NPY_BOOL, int)
-+ */
-+
-+/* ***************************************************************
-+ * On my Mac, I get the following warning for this macro expansion:
-+ * 'swig/python detected a memory leak of type 'long double *', no destructor found.'
-+ *
-+ * %numpy_typemaps(long double, NPY_LONGDOUBLE, int)
-+ */
-+
+ %enddef /* %numpy_typemaps() macro */
+ /* *************************************************************** */
+
+@@ -1620,15 +3149,13 @@
+ * %numpy_typemaps(long double, NPY_LONGDOUBLE, int)
+ */
+
+-/* ***************************************************************
+- * Swig complains about a syntax error for the following macro
+- * expansions:
+- *
+- * %numpy_typemaps(complex float, NPY_CFLOAT , int)
+- *
+- * %numpy_typemaps(complex double, NPY_CDOUBLE, int)
+- *
+- * %numpy_typemaps(complex long double, NPY_CLONGDOUBLE, int)
+- */
+#ifdef __cplusplus
+
+%include <std_complex.i>
diff --git a/debian/patches/openjpeg2.patch b/debian/patches/openjpeg2.patch
deleted file mode 100644
index 58475fd..0000000
--- a/debian/patches/openjpeg2.patch
+++ /dev/null
@@ -1,379 +0,0 @@
-Description: Support the openjpeg2 API
-Author: Alastair McKinstry <mckinstry at debian.org>
-Last-Update: 2016-07-24
-Forwarded: no
-
-Index: eccodes-0.16.0/cmake/FindOpenJPEG.cmake
-===================================================================
---- eccodes-0.16.0.orig/cmake/FindOpenJPEG.cmake
-+++ eccodes-0.16.0/cmake/FindOpenJPEG.cmake
-@@ -26,8 +26,14 @@ if( DEFINED OPENJPEG_PATH )
- find_library(OPENJPEG_LIBRARY openjpeg PATHS ${OPENJPEG_PATH}/lib PATH_SUFFIXES openjpeg NO_DEFAULT_PATH)
- endif()
-
--find_path(OPENJPEG_INCLUDE_DIR openjpeg.h PATH_SUFFIXES openjpeg )
-+find_path(OPENJPEG_INCLUDE_DIR openjpeg.h PATH_SUFFIXES openjpeg openjpeg-2.1)
-+
-+set( OPENJPEG_VERSION 1)
- find_library( OPENJPEG_LIBRARY openjpeg PATH_SUFFIXES openjpeg )
-+if( NOT OPENJPEG_LIBRARY)
-+ find_library( OPENJPEG_LIBRARY openjp2 PATH_SUFFIXES openjpeg )
-+ set (OPENJPEG_VERSION 2)
-+endif()
-
- set( OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARY} )
- set( OPENJPEG_INCLUDE_DIRS ${OPENJPEG_INCLUDE_DIR} )
-Index: eccodes-0.16.0/src/grib_openjpeg_encoding.c
-===================================================================
---- eccodes-0.16.0.orig/src/grib_openjpeg_encoding.c
-+++ eccodes-0.16.0/src/grib_openjpeg_encoding.c
-@@ -11,24 +11,27 @@
- #include "grib_api_internal.h"
-
- #if HAVE_LIBOPENJPEG
-+
- #include "openjpeg.h"
-
--/* TODO: Strip the \n from msg */
- static void openjpeg_warning(const char *msg, void *client_data)
- {
-- grib_context_log((grib_context*)client_data,GRIB_LOG_WARNING,"OPENJPEG: %s",msg);
-+ grib_context_log((grib_context*)client_data,GRIB_LOG_WARNING,"openjpeg: %s",msg);
- }
-
- static void openjpeg_error(const char *msg, void *client_data)
- {
-- grib_context_log((grib_context*)client_data,GRIB_LOG_ERROR,"OPENJPEG: %s",msg);
-+ grib_context_log((grib_context*)client_data,GRIB_LOG_ERROR,"openjpeg: %s",msg);
- }
-
- static void openjpeg_info(const char *msg, void *client_data)
- {
-- /* grib_context_log((grib_context*)client_data,GRIB_LOG_INFO,"openjpeg: %s",msg); */
-+ /* grib_context_log((grib_context*)client_data,GRIB_LOG_INFO,"openjpeg: %s",msg); */
- }
-
-+#if defined(OPENJPEG_VERSION) && OPENJPEG_VERSION < 20000
-+
-+
- int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) {
-
- int err = GRIB_SUCCESS;
-@@ -164,7 +167,7 @@ int grib_openjpeg_decode(grib_context *c
- image = opj_decode(dinfo, cio);
-
- if(!image) {
-- grib_context_log(c, GRIB_LOG_ERROR, "OPENJPEG: failed to decode image");
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to decode image");
- err = GRIB_DECODING_ERROR;
- goto cleanup;
- }
-@@ -201,7 +204,307 @@ cleanup:
- return err;
- }
-
--#else
-+#else /* OPENJPEG VERSION 2 */
-+
-+/* OpenJPEG 2.1 version of grib_openjpeg_encoding.c */
-+
-+/* opj_* Helper code from https://groups.google.com/forum/#!topic/openjpeg/8cebr0u7JgY */
-+typedef struct
-+{
-+ OPJ_UINT8* pData;
-+ OPJ_SIZE_T dataSize;
-+ OPJ_SIZE_T offset;
-+ j2k_encode_helper *helper;
-+} opj_memory_stream;
-+
-+static OPJ_SIZE_T opj_memory_stream_read(void *buffer, OPJ_SIZE_T nb_bytes, void * p_user_data)
-+{
-+ opj_memory_stream* mstream = (opj_memory_stream*) p_user_data; //Our data.
-+ OPJ_SIZE_T nb_bytes_read = nb_bytes;
-+
-+ //Check if the current offset is outside our data buffer.
-+ if (mstream->offset >= mstream->dataSize)
-+ return (OPJ_SIZE_T) -1;
-+
-+ //Check if we are reading more than we have.
-+ if (nb_bytes > (mstream->dataSize - mstream->offset))
-+ nb_bytes_read = mstream->dataSize - mstream->offset;
-+
-+ memcpy(buffer, &(mstream->pData[mstream->offset]), nb_bytes_read);
-+ mstream->offset += nb_bytes_read;
-+ return nb_bytes_read;
-+}
-+
-+static OPJ_SIZE_T opj_memory_stream_write(void *buffer, OPJ_SIZE_T nb_bytes, void *user_data)
-+{
-+ opj_memory_stream* mstream = (opj_memory_stream*) user_data; // our data
-+ OPJ_SIZE_T nb_bytes_write = nb_bytes;
-+
-+ if (mstream->offset >= mstream->dataSize)
-+ return (OPJ_SIZE_T)-1;
-+ if (nb_bytes > (mstream->dataSize - mstream->offset))
-+ nb_bytes_write = mstream->dataSize - mstream->offset;
-+
-+ memcpy(&(mstream->pData[mstream->offset]), buffer, nb_bytes_write);
-+ mstream->offset += nb_bytes_write;
-+ return nb_bytes_write;
-+}
-+
-+static OPJ_OFF_T opj_memory_stream_skip(OPJ_OFF_T nb_bytes, void *user_data)
-+{
-+ opj_memory_stream* mstream = (opj_memory_stream*) user_data;
-+ OPJ_SIZE_T l_nb_bytes;
-+
-+ if (nb_bytes < 0)
-+ return -1;
-+ l_nb_bytes = (OPJ_SIZE_T) nb_bytes;
-+ if (l_nb_bytes > mstream->dataSize - mstream->offset)
-+ nb_bytes = mstream->dataSize - mstream->offset;
-+ mstream->offset += l_nb_bytes;
-+ return l_nb_bytes;
-+}
-+
-+static OPJ_BOOL opj_memory_stream_seek(OPJ_OFF_T nb_bytes, void * user_data)
-+{
-+ opj_memory_stream* mstream = (opj_memory_stream*) user_data;
-+
-+ if (nb_bytes < 0)
-+ return OPJ_FALSE;
-+ if (nb_bytes >(OPJ_OFF_T) mstream->dataSize)
-+ return OPJ_FALSE;
-+ mstream->offset = (OPJ_SIZE_T) nb_bytes;
-+}
-+
-+
-+
-+static void opj_memory_stream_do_nothing(void * p_user_data)
-+{
-+ OPJ_ARG_NOT_USED(p_user_data);
-+}
-+
-+// Create a stream to use memory as the input or output
-+opj_stream_t* opj_stream_create_default_memory_stream(opj_memory_stream* memoryStream, OPJ_BOOL is_read_stream)
-+{
-+ opj_stream_t* stream;
-+
-+ if (!(stream = opj_stream_default_create(is_read_stream)))
-+ return (NULL);
-+ if (is_read_stream)
-+ opj_stream_set_read_function(stream, opj_memory_stream_read);
-+ else
-+ opj_stream_set_write_function(stream, opj_memory_stream_write);
-+
-+ opj_stream_set_seek_function(stream, opj_memory_stream_seek);
-+ opj_stream_set_skip_function(stream, opj_memory_stream_skip);
-+ opj_stream_set_user_data(stream, memoryStream, opj_memory_stream_do_nothing);
-+ opj_stream_set_user_data_length(stream, memoryStream->dataSize);
-+ return stream;
-+}
-+
-+int grib_openjpeg_encode(grib_context *c, j2k_encode_helper *helper) {
-+
-+ int err = GRIB_SUCCESS;
-+ const int numcomps = 1;
-+ int i;
-+
-+ const double * values = helper->values;
-+ long no_values = helper->no_values;
-+ double reference_value = helper->reference_value;
-+ double divisor = helper->divisor;
-+ double decimal = helper->decimal;
-+ int* data;
-+
-+ opj_cparameters_t parameters = {0,}; /* compression parameters */
-+ opj_codec_t *codec = NULL;
-+ opj_image_t *image = NULL;
-+ opj_image_cmptparm_t cmptparm = {0,};
-+ opj_stream_t *stream = NULL;
-+ opj_memory_stream mstream;
-+
-+ /* set encoding parameters to default values */
-+ opj_set_default_encoder_parameters(¶meters);
-+
-+ parameters.tcp_numlayers = 1;
-+ parameters.cp_disto_alloc = 1;
-+ parameters.numresolution = 1;
-+ parameters.tcp_rates[0] = helper->compression;
-+
-+ /* initialize image component */
-+ cmptparm.prec = helper->bits_per_value;
-+ cmptparm.bpp = helper->bits_per_value; /* Not sure about this one and the previous. What is the difference? */
-+ cmptparm.sgnd = 0;
-+ cmptparm.dx = 1;
-+ cmptparm.dy = 1;
-+ cmptparm.w = helper->width;
-+ cmptparm.h = helper->height;
-+
-+ /* create the image */
-+ image = opj_image_create(numcomps, &cmptparm, OPJ_CLRSPC_GRAY);
-+ if(!image) {
-+ err = GRIB_ENCODING_ERROR;
-+ goto cleanup;
-+ }
-+ image->x0 = 0;
-+ image->y0 = 0;
-+ image->x1 = helper->width;
-+ image->y1 = helper->height;
-+
-+ Assert(cmptparm.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */
-+ Assert(helper->no_values == image->comps[0].h * image->comps[0].w);
-+
-+ /* Simple packing */
-+ data = image->comps[0].data;
-+ for(i=0;i< no_values;i++){
-+ unsigned long unsigned_val = (unsigned long)((((values[i]*decimal)-(reference_value))*divisor)+0.5);
-+ data[i] = unsigned_val;
-+ }
-+
-+ /* get a J2K compressor handle */
-+ codec = opj_create_compress(OPJ_CODEC_J2K);
-+
-+ opj_set_info_handler(codec, openjpeg_info, c);
-+ opj_set_warning_handler(codec, openjpeg_warning, c);
-+ opj_set_error_handler(codec, openjpeg_error,c);
-+
-+ /* setup the encoder parameters using the current image and user parameters */
-+ if (!opj_setup_encoder(codec, ¶meters, image)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to setup encoder");
-+ err = GRIB_ENCODING_ERROR;
-+ goto cleanup;
-+ }
-+
-+ /* open a byte stream for writing */
-+ mstream.helper = helper;
-+ mstream.pData = (OPJ_UINT8*) helper->jpeg_buffer;
-+ mstream.offset = 0;
-+ mstream.dataSize = helper->buffer_size;
-+ stream = opj_stream_create_default_memory_stream( &mstream, OPJ_STREAM_WRITE);
-+ if (stream == NULL) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed create default memory stream");
-+ err = GRIB_ENCODING_ERROR;
-+ goto cleanup;
-+ }
-+ if (!opj_start_compress(codec, image, stream)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to setup encoder");
-+ err = GRIB_ENCODING_ERROR;
-+ goto cleanup;
-+ }
-+
-+ /* encode image */
-+ if (!opj_encode(codec, stream)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: opj_encode failed");
-+ err = GRIB_ENCODING_ERROR;
-+ goto cleanup;
-+ }
-+
-+ if (!opj_end_compress(codec, stream)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: opj_end_compress failed");
-+ err = GRIB_ENCODING_ERROR;
-+ goto cleanup;
-+ }
-+ helper->jpeg_length = mstream.offset;
-+
-+
-+cleanup:
-+ if (codec) opj_destroy_codec(codec);
-+ if (stream) opj_stream_destroy(stream);
-+ if (image) opj_image_destroy(image);
-+
-+ return err;
-+}
-+
-+int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *val, size_t *n_vals) {
-+
-+ int err = GRIB_SUCCESS;
-+ int i;
-+ unsigned long mask;
-+ int *data;
-+ size_t count;
-+
-+ opj_dparameters_t parameters = {0,}; /* decompression parameters */
-+ opj_stream_t *stream = NULL;
-+ opj_memory_stream mstream;
-+ opj_image_t *image = NULL;
-+ opj_codec_t *codec = NULL;
-+ opj_image_comp_t comp = {0,};
-+
-+ /* set decoding parameters to default values */
-+ opj_set_default_decoder_parameters(¶meters);
-+ parameters.decod_format = 1; /* JP2_FMT */
-+ /* JPEG-2000 codestream */
-+
-+ /* get a decoder handle */
-+ codec = opj_create_decompress(OPJ_CODEC_J2K);
-+
-+ /* catch events using our callbacks and give a local context */
-+ opj_set_info_handler(codec, openjpeg_info, c);
-+ opj_set_warning_handler(codec, openjpeg_warning, c);
-+ opj_set_error_handler(codec, openjpeg_error,c);
-+
-+ /* initialize our memory stream */
-+ mstream.pData = buf;
-+ mstream.dataSize = *buflen;
-+ mstream.offset = 0;
-+ /* open a byte stream from memory stream */
-+ stream = opj_stream_create_default_memory_stream( &mstream, OPJ_STREAM_READ);
-+
-+ /* setup the decoder decoding parameters using user parameters */
-+ if (!opj_setup_decoder(codec, ¶meters)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to setup decoder");
-+ err = GRIB_DECODING_ERROR;
-+ goto cleanup;
-+ }
-+ if (!opj_read_header(stream, codec, &image)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to read the header");
-+ err = GRIB_DECODING_ERROR;
-+ goto cleanup;
-+ }
-+ if (!opj_decode(codec, stream, image)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed to decode");
-+ err = GRIB_DECODING_ERROR;
-+ goto cleanup;
-+ }
-+
-+ if ( !(*n_vals <= image->comps[0].w * image->comps[0].h) ) {
-+ err = GRIB_DECODING_ERROR;
-+ goto cleanup;
-+ }
-+ if ( (image->numcomps != 1) || !(image->x1 * image->y1) ) {
-+ err = GRIB_DECODING_ERROR;
-+ goto cleanup;
-+ }
-+
-+ Assert(image->comps[0].sgnd == 0);
-+ Assert(comp.prec <= sizeof(image->comps[0].data[0])*8 - 1); /* BR: -1 because I don't know what happens if the sign bit is set */
-+
-+
-+ Assert(image->comps[0].prec < sizeof(mask)*8-1);
-+
-+ data = image->comps[0].data;
-+ mask = (1 << image->comps[0].prec) - 1;
-+
-+ count = image->comps[0].w * image->comps[0].h;
-+
-+ for(i = 0; i <count ; i++)
-+ val[i] = data[i] & mask;
-+
-+ if (!opj_end_decompress(codec, stream)) {
-+ grib_context_log(c, GRIB_LOG_ERROR, "openjpeg: failed in opj_end_decompress");
-+ err = GRIB_DECODING_ERROR;
-+ }
-+
-+cleanup:
-+ /* close the byte stream */
-+ if (codec) opj_destroy_codec(codec);
-+ if (stream) opj_stream_destroy(stream);
-+ if (image) opj_image_destroy(image);
-+
-+ return err;
-+}
-+
-+#endif /* OPENJPEG_VERSION */
-+
-+#else /* No OpenJPEG */
-
- int grib_openjpeg_decode(grib_context *c, unsigned char *buf, size_t *buflen, double *val, size_t *n_vals) {
- grib_context_log(c, GRIB_LOG_ERROR,
diff --git a/debian/patches/py3-fixes.patch b/debian/patches/py3-fixes.patch
index 456c6f5..e33b834 100644
--- a/debian/patches/py3-fixes.patch
+++ b/debian/patches/py3-fixes.patch
@@ -1,7 +1,7 @@
-Index: eccodes-0.16.0/python/CMakeLists.txt
+Index: eccodes-2.0.0/python/CMakeLists.txt
===================================================================
---- eccodes-0.16.0.orig/python/CMakeLists.txt
-+++ eccodes-0.16.0/python/CMakeLists.txt
+--- eccodes-2.0.0.orig/python/CMakeLists.txt
++++ eccodes-2.0.0/python/CMakeLists.txt
@@ -1,9 +1,9 @@
if( HAVE_PYTHON )
@@ -14,49 +14,15 @@ Index: eccodes-0.16.0/python/CMakeLists.txt
+ include( ${SWIG_USE_FILE} )
+ endif()
- # check for Numpy
- find_package( NumPy )
-@@ -55,6 +55,9 @@ if( HAVE_PYTHON )
- # compile swig interface
-
- set(CMAKE_SWIG_FLAGS "")
-+ if (${PYTHON_VERSION_MAJOR} EQUAL 3)
-+ set_source_files_properties( gribapi_swig.i PROPERTIES SWIG_FLAGS "-py3" )
-+ endif()
-
- include_directories( ${PYTHON_INCLUDE_PATH} )
-
-@@ -66,15 +69,15 @@ if( HAVE_PYTHON )
- endif()
-
- # Invoke swig to generate the C wrapper
-- # swig_add_module( gribapi_swig python grib_interface.h grib_interface.c gribapi_swig.i )
-- # swig_link_libraries( gribapi_swig grib_api ${PYTHON_LIBRARIES} )
--
-+ swig_add_module( gribapi_swig python grib_interface.h grib_interface.c gribapi_swig.i )
-+ swig_link_libraries( gribapi_swig eccodes ${PYTHON_LIBRARIES} )
-+
- ####### Do not invoke swig. Use our own generated C wrapper file ######
-- ecbuild_add_library(TARGET _gribapi_swig
-- TYPE SHARED
-- NOINSTALL
-- SOURCES grib_interface.h grib_interface.c ${_swig_c_wrapper}
-- LIBS eccodes ${PYTHON_LIBRARIES} )
-+ #ecbuild_add_library(TARGET _gribapi_swig
-+ # TYPE SHARED
-+ # NOINSTALL
-+ # SOURCES grib_interface.h grib_interface.c ${_swig_c_wrapper}
-+ # LIBS eccodes ${PYTHON_LIBRARIES} )
- # Don't use the lib prefix. This is needed for the python case where a _modulename.so is generated
- set_target_properties(_gribapi_swig PROPERTIES PREFIX "")
-
-Index: eccodes-0.16.0/python/gribapi_swig.i
+ # preparing for generating setup.py
+ if( HAVE_LIBJASPER )
+Index: eccodes-2.0.0/python/gribapi_swig.i
===================================================================
---- eccodes-0.16.0.orig/python/gribapi_swig.i
-+++ eccodes-0.16.0/python/gribapi_swig.i
-@@ -21,14 +21,17 @@ import_array();
-
- #endif
+--- eccodes-2.0.0.orig/python/gribapi_swig.i
++++ eccodes-2.0.0/python/gribapi_swig.i
+@@ -17,14 +17,17 @@
+ import_array();
+ %}
-/* Converts a PyFile instance to a stdio FILE* */
+
@@ -79,7 +45,7 @@ Index: eccodes-0.16.0/python/gribapi_swig.i
}
%pointer_class(int, intp);
-@@ -69,6 +72,7 @@ int grib_c_count_in_file(FILE* f,int* OU
+@@ -66,6 +69,7 @@ int grib_c_count_in_file(FILE* f,int* OU
// grib handle operations
int grib_c_release(int* gid);
int grib_c_write(int* gid, FILE* f);
@@ -87,7 +53,7 @@ Index: eccodes-0.16.0/python/gribapi_swig.i
int grib_c_get_size_long(int* gid, char* key, long* OUTPUT);
int grib_c_get_string_length(int* gid, char* key, size_t* OUTPUT);
int grib_c_clone(int* gid,int* INOUT);
-@@ -79,9 +83,9 @@ int grib_c_get_native_type(int* gid, cha
+@@ -76,9 +80,9 @@ int grib_c_get_native_type(int* gid, cha
// ---
// multi support
@@ -98,45 +64,3 @@ Index: eccodes-0.16.0/python/gribapi_swig.i
int grib_c_multi_support_off(void);
int grib_c_multi_release(int* gid);
int grib_c_multi_append(int* INPUT, int* INPUT,int* INPUT);
-Index: eccodes-0.16.0/python/gribapi.py
-===================================================================
---- eccodes-0.16.0.orig/python/gribapi.py
-+++ eccodes-0.16.0/python/gribapi.py
-@@ -26,8 +26,10 @@ NumPy support can be disabled by using t
- """
-
- from __future__ import print_function
--import gribapi_swig as _internal
-+from . import gribapi_swig as _internal
- #from gribapi import gribapi_swig as _internal
-+from six import get_function_code
-+from io import _io
- import types
- import sys
- import os
-@@ -63,6 +65,9 @@ GRIB_MISSING_LONG = 2147483647
- # environment variable is defined
- no_type_checks = os.environ.get('GRIB_API_PYTHON_NO_TYPE_CHECKS') is not None
-
-+if sys.version_info.major == 3:
-+ file = _io.TextIOWrapper
-+ long = int
-
- # Function-arguments type-checking decorator
- # inspired from http://code.activestate.com/recipes/454322-type-checking-decorator/
-@@ -77,12 +82,13 @@ def require(**_params_):
- @wraps(_func_)
- # The wrapper function. Replaces the target function and receives its args
- def modified(*args, **kw):
-- arg_names = _func_.__code__.func_code.co_varnames
-+ code = get_function_code(_func_)
-+ arg_names = code.co_varnames
- # argnames, varargs, kwargs, defaults = inspect.getargspec(_func_)
- kw.update(list(zip(arg_names, args)))
- for name, allowed_types in _params_.items():
- param = kw[name]
-- if isinstance(allowed_types, types):
-+ if isinstance(allowed_types, type):
- allowed_types = (allowed_types,)
- assert any([isinstance(param, type1) for type1 in allowed_types]), \
- "Parameter '%s' should be of type %s" % (name, " or ".join([t.__name__ for t in allowed_types]))
diff --git a/debian/patches/python3.patch b/debian/patches/python3.patch
index 458595d..f960336 100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@ -3,10 +3,10 @@ Description: Support for Python3
Forwarded: no
Last-Updated: 2016-04-30
-Index: eccodes-0.16.0/python/test_iterator.py
+Index: eccodes-2.0.0/python/test_iterator.py
===================================================================
---- eccodes-0.16.0.orig/python/test_iterator.py
-+++ eccodes-0.16.0/python/test_iterator.py
+--- eccodes-2.0.0.orig/python/test_iterator.py
++++ eccodes-2.0.0/python/test_iterator.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python
@@ -33,10 +33,10 @@ Index: eccodes-0.16.0/python/test_iterator.py
grib_iterator_delete(iterid)
grib_release(gid)
-Index: eccodes-0.16.0/python/test_index.py
+Index: eccodes-2.0.0/python/test_index.py
===================================================================
---- eccodes-0.16.0.orig/python/test_index.py
-+++ eccodes-0.16.0/python/test_index.py
+--- eccodes-2.0.0.orig/python/test_index.py
++++ eccodes-2.0.0/python/test_index.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python
@@ -113,10 +113,10 @@ Index: eccodes-0.16.0/python/test_index.py
main()
- #print "------------------------------------"
+ #print ("------------------------------------")
-Index: eccodes-0.16.0/python/test_keysiterator.py
+Index: eccodes-2.0.0/python/test_keysiterator.py
===================================================================
---- eccodes-0.16.0.orig/python/test_keysiterator.py
-+++ eccodes-0.16.0/python/test_keysiterator.py
+--- eccodes-2.0.0.orig/python/test_keysiterator.py
++++ eccodes-2.0.0/python/test_keysiterator.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python
@@ -140,10 +140,10 @@ Index: eccodes-0.16.0/python/test_keysiterator.py
fid.close()
-
-
-Index: eccodes-0.16.0/python/test_general.py
+Index: eccodes-2.0.0/python/test_general.py
===================================================================
---- eccodes-0.16.0.orig/python/test_general.py
-+++ eccodes-0.16.0/python/test_general.py
+--- eccodes-2.0.0.orig/python/test_general.py
++++ eccodes-2.0.0/python/test_general.py
@@ -1,7 +1,8 @@
#!/usr/bin/env python
@@ -305,10 +305,10 @@ Index: eccodes-0.16.0/python/test_general.py
main()
- print "------------------------------------"
+ print ("------------------------------------")
-Index: eccodes-0.16.0/python/test_extra.py
+Index: eccodes-2.0.0/python/test_extra.py
===================================================================
---- eccodes-0.16.0.orig/python/test_extra.py
-+++ eccodes-0.16.0/python/test_extra.py
+--- eccodes-2.0.0.orig/python/test_extra.py
++++ eccodes-2.0.0/python/test_extra.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
@@ -360,67 +360,10 @@ Index: eccodes-0.16.0/python/test_extra.py
grib_write(gid,oid)
-Index: eccodes-0.16.0/python/gribapi.py
+Index: eccodes-2.0.0/examples/python/keys_iterator_gts.py
===================================================================
---- eccodes-0.16.0.orig/python/gribapi.py
-+++ eccodes-0.16.0/python/gribapi.py
-@@ -24,6 +24,8 @@ NumPy support can be disabled by using t
- - NumPy
-
- """
-+
-+from __future__ import print_function
- import gribapi_swig as _internal
- #from gribapi import gribapi_swig as _internal
- import types
-@@ -75,12 +77,12 @@ def require(**_params_):
- @wraps(_func_)
- # The wrapper function. Replaces the target function and receives its args
- def modified(*args, **kw):
-- arg_names = _func_.func_code.co_varnames
-+ arg_names = _func_.__code__.func_code.co_varnames
- # argnames, varargs, kwargs, defaults = inspect.getargspec(_func_)
-- kw.update(zip(arg_names, args))
-- for name, allowed_types in _params_.iteritems():
-+ kw.update(list(zip(arg_names, args)))
-+ for name, allowed_types in _params_.items():
- param = kw[name]
-- if isinstance(allowed_types, types.TypeType):
-+ if isinstance(allowed_types, types):
- allowed_types = (allowed_types,)
- assert any([isinstance(param, type1) for type1 in allowed_types]), \
- "Parameter '%s' should be of type %s" % (name, " or ".join([t.__name__ for t in allowed_types]))
-@@ -133,7 +135,7 @@ class Bunch(dict):
- def __str__(self):
- state = ["%s=%r" % (attribute, value)
- for (attribute, value)
-- in self.__dict__.items()]
-+ in list(self.__dict__.items())]
- return '\n'.join(state)
-
-
-@@ -774,7 +776,7 @@ def grib_set_long(gribid, key, value):
- except (ValueError, TypeError):
- raise TypeError("Invalid type")
-
-- if value > sys.maxint:
-+ if value > sys.maxintsize:
- raise TypeError("Invalid type")
-
- GRIB_CHECK(_internal.grib_c_set_long(gribid, key, value))
-@@ -1431,7 +1433,7 @@ def grib_set_key_vals(gribid, key_vals):
- key_vals_str += kv
- elif isinstance(key_vals, dict):
- # A dictionary mapping keys to values
-- for key in key_vals.iterkeys():
-+ for key in key_vals.keys():
- if len(key_vals_str) > 0:
- key_vals_str += ','
- key_vals_str += key + '=' + str(key_vals[key])
-Index: eccodes-0.16.0/examples/python/keys_iterator_gts.py
-===================================================================
---- eccodes-0.16.0.orig/examples/python/keys_iterator_gts.py
-+++ eccodes-0.16.0/examples/python/keys_iterator_gts.py
+--- eccodes-2.0.0.orig/examples/python/keys_iterator_gts.py
++++ eccodes-2.0.0/examples/python/keys_iterator_gts.py
@@ -9,6 +9,7 @@
# nor does it submit to any jurisdiction.
#
@@ -438,113 +381,20 @@ Index: eccodes-0.16.0/examples/python/keys_iterator_gts.py
codes_keys_iterator_delete(iterid)
codes_release(bid)
-@@ -47,11 +48,11 @@ def example():
- def main():
- try:
- example()
-- except CodesInternalError, err:
-+ except CodesInternalError as err:
+@@ -51,7 +52,8 @@ def main():
if VERBOSE:
traceback.print_exc(file=sys.stderr)
else:
- print >> sys.stderr, err.msg
-+ print (err.msg, file=sys.stderr)
-
- return 1
-
-Index: eccodes-0.16.0/examples/python/samples.py
-===================================================================
---- eccodes-0.16.0.orig/examples/python/samples.py
-+++ eccodes-0.16.0/examples/python/samples.py
-@@ -9,6 +9,7 @@
- # nor does it submit to any jurisdiction.
- #
-
-+from __future__ import print_function
- import traceback
- import sys
-
-@@ -75,11 +76,11 @@ def example():
- def main():
- try:
- example()
-- except CodesInternalError, err:
-+ except CodesInternalError as err:
- if VERBOSE:
- traceback.print_exc(file=sys.stderr)
- else:
-- print >>sys.stderr, err.msg
-+ print (err.msg, file=sys.stderr)
-
- return 1
-
-Index: eccodes-0.16.0/examples/python/keys_iterator_bufr.py
-===================================================================
---- eccodes-0.16.0.orig/examples/python/keys_iterator_bufr.py
-+++ eccodes-0.16.0/examples/python/keys_iterator_bufr.py
-@@ -9,6 +9,7 @@
- # nor does it submit to any jurisdiction.
- #
-
-+from __future__ import print_function
- import traceback
- import sys
-
-Index: eccodes-0.16.0/examples/python/count_messages.py
-===================================================================
---- eccodes-0.16.0.orig/examples/python/count_messages.py
-+++ eccodes-0.16.0/examples/python/count_messages.py
-@@ -9,6 +9,7 @@
- # nor does it submit to any jurisdiction.
- #
-
-+from __future__ import print_function
- import traceback
- import sys
-
-@@ -40,19 +41,19 @@ def example():
- for i in range(mcount):
- gid = gid_list[i]
-
-- print "processing message number", i + 1
-+ print ("processing message number", i + 1)
-
- for key in keys:
-- print '%s=%g' % (key, codes_get(gid, key))
-+ print ('%s=%g' % (key, codes_get(gid, key)))
-
-- print 'There are %d, average is %g, min is %g, max is %g' % (
-+ print ('There are %d, average is %g, min is %g, max is %g' % (
- codes_get_size(gid, 'values'),
- codes_get(gid, 'average'),
- codes_get(gid, 'min'),
- codes_get(gid, 'max')
-- )
-+ ))
-
-- print '-' * 100
-+ print ('-' * 100)
-
- codes_release(gid)
-
-@@ -60,11 +61,11 @@ def example():
- def main():
- try:
- example()
-- except CodesInternalError, err:
-+ except CodesInternalError as err:
- if VERBOSE:
- traceback.print_exc(file=sys.stderr)
- else:
-- print >>sys.stderr, err.msg
-+ print (err.msg, file=sys.stderr)
++ print(err.msg, file=sys.stderr)
++
return 1
-Index: eccodes-0.16.0/examples/python/set_missing.py
+Index: eccodes-2.0.0/examples/python/keys_iterator_bufr.py
===================================================================
---- eccodes-0.16.0.orig/examples/python/set_missing.py
-+++ eccodes-0.16.0/examples/python/set_missing.py
+--- eccodes-2.0.0.orig/examples/python/keys_iterator_bufr.py
++++ eccodes-2.0.0/examples/python/keys_iterator_bufr.py
@@ -9,6 +9,7 @@
# nor does it submit to any jurisdiction.
#
@@ -553,24 +403,10 @@ Index: eccodes-0.16.0/examples/python/set_missing.py
import traceback
import sys
-@@ -45,11 +46,11 @@ def example():
- def main():
- try:
- example()
-- except CodesInternalError, err:
-+ except CodesInternalError as err:
- if VERBOSE:
- traceback.print_exc(file=sys.stderr)
- else:
-- print >>sys.stderr, err.msg
-+ print (err.msg, file=sys.stderr)
-
- return 1
-
-Index: eccodes-0.16.0/examples/python/binary_message.py
+Index: eccodes-2.0.0/examples/python/binary_message.py
===================================================================
---- eccodes-0.16.0.orig/examples/python/binary_message.py
-+++ eccodes-0.16.0/examples/python/binary_message.py
+--- eccodes-2.0.0.orig/examples/python/binary_message.py
++++ eccodes-2.0.0/examples/python/binary_message.py
@@ -9,6 +9,7 @@
# nor does it submit to any jurisdiction.
#
@@ -579,17 +415,3 @@ Index: eccodes-0.16.0/examples/python/binary_message.py
import traceback
import sys
-@@ -41,11 +42,11 @@ def example():
- def main():
- try:
- example()
-- except CodesInternalError, err:
-+ except CodesInternalError as err:
- if VERBOSE:
- traceback.print_exc(file=sys.stderr)
- else:
-- print >>sys.stderr, err.msg
-+ print (err.msg, file=sys.stderr)
-
- return 1
-
diff --git a/debian/patches/reproducible.patch b/debian/patches/reproducible.patch
index a59c109..1337ed1 100644
--- a/debian/patches/reproducible.patch
+++ b/debian/patches/reproducible.patch
@@ -1,13 +1,13 @@
Author: Alastair McKinstry <mckinstry at debian.org>
Description: Make builds bit-reproducible
-Last-Updated: 2016-01-08
+Last-Updated: 2016-10-27
Forwarded: https://software.ecmwf.int/issues/browse/SUP-1590
-Index: eccodes-0.16.0/CMakeLists.txt
+Index: eccodes-2.0.0/CMakeLists.txt
===================================================================
---- eccodes-0.16.0.orig/CMakeLists.txt
-+++ eccodes-0.16.0/CMakeLists.txt
-@@ -71,6 +71,12 @@ ecbuild_add_option( FEATURE FORTRAN
+--- eccodes-2.0.0.orig/CMakeLists.txt
++++ eccodes-2.0.0/CMakeLists.txt
+@@ -81,6 +81,12 @@ ecbuild_add_option( FEATURE FORTRAN
# REQUIRED_LANGUAGES Fortran # TODO
)
@@ -20,11 +20,11 @@ Index: eccodes-0.16.0/CMakeLists.txt
# TODO Remove this after REQUIRED_LANGUAGES
if( ENABLE_FORTRAN )
# will set EC_HAVE_FORTRAN with the result
-Index: eccodes-0.16.0/cmake/ecbuild_config.h.in
+Index: eccodes-2.0.0/cmake/ecbuild_config.h.in
===================================================================
---- eccodes-0.16.0.orig/cmake/ecbuild_config.h.in
-+++ eccodes-0.16.0/cmake/ecbuild_config.h.in
-@@ -142,14 +142,18 @@
+--- eccodes-2.0.0.orig/cmake/ecbuild_config.h.in
++++ eccodes-2.0.0/cmake/ecbuild_config.h.in
+@@ -150,14 +150,18 @@
/* config info */
@@ -46,7 +46,7 @@ Index: eccodes-0.16.0/cmake/ecbuild_config.h.in
#define @PNAME at _BUILD_TYPE "@CMAKE_BUILD_TYPE@"
#define @PNAME at _C_COMPILER_ID "@CMAKE_C_COMPILER_ID@"
-@@ -171,9 +175,6 @@
+@@ -179,9 +183,6 @@
#define @PNAME at _INSTALL_LIB_DIR "@CMAKE_INSTALL_PREFIX@/@INSTALL_LIB_DIR@"
#define @PNAME at _INSTALL_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@INSTALL_DATA_DIR@"
@@ -56,60 +56,55 @@ Index: eccodes-0.16.0/cmake/ecbuild_config.h.in
#cmakedefine EC_HAVE_FORTRAN
#ifdef EC_HAVE_FORTRAN
-Index: eccodes-0.16.0/cmake/ecbuild_print_summary.cmake
+Index: eccodes-2.0.0/cmake/ecbuild_print_summary.cmake
===================================================================
---- eccodes-0.16.0.orig/cmake/ecbuild_print_summary.cmake
-+++ eccodes-0.16.0/cmake/ecbuild_print_summary.cmake
-@@ -59,7 +59,9 @@ macro( ecbuild_print_summary )
- message( STATUS "endiness : Little Endian -- IEEE [${IEEE_LE}]" )
+--- eccodes-2.0.0.orig/cmake/ecbuild_print_summary.cmake
++++ eccodes-2.0.0/cmake/ecbuild_print_summary.cmake
+@@ -57,7 +57,9 @@ macro( ecbuild_print_summary )
+ ecbuild_info( "endiness : Little Endian -- IEEE [${IEEE_LE}]" )
endif()
- message( STATUS "build type : [${CMAKE_BUILD_TYPE}]" )
-- message( STATUS "timestamp : [${EC_BUILD_TIMESTAMP}]" )
-+ if( NOT HAVE_BIT_REPRODUCIBLE )
-+ ecbuild_info("timestamp : [${EC_BUILD_TIMESTAMP}]" )
+ ecbuild_info( "build type : [${CMAKE_BUILD_TYPE}]" )
+- ecbuild_info( "timestamp : [${EC_BUILD_TIMESTAMP}]" )
++ if ( NOT HAVE_BIT_REPRODUCIBLE )
++ ecbuild_info( "timestamp : [${EC_BUILD_TIMESTAMP}]" )
+ endif()
- message( STATUS "install prefix : [${CMAKE_INSTALL_PREFIX}]" )
- if( EC_LINK_DIR )
- message( STATUS "links prefix : [${EC_LINK_DIR}]" )
-Index: eccodes-0.16.0/cmake/ecbuild_get_date.cmake
+ ecbuild_info( "install prefix : [${CMAKE_INSTALL_PREFIX}]" )
+ ecbuild_info( " bin dir : [${${PNAME}_FULL_INSTALL_BIN_DIR}]" )
+ ecbuild_info( " lib dir : [${${PNAME}_FULL_INSTALL_LIB_DIR}]" )
+Index: eccodes-2.0.0/cmake/ecbuild_get_date.cmake
===================================================================
---- eccodes-0.16.0.orig/cmake/ecbuild_get_date.cmake
-+++ eccodes-0.16.0/cmake/ecbuild_get_date.cmake
-@@ -20,11 +20,15 @@
+--- eccodes-2.0.0.orig/cmake/ecbuild_get_date.cmake
++++ eccodes-2.0.0/cmake/ecbuild_get_date.cmake
+@@ -20,12 +20,16 @@
##############################################################################
macro(ecbuild_get_date RESULT)
-- if(UNIX)
-- execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
-- string(REGEX REPLACE "(..)/(..)/(....).*" "\\3.\\2.\\1" ${RESULT} ${${RESULT}})
-+ if (HAVE_BIT_REPRODUCIBLE)
-+ ecbuild_info("date not included in bit-reproducible builds")
++ if (HAVE_BIT_REPRODUCIBLE)
++ ecbuild_info("date not included in bit-reproducible builds")
++ else()
+ if(UNIX)
+ execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
+ string(REGEX REPLACE "(..)/(..)/(....).*" "\\3.\\2.\\1" ${RESULT} ${${RESULT}})
else()
-- message(SEND_ERROR "date not implemented")
-+ if(UNIX)
-+ execute_process(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
-+ string(REGEX REPLACE "(..)/(..)/(....).*" "\\3.\\2.\\1" ${RESULT} ${${RESULT}})
-+ else()
-+ ecbuild_error("date not implemented")
+ ecbuild_error("date not implemented")
+- endif()
+ endif()
- endif()
++ endif()
endmacro(ecbuild_get_date)
+ ##############################################################################
@@ -42,11 +46,15 @@ endmacro(ecbuild_get_date)
##############################################################################
macro(ecbuild_get_timestamp RESULT)
+ if (HAVE_BIT_REPRODUCIBLE)
-+ ecbuild_info("timestamps not included in bit-reproducible builds")
++ ecbuild_info("date not included in bit-reproducible builds")
+ else()
if(UNIX)
-- execute_process(COMMAND "date" "+%Y/%m/%d/%H/%M/%S" OUTPUT_VARIABLE _timestamp)
-- string(REGEX REPLACE "(....)/(..)/(..)/(..)/(..)/(..).*" "\\1\\2\\3\\4\\5\\6" ${RESULT} ${_timestamp})
-+ execute_process(COMMAND "date" "+%Y/%m/%d/%H/%M/%S" OUTPUT_VARIABLE _timestamp)
-+ string(REGEX REPLACE "(....)/(..)/(..)/(..)/(..)/(..).*" "\\1\\2\\3\\4\\5\\6" ${RESULT} ${_timestamp})
+ execute_process(COMMAND "date" "+%Y/%m/%d/%H/%M/%S" OUTPUT_VARIABLE _timestamp)
+ string(REGEX REPLACE "(....)/(..)/(..)/(..)/(..)/(..).*" "\\1\\2\\3\\4\\5\\6" ${RESULT} ${_timestamp})
else()
-- message(WARNING "This is NOT UNIX - timestamp not implemented")
-+ message(WARNING "This is NOT UNIX - timestamp not implemented")
+ ecbuild_warn("This is NOT UNIX - timestamp not implemented")
endif()
+ endif()
endmacro(ecbuild_get_timestamp)
diff --git a/debian/patches/series b/debian/patches/series
index 6da8d27..ece359c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,4 +7,3 @@ static-fix.patch
python3.patch
numpy-fixes.patch
py3-fixes.patch
-openjpeg2.patch
diff --git a/debian/patches/static-fix.patch b/debian/patches/static-fix.patch
index 913b957..b2bf4b2 100644
--- a/debian/patches/static-fix.patch
+++ b/debian/patches/static-fix.patch
@@ -6,10 +6,10 @@ Bug-Upstream: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=752732
Last-Updated: 2016-04-27
Forwarded: no
-Index: eccodes-0.16.0/tools/mars_request.c
+Index: eccodes-2.0.0/tools/mars_request.c
===================================================================
---- eccodes-0.16.0.orig/tools/mars_request.c
-+++ eccodes-0.16.0/tools/mars_request.c
+--- eccodes-2.0.0.orig/tools/mars_request.c
++++ eccodes-2.0.0/tools/mars_request.c
@@ -13,7 +13,7 @@
#include "grib_api.h"
@@ -19,23 +19,10 @@ Index: eccodes-0.16.0/tools/mars_request.c
{
fprintf(stderr,"%s: file\n",prog);
exit(1);
-Index: eccodes-0.16.0/tools/dumpload.c
+Index: eccodes-2.0.0/tools/gaussian.c
===================================================================
---- eccodes-0.16.0.orig/tools/dumpload.c
-+++ eccodes-0.16.0/tools/dumpload.c
-@@ -16,7 +16,7 @@
-
- char *prog;
-
--void usage(const char *prog)
-+static void usage(const char *prog)
- {
- fprintf(stderr,"%s: [-l] in out\n",prog);
- exit(1);
-Index: eccodes-0.16.0/tools/gaussian.c
-===================================================================
---- eccodes-0.16.0.orig/tools/gaussian.c
-+++ eccodes-0.16.0/tools/gaussian.c
+--- eccodes-2.0.0.orig/tools/gaussian.c
++++ eccodes-2.0.0/tools/gaussian.c
@@ -14,7 +14,7 @@
#include "grib_api.h"
@@ -45,10 +32,10 @@ Index: eccodes-0.16.0/tools/gaussian.c
{
fprintf(stderr,"%s: N\n",prog);
exit(1);
-Index: eccodes-0.16.0/tools/grib_check_gaussian_grid.c
+Index: eccodes-2.0.0/tools/grib_check_gaussian_grid.c
===================================================================
---- eccodes-0.16.0.orig/tools/grib_check_gaussian_grid.c
-+++ eccodes-0.16.0/tools/grib_check_gaussian_grid.c
+--- eccodes-2.0.0.orig/tools/grib_check_gaussian_grid.c
++++ eccodes-2.0.0/tools/grib_check_gaussian_grid.c
@@ -30,7 +30,7 @@ int DBL_EQUAL(double d1, double d2, doub
return fabs(d1-d2) <= tolerance;
}
@@ -58,101 +45,10 @@ Index: eccodes-0.16.0/tools/grib_check_gaussian_grid.c
{
printf("usage: %s [-f] grib_file grib_file ...\n\n",prog);
printf("Check geometry of GRIB fields with a Gaussian Grid.\n");
-Index: eccodes-0.16.0/tools/grib_cmp.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_cmp.c
-+++ eccodes-0.16.0/tools/grib_cmp.c
-@@ -16,7 +16,7 @@
- */
- #include "grib_api_internal.h"
-
--void usage(char* progname) {
-+static void usage(char* progname) {
- printf("\nUsage: %s file file\n",progname);
- exit(1);
- }
-Index: eccodes-0.16.0/tools/grib_corruption_check.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_corruption_check.c
-+++ eccodes-0.16.0/tools/grib_corruption_check.c
-@@ -10,7 +10,7 @@
-
- #include "grib_api.h"
-
--void usage(char* prog) {
-+static void usage(char* prog) {
- printf("usage: %s gribfile\n",prog);
- exit(1);
- }
-Index: eccodes-0.16.0/tools/grib_diff.c
+Index: eccodes-2.0.0/tools/grib_nearest_land.c
===================================================================
---- eccodes-0.16.0.orig/tools/grib_diff.c
-+++ eccodes-0.16.0/tools/grib_diff.c
-@@ -10,7 +10,7 @@
-
- #include "grib_api_internal.h"
-
--void usage(const char *prog)
-+static void usage(const char *prog)
- {
- fprintf(stderr,"%s: [-b blacklist][-e] [-p err] file1 file2\n",prog);
- exit(1);
-Index: eccodes-0.16.0/tools/grib_distance.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_distance.c
-+++ eccodes-0.16.0/tools/grib_distance.c
-@@ -17,7 +17,7 @@
-
- #include "grib_api.h"
-
--void usage(const char *prog)
-+static void usage(const char *prog)
- {
- fprintf(stderr,"%s: in1 [in2 ... ] out\n",prog);
- exit(1);
-Index: eccodes-0.16.0/tools/grib_error.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_error.c
-+++ eccodes-0.16.0/tools/grib_error.c
-@@ -10,7 +10,7 @@
-
- #include "grib_api_internal.h"
-
--void usage(const char *prog)
-+static void usage(const char *prog)
- {
- fprintf(stderr,"%s: [-d] [-e err] [-o out] file1 file2\n",prog);
- exit(1);
-Index: eccodes-0.16.0/tools/grib_gen.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_gen.c
-+++ eccodes-0.16.0/tools/grib_gen.c
-@@ -20,7 +20,7 @@
- #include "grib_api_internal.h"
-
-
--void usage( char*);
-+static void usage( char*);
-
- int main(int argc, char *argv[])
- {
-Index: eccodes-0.16.0/tools/grib_moments.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_moments.c
-+++ eccodes-0.16.0/tools/grib_moments.c
-@@ -10,7 +10,7 @@
-
- #include "grib_api_internal.h"
-
--void usage(char* prog) {printf("usage: %s split order interpolated.grib original.grib\n",prog);exit(1);}
-+static void usage(char* prog) {printf("usage: %s split order interpolated.grib original.grib\n",prog);exit(1);}
-
- int get_box(grib_handle *h,double *east,double *north,double *west,double *south) {
- int ret=0;
-Index: eccodes-0.16.0/tools/grib_nearest_land.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_nearest_land.c
-+++ eccodes-0.16.0/tools/grib_nearest_land.c
+--- eccodes-2.0.0.orig/tools/grib_nearest_land.c
++++ eccodes-2.0.0/tools/grib_nearest_land.c
@@ -19,7 +19,7 @@
#include "grib_api_internal.h"
@@ -162,23 +58,10 @@ Index: eccodes-0.16.0/tools/grib_nearest_land.c
printf("Usage: %s latlon_file grib_orography grib_file grib_file ...\n",prog);
exit(1);
}
-Index: eccodes-0.16.0/tools/grib_packing.c
-===================================================================
---- eccodes-0.16.0.orig/tools/grib_packing.c
-+++ eccodes-0.16.0/tools/grib_packing.c
-@@ -16,7 +16,7 @@
- */
-
- #include "grib_api_internal.h"
--void usage(const char* p)
-+static void usage(const char* p)
- {
- printf("Usage: %s [-n minimum] [-x maximum] [-b number of bits] [-d decimal scaling] [-2] [--] [values ..]\n",p);
- exit(1);
-Index: eccodes-0.16.0/tools/grib_tools.h
+Index: eccodes-2.0.0/tools/grib_tools.h
===================================================================
---- eccodes-0.16.0.orig/tools/grib_tools.h
-+++ eccodes-0.16.0/tools/grib_tools.h
+--- eccodes-2.0.0.orig/tools/grib_tools.h
++++ eccodes-2.0.0/tools/grib_tools.h
@@ -179,7 +179,7 @@ int grib_tool(int argc, char **argv);
char* grib_options_get_help(char* id);
char* grib_options_get_args(char* id);
@@ -188,11 +71,11 @@ Index: eccodes-0.16.0/tools/grib_tools.h
void usage_doxygen();
int grib_tool_before_getopt(grib_runtime_options* options);
int grib_tool_init(grib_runtime_options* options);
-Index: eccodes-0.16.0/tools/grib_compare.c
+Index: eccodes-2.0.0/tools/grib_compare.c
===================================================================
---- eccodes-0.16.0.orig/tools/grib_compare.c
-+++ eccodes-0.16.0/tools/grib_compare.c
-@@ -278,7 +278,7 @@ int grib_tool_init(grib_runtime_options*
+--- eccodes-2.0.0.orig/tools/grib_compare.c
++++ eccodes-2.0.0/tools/grib_compare.c
+@@ -289,7 +289,7 @@ int grib_tool_init(grib_runtime_options*
options->tolerance_count=MAX_KEYS;
ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_DOUBLE,options->tolerance,&(options->tolerance_count));
if (ret == GRIB_INVALID_ARGUMENT) {
@@ -201,11 +84,11 @@ Index: eccodes-0.16.0/tools/grib_compare.c
exit(1);
}
}
-Index: eccodes-0.16.0/tools/grib_options.c
+Index: eccodes-2.0.0/tools/grib_options.c
===================================================================
---- eccodes-0.16.0.orig/tools/grib_options.c
-+++ eccodes-0.16.0/tools/grib_options.c
-@@ -109,7 +109,7 @@ grib_options_help grib_options_help_list
+--- eccodes-2.0.0.orig/tools/grib_options.c
++++ eccodes-2.0.0/tools/grib_options.c
+@@ -111,7 +111,7 @@ grib_options_help grib_options_help_list
int grib_options_help_count=sizeof(grib_options_help_list)/sizeof(grib_options_help);
@@ -214,7 +97,7 @@ Index: eccodes-0.16.0/tools/grib_options.c
{
int i=0;
printf("\nNAME \t%s\n\n",grib_tool_name);
-@@ -169,7 +169,7 @@ int grib_get_runtime_options(int argc,ch
+@@ -171,7 +171,7 @@ int grib_get_runtime_options(int argc,ch
while ((c = getopt (argc, argv, optstr)) != -1) {
@@ -223,7 +106,7 @@ Index: eccodes-0.16.0/tools/grib_options.c
i=0;
while ( i < grib_options_count && grib_options[i].id[0] != c) i++;
grib_options[i].on=1;
-@@ -242,7 +242,7 @@ int grib_process_runtime_options(grib_co
+@@ -244,7 +244,7 @@ int grib_process_runtime_options(grib_co
if (grib_options_on("G")) grib_gribex_mode_on(context);
nfiles=argc-optind;
@@ -232,7 +115,7 @@ Index: eccodes-0.16.0/tools/grib_options.c
if (has_input_extra) {
options->infile_extra=(grib_tools_file*)calloc(1,sizeof(grib_tools_file));
-@@ -300,7 +300,7 @@ int grib_process_runtime_options(grib_co
+@@ -302,7 +302,7 @@ int grib_process_runtime_options(grib_co
options->requested_print_keys_count=MAX_KEYS;
ret = parse_keyval_string(grib_tool_name,karg,0,GRIB_TYPE_UNDEFINED,
options->requested_print_keys,&(options->requested_print_keys_count));
@@ -241,7 +124,7 @@ Index: eccodes-0.16.0/tools/grib_options.c
GRIB_CHECK_NOLINE(ret,0);
options->strict=grib_options_on("S");
-@@ -321,14 +321,14 @@ int grib_process_runtime_options(grib_co
+@@ -323,14 +323,14 @@ int grib_process_runtime_options(grib_co
sarg=grib_options_get_option("s:");
options->set_values_count=MAX_KEYS;
ret=parse_keyval_string(grib_tool_name, sarg,1,GRIB_TYPE_UNDEFINED,options->set_values,&(options->set_values_count));
@@ -258,7 +141,7 @@ Index: eccodes-0.16.0/tools/grib_options.c
}
if (grib_options_on("c:")) {
-@@ -336,7 +336,7 @@ int grib_process_runtime_options(grib_co
+@@ -338,7 +338,7 @@ int grib_process_runtime_options(grib_co
options->compare_count=MAX_KEYS;
ret=parse_keyval_string(grib_tool_name,sarg,0,GRIB_TYPE_UNDEFINED,options->compare,
&(options->compare_count));
@@ -267,7 +150,7 @@ Index: eccodes-0.16.0/tools/grib_options.c
}
if (grib_options_on("e")) {
for (i=0;i<names_count; i++) {
-@@ -351,7 +351,7 @@ int grib_process_runtime_options(grib_co
+@@ -353,7 +353,7 @@ int grib_process_runtime_options(grib_co
options->constraints_count=MAX_KEYS;
ret=parse_keyval_string(grib_tool_name,warg,1,GRIB_TYPE_UNDEFINED,
options->constraints,&(options->constraints_count));
@@ -276,11 +159,11 @@ Index: eccodes-0.16.0/tools/grib_options.c
return GRIB_SUCCESS;
}
-Index: eccodes-0.16.0/tools/grib_to_netcdf.c
+Index: eccodes-2.0.0/tools/grib_to_netcdf.c
===================================================================
---- eccodes-0.16.0.orig/tools/grib_to_netcdf.c
-+++ eccodes-0.16.0/tools/grib_to_netcdf.c
-@@ -3962,7 +3962,7 @@ int grib_tool_init(grib_runtime_options*
+--- eccodes-2.0.0.orig/tools/grib_to_netcdf.c
++++ eccodes-2.0.0/tools/grib_to_netcdf.c
+@@ -3969,7 +3969,7 @@ int grib_tool_init(grib_runtime_options*
}
if (kvalue->name == NULL) {
fprintf(stderr, "Invalid format: %s", kind_name);
@@ -289,7 +172,7 @@ Index: eccodes-0.16.0/tools/grib_to_netcdf.c
exit(1);
}
}
-@@ -3972,7 +3972,7 @@ int grib_tool_init(grib_runtime_options*
+@@ -3979,7 +3979,7 @@ int grib_tool_init(grib_runtime_options*
char* theArg = grib_options_get_option("R:");
if (!is_number(theArg)) {
fprintf(stderr, "Invalid reference date: %s\n", theArg);
@@ -298,7 +181,7 @@ Index: eccodes-0.16.0/tools/grib_to_netcdf.c
exit(1);
}
set_value(user_r, "referencedate", theArg);
-@@ -4146,7 +4146,7 @@ int grib_tool_finalise_action(grib_runti
+@@ -4158,7 +4158,7 @@ int grib_tool_finalise_action(grib_runti
if(options->outfile==NULL || options->outfile->name==NULL)
{
diff --git a/debian/patches/static-libs.patch b/debian/patches/static-libs.patch
index f38b409..5f5b845 100644
--- a/debian/patches/static-libs.patch
+++ b/debian/patches/static-libs.patch
@@ -4,34 +4,31 @@ Description: Build both static and dynamic libraries for Debian;
Last-Updated: 2016-04-27
Forwarded: no
-Index: eccodes-0.16.0/fortran/CMakeLists.txt
+Index: eccodes-2.0.0/fortran/CMakeLists.txt
===================================================================
---- eccodes-0.16.0.orig/fortran/CMakeLists.txt
-+++ eccodes-0.16.0/fortran/CMakeLists.txt
-@@ -43,8 +43,18 @@ if( HAVE_FORTRAN )
+--- eccodes-2.0.0.orig/fortran/CMakeLists.txt
++++ eccodes-2.0.0/fortran/CMakeLists.txt
+@@ -43,6 +43,15 @@ if( HAVE_FORTRAN )
ecbuild_add_library( TARGET eccodes_f90
SOURCES grib_fortran.c grib_f90.f90 eccodes_f90.f90 grib_kinds.h
GENERATED grib_f90.f90 eccodes_f90.f90
+ CFLAGS ${CFLAGS}
-+ VERSION 0
- LIBS eccodes )
-
-+ ecbuild_add_library( TARGET grib_api_f90_static
-+ OUTPUT_NAME "eccodes_f90"
-+ TYPE STATIC
++ VERSION 0
++ LIBS eccodes )
++ ecbuild_add_library( TARGET eccodes_f90_static
++ TYPE STATIC
+ SOURCES grib_fortran.c grib_f90.f90 eccodes_f90.f90 grib_kinds.h
+ GENERATED grib_f90.f90 eccodes_f90.f90
+ CFLAGS ${CFLAGS}
-+ LIBS eccodes )
-+
- # Add the eccodes module file as well
- #set(_eccodes_mod "${CMAKE_Fortran_MODULE_DIRECTORY}/eccodes.mod" )
-
-Index: eccodes-0.16.0/src/CMakeLists.txt
++ VERSION 0
+ LIBS eccodes )
+ add_custom_command( TARGET eccodes_f90 POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include
+Index: eccodes-2.0.0/src/CMakeLists.txt
===================================================================
---- eccodes-0.16.0.orig/src/CMakeLists.txt
-+++ eccodes-0.16.0/src/CMakeLists.txt
-@@ -394,12 +394,25 @@ ecbuild_add_library(TARGET eccodes
+--- eccodes-2.0.0.orig/src/CMakeLists.txt
++++ eccodes-2.0.0/src/CMakeLists.txt
+@@ -421,12 +421,25 @@ ecbuild_add_library(TARGET eccodes
SOURCES grib_api_version.c
# griby.c gribl.c
${grib_api_srcs}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/eccodes.git
More information about the debian-science-commits
mailing list