diff -Nru libhdf4-4.2.14/debian/changelog libhdf4-4.2.14/debian/changelog --- libhdf4-4.2.14/debian/changelog 2020-03-22 15:45:57.000000000 +0000 +++ libhdf4-4.2.14/debian/changelog 2020-04-10 04:44:30.000000000 +0000 @@ -1,3 +1,9 @@ +libhdf4 (4.2.14-1ubuntu1) focal; urgency=medium + + * Add riscv64 support (patch from Debian). + + -- William Grant Fri, 10 Apr 2020 14:44:30 +1000 + libhdf4 (4.2.14-1build1) focal; urgency=medium * No-change rebuild for libgcc-s1 package name change. diff -Nru libhdf4-4.2.14/debian/control libhdf4-4.2.14/debian/control --- libhdf4-4.2.14/debian/control 2018-12-25 21:24:23.000000000 +0000 +++ libhdf4-4.2.14/debian/control 2020-04-10 04:44:30.000000000 +0000 @@ -1,5 +1,6 @@ Source: libhdf4 -Maintainer: Debian GIS Project +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian GIS Project Uploaders: Francesco Paolo Lovergine , Johan Van de Wauw Section: graphics diff -Nru libhdf4-4.2.14/debian/control.in libhdf4-4.2.14/debian/control.in --- libhdf4-4.2.14/debian/control.in 2018-12-25 21:24:23.000000000 +0000 +++ libhdf4-4.2.14/debian/control.in 2020-04-10 04:44:30.000000000 +0000 @@ -1,5 +1,6 @@ Source: libhdf4 -Maintainer: Debian GIS Project +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian GIS Project Uploaders: Francesco Paolo Lovergine , Johan Van de Wauw Section: graphics diff -Nru libhdf4-4.2.14/debian/patches/64bit libhdf4-4.2.14/debian/patches/64bit --- libhdf4-4.2.14/debian/patches/64bit 2019-03-16 08:35:30.000000000 +0000 +++ libhdf4-4.2.14/debian/patches/64bit 2020-04-10 04:44:28.000000000 +0000 @@ -1,14 +1,16 @@ Description: Additional 64bit architectures. Author: Francesco Paolo Lovergine ---- a/mfhdf/libsrc/netcdf.h.in -+++ b/mfhdf/libsrc/netcdf.h.in +Index: libhdf4-4.2.14/mfhdf/libsrc/netcdf.h.in +=================================================================== +--- libhdf4-4.2.14.orig/mfhdf/libsrc/netcdf.h.in ++++ libhdf4-4.2.14/mfhdf/libsrc/netcdf.h.in @@ -293,7 +293,7 @@ typedef double ncdouble; /* * Variables/attributes of type NC_LONG should use the C type 'nclong' */ -#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__ -+#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__ || (defined __sparc__ && defined __arch64__) || defined __s390x__ || defined __aarch64__ ++#if defined __alpha || (_MIPS_SZLONG == 64) || defined __ia64 || (defined __sun && defined _LP64) || defined AIX5L64 || defined __x86_64__ || defined __powerpc64__ || (defined __sparc__ && defined __arch64__) || defined __s390x__ || defined __aarch64__ || (defined __riscv && __riscv_xlen == 64) /* * LP64 (also known as 4/8/8) denotes long and pointer as 64 bit types. * http://www.unix.org/version2/whatsnew/lp64_wp.html diff -Nru libhdf4-4.2.14/debian/patches/hdfi.h libhdf4-4.2.14/debian/patches/hdfi.h --- libhdf4-4.2.14/debian/patches/hdfi.h 2019-03-16 08:35:31.000000000 +0000 +++ libhdf4-4.2.14/debian/patches/hdfi.h 2020-04-10 04:44:28.000000000 +0000 @@ -32,7 +32,7 @@ /* I/O library constants */ #define UNIXUNBUFIO 1 -@@ -288,7 +296,7 @@ typedef int hdf_pint_t; +@@ -288,7 +296,7 @@ #endif /* IBM6000 */ @@ -41,7 +41,7 @@ #ifndef HP9000 #define HP9000 -@@ -347,6 +355,10 @@ typedef int hdf_pint_t; +@@ -347,6 +355,10 @@ /* what each does */ #define JMEMSYS MEM_ANSI @@ -52,7 +52,7 @@ #endif /* HP9000 */ -@@ -666,6 +678,410 @@ typedef int hdf_pint_t; +@@ -666,6 +678,410 @@ #endif /* !(defined(__APPLE__)) */ /*-----------------------------------------------------*/ @@ -463,7 +463,7 @@ #if defined(NEXT) || defined(NeXT) #ifndef NEXT -@@ -928,7 +1344,11 @@ Please check your Makefile. +@@ -928,7 +1344,11 @@ #include /* for unbuffered i/o stuff */ #include @@ -476,7 +476,7 @@ typedef void VOID; typedef void *VOIDP; typedef char *_fcd; -@@ -952,6 +1372,11 @@ typedef long hdf_pint_t; +@@ -952,6 +1372,11 @@ #define _fcdtocp(desc) (desc) #define FILELIB UNIXBUFIO @@ -488,7 +488,7 @@ /* JPEG #define's - Look in the JPEG docs before changing - (Q) */ /* Determine the memory manager we are going to use. Valid values are: */ -@@ -1097,6 +1522,8 @@ typedef long hdf_pint_t; +@@ -1097,6 +1522,8 @@ #define _fcdtocp(desc) (desc) #define FILELIB UNIXBUFIO @@ -497,7 +497,7 @@ /* JPEG #define's - Look in the JPEG docs before changing - (Q) */ /* Determine the memory manager we are going to use. Valid values are: */ -@@ -1111,6 +1538,66 @@ typedef long hdf_pint_t; +@@ -1111,6 +1538,66 @@ #endif /* IA64 */ diff -Nru libhdf4-4.2.14/debian/patches/riscv64-support.patch libhdf4-4.2.14/debian/patches/riscv64-support.patch --- libhdf4-4.2.14/debian/patches/riscv64-support.patch 1970-01-01 00:00:00.000000000 +0000 +++ libhdf4-4.2.14/debian/patches/riscv64-support.patch 2020-04-10 04:44:28.000000000 +0000 @@ -0,0 +1,84 @@ +Index: libhdf4-4.2.13/hdf/src/hdfi.h +=================================================================== +--- libhdf4-4.2.13.orig/hdf/src/hdfi.h ++++ libhdf4-4.2.13/hdf/src/hdfi.h +@@ -83,6 +83,7 @@ + #define DFMT_X86_64 0x4441 + #define DFMT_SH 0x4441 + #define DFMT_SHEB 0x1111 ++#define DFMT_RISCV64 0x4441 + + /* I/O library constants */ + #define UNIXUNBUFIO 1 +@@ -1082,6 +1083,58 @@ typedef long hdf_pint_t; + + #endif /* Linux/aarch64 */ + ++#if defined (__linux__) && defined (__riscv) && (__riscv_xlen == 64) ++ ++#ifdef GOT_MACHINE ++If you get an error on this line more than one machine type has been defined. ++Please check your Makefile. ++#endif ++#define GOT_MACHINE 1 ++ ++#include ++#include /* for unbuffered file I/O */ ++#include ++#include ++#include /* for character macros */ ++ ++#define DF_MT DFMT_RISCV64 ++ ++typedef void VOID; ++typedef void * VOIDP; ++typedef char * _fcd; ++typedef char char8; ++typedef unsigned char uchar8; ++typedef signed char int8; ++typedef unsigned char uint8; ++typedef short int int16; ++typedef unsigned short int uint16; ++typedef int int32; ++typedef unsigned int uint32; ++typedef int intn; ++typedef unsigned int uintn; ++typedef float float32; ++typedef double float64; ++typedef int intf; /* size of INTEGERs in Fortran compiler */ ++typedef long hdf_pint_t; /* an integer the same size as a pointer */ ++#define FNAME_POST_UNDERSCORE ++#define _fcdtocp(desc) (desc) ++#define FILELIB UNIXBUFIO ++ ++#ifndef BIG_LONGS ++#define BIG_LONGS ++#endif ++ ++/* JPEG #define's - Look in the JPEG docs before changing - (Q) */ ++ ++/* Determine the memory manager we are going to use. Valid values are: */ ++/* MEM_DOS, MEM_ANSI, MEM_NAME, MEM_NOBS. See the JPEG docs for details on */ ++/* what each does */ ++#define JMEMSYS MEM_ANSI ++#define HAVE_STDC ++#define INCLUDES_ARE_ANSI ++ ++#endif /* Linux/riscv64 */ ++ + #if defined(NEXT) || defined(NeXT) + + #ifndef NEXT +Index: libhdf4-4.2.13/hdf/src/hconv.h +=================================================================== +--- libhdf4-4.2.13.orig/hdf/src/hconv.h ++++ libhdf4-4.2.13/hdf/src/hconv.h +@@ -59,7 +59,7 @@ + /* CONSTANT DEFINITIONS */ + /*****************************************************************************/ + /* Generally Big-Endian machines */ +-#if !defined(INTEL86) && !defined(MIPSEL) && !defined(DEC_ALPHA) && !defined(I860) && !defined(SUN386) && !(defined(__ia64) && !(defined(hpux) || defined(__hpux))) && !defined(__x86_64__) && !(defined(__powerpc__) && defined(__LITTLE_ENDIAN__)) && !defined(__aarch64__) && !defined(__ARM_EABI__) ++#if !defined(INTEL86) && !defined(MIPSEL) && !defined(DEC_ALPHA) && !defined(I860) && !defined(SUN386) && !(defined(__ia64) && !(defined(hpux) || defined(__hpux))) && !defined(__x86_64__) && !(defined(__powerpc__) && defined(__LITTLE_ENDIAN__)) && !defined(__aarch64__) && !defined(__ARM_EABI__) && !defined(__riscv) + # define UI8_IN DFKnb1b /* Unsigned Integer, 8 bits */ + # define UI8_OUT DFKnb1b + # define SI16_IN DFKnb2b /* S = Signed */ diff -Nru libhdf4-4.2.14/debian/patches/series libhdf4-4.2.14/debian/patches/series --- libhdf4-4.2.14/debian/patches/series 2018-07-29 08:56:58.000000000 +0000 +++ libhdf4-4.2.14/debian/patches/series 2020-04-10 04:44:28.000000000 +0000 @@ -15,3 +15,4 @@ spelling-errors.patch manpage-has-errors-from-man.patch reproducible-builds.patch +riscv64-support.patch diff -Nru libhdf4-4.2.14/debian/rules libhdf4-4.2.14/debian/rules --- libhdf4-4.2.14/debian/rules 2018-12-11 19:43:50.000000000 +0000 +++ libhdf4-4.2.14/debian/rules 2020-04-10 04:44:28.000000000 +0000 @@ -35,7 +35,7 @@ export DH_VERBOSE endif -ifneq (,$(filter $(DEB_BUILD_ARCH),s390x sparc64)) +ifneq (,$(filter $(DEB_BUILD_ARCH),s390x sparc64 riscv64)) DISABLE_TESTS=1 else DISABLE_TESTS=0