code:
Fix fortran line length/indentation issues in Fortran test programs.
Reported to upstream maintainer.

diff --git a/samples/he5_gd_writedataF_32.f b/samples/he5_gd_writedataF_32.f
index 515edf9..9c86299 100755
--- a/samples/he5_gd_writedataF_32.f
+++ b/samples/he5_gd_writedataF_32.f
@@ -77,26 +77,26 @@ c           ------------------------------

 		attr4 = "ABCDEFGH"
 		count(1) = 8
-		status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+		status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR"
+     &               ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_gdwrattr():  ',status

 		attr4 = "111"
 		count(1) = 3
-		status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+		status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1"
+     &               ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_gdwrgattr():  ',status

 		attr4 = "222222"
 		count(1) = 6
-		status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+		status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2"
+     &               ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_ehwrglatt():  ',status

 		attr5 = "abcdefgh111111111111"
 		count(1) = 20
-		status = he5_gdwrlattr(gdid,"Vegetation","LocalAttribute_0",
-	1	HE5T_NATIVE_CHAR,count,attr5)
+		status = he5_gdwrlattr(gdid,"Vegetation"
+     &               ,"LocalAttribute_0",HE5T_NATIVE_CHAR,count,attr5)
 	write(*,*) 'Status returned by he5_gdwrlattr():  ',status

 		 endif
diff --git a/samples/he5_gd_writedataF_64.f b/samples/he5_gd_writedataF_64.f
index eff04f5..62a7398 100755
--- a/samples/he5_gd_writedataF_64.f
+++ b/samples/he5_gd_writedataF_64.f
@@ -77,26 +77,26 @@ c           ------------------------------

 		attr4 = "ABCDEFGH"
 		count(1) = 8
-		status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+		status = he5_gdwrattr(gdid,"GLOBAL_CHAR_ATTR"
+     &               ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_gdwrattr():  ',status

 		attr4 = "111"
 		count(1) = 3
-		status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+		status = he5_gdwrgattr(gdid,"GLOBAL_CHAR_ATTR_1"
+     &               ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_gdwrgattr():  ',status

 		attr4 = "222222"
 		count(1) = 6
-		status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+		status = he5_ehwrglatt(gdfid,"GLOBAL_CHAR_ATTR_2"
+     &               ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_ehwrglatt():  ',status

 		attr5 = "abcdefgh111111111111"
 		count(1) = 20
-		status = he5_gdwrlattr(gdid,"Vegetation","LocalAttribute_0",
-	1	HE5T_NATIVE_CHAR,count,attr5)
+		status = he5_gdwrlattr(gdid,"Vegetation"
+     &               ,"LocalAttribute_0",HE5T_NATIVE_CHAR,count,attr5)
 	write(*,*) 'Status returned by he5_gdwrlattr():  ',status

 		 endif
diff --git a/samples/he5_sw_writedataF_32.f b/samples/he5_sw_writedataF_32.f
index 7abab9b..fedd49a 100755
--- a/samples/he5_sw_writedataF_32.f
+++ b/samples/he5_sw_writedataF_32.f
@@ -173,20 +173,21 @@ c     Write Global Attribute
 c     ----------------------
 			attr4 = "ABCDEFGH"
 			count(1) = 8
-			status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+			status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR"
+     &                       ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_swwrattr():  ',status

 			attr4 = "111"
 			count(1) = 3
-			status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+			status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1"
+     &                       ,HE5T_NATIVE_CHAR,count,attr4)
 	write(*,*) 'Status returned by he5_swwrgattr():  ',status

 			attr4 = "222222"
 			count(1) = 6
-			status = he5_ehwrglatt(swfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+			status = he5_ehwrglatt(swfid
+     &                       ,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR
+     &                       ,count,attr4)
 	write(*,*) 'Status returned by he5_ehwrglatt():  ',status

 c     Write Local Attribute
diff --git a/samples/he5_sw_writedataF_64.f b/samples/he5_sw_writedataF_64.f
index 79e34bd..e5d74cb 100755
--- a/samples/he5_sw_writedataF_64.f
+++ b/samples/he5_sw_writedataF_64.f
@@ -162,25 +162,27 @@ c     Write Global Attribute
 c     ----------------------
 			attr4 = "ABCDEFGH"
 			count(1) = 8
-			status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+			status = he5_swwrattr(swid,"GLOBAL_CHAR_ATTR"
+     &                       ,HE5T_NATIVE_CHAR,count,attr4)

 			attr4 = "111"
 			count(1) = 3
-			status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+			status = he5_swwrgattr(swid,"GLOBAL_CHAR_ATTR_1"
+     &                       ,HE5T_NATIVE_CHAR,count,attr4)

 			attr4 = "222222"
 			count(1) = 6
-			status = he5_ehwrglatt(swfid,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR,
-	1	count,attr4)
+			status = he5_ehwrglatt(swfid
+     &                       ,"GLOBAL_CHAR_ATTR_2",HE5T_NATIVE_CHAR
+     &                       ,count,attr4)

 c     Write Local Attribute
 c     ---------------------
 			attr5 = "abababababababababab"
 			count(1) = 20
-			status = he5_swwrlattr(swid,"Density","LocalAttribute_0",
-	1	HE5T_NATIVE_CHAR,count,attr5)
+			status = he5_swwrlattr(swid,"Density"
+     &                       ,"LocalAttribute_0",HE5T_NATIVE_CHAR,count
+     &                       ,attr5)

 		 endif
--
2.10.0


code:
Don't build/install/use bundled gctp code/headers.

* cproj.h, proj.h: part of GCTP, therefore already present.
* HE5_config.h, tutils.h: used for library building and testing.

diff --git a/Makefile.in b/Makefile.in
index f160d0d..367b537 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -206,7 +206,7 @@ LIBGCTP = $(top_builddir)/gctp/src/libGctp.la
 @TESTDRIVERS_CONDITIONAL_TRUE@TESTDRIVERS = testdrivers
 @INSTALL_INCLUDE_CONDITIONAL_FALSE@INCLUDE =
 @INSTALL_INCLUDE_CONDITIONAL_TRUE@INCLUDE = include
-SUBDIRS = gctp src $(INCLUDE) samples $(TESTDRIVERS)
+SUBDIRS = src $(INCLUDE) samples $(TESTDRIVERS)
 all: all-recursive

 .SUFFIXES:
diff --git a/samples/Makefile.in b/samples/Makefile.in
index 59331dd..64fda89 100644
--- a/samples/Makefile.in
+++ b/samples/Makefile.in
@@ -206,7 +206,6 @@ he5_gd_datainfo_SOURCES = he5_gd_datainfo.c
 he5_gd_datainfo_OBJECTS = he5_gd_datainfo.$(OBJEXT)
 he5_gd_datainfo_LDADD = $(LDADD)
 am__DEPENDENCIES_1 = $(top_builddir)/src/libhe5_hdfeos.la
-am__DEPENDENCIES_2 = $(top_builddir)/gctp/src/libGctp.la
 he5_gd_datainfo_DEPENDENCIES = $(am__DEPENDENCIES_1) \
 	$(am__DEPENDENCIES_2)
 he5_gd_defexternalfld_SOURCES = he5_gd_defexternalfld.c
@@ -1093,7 +1092,7 @@ sharedstatedir = @sharedstatedir@
 sysconfdir = @sysconfdir@
 target_alias = @target_alias@
 LIBHDFEOS5 = $(top_builddir)/src/libhe5_hdfeos.la
-LIBGCTP = $(top_builddir)/gctp/src/libGctp.la
+LIBGCTP =

 # Boilerplate definitions file

diff --git a/include/Makefile.in b/include/Makefile.in
index a572128..64dabb5 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -190,8 +190,7 @@ LIBGCTP = $(top_builddir)/gctp/src/libGctp.la
 # Boilerplate include

 # Headers to install
-include_HEADERS = HE5_GctpFunc.h HE5_HdfEosDef.h HE5_config.h cproj.h ease.h \
-                  isin.h proj.h tutils.h cfortHdf.h
+include_HEADERS = HE5_GctpFunc.h HE5_HdfEosDef.h ease.h isin.h cfortHdf.h

 all: HE5_config.h
 	$(MAKE) $(AM_MAKEFLAGS) all-am
--
2.10.0

repo_name: maximed/guix

license: mit


code:
Copied from Debian.

Description: Support additional architectures.
Author: Francesco Paolo Lovergine <frankie@debian.org>

--- a/hdf/src/hdfi.h
+++ b/hdf/src/hdfi.h
@@ -48,6 +48,7 @@
 /*      8 - Cray IEEE                                                       */
 /*          (i.e. Big-Endian, all 64-bit architecture w/IEEE Floats)        */
 /*--------------------------------------------------------------------------*/
+#define     DFMT_S390           0x1111
 #define     DFMT_SUN            0x1111
 #define     DFMT_SUN_INTEL      0x4441
 #define     DFMT_ALLIANT        0x1111
@@ -62,6 +63,7 @@
 #define     DFMT_CTSS           0x3331
 #define     DFMT_VAX            0x2221
 #define     DFMT_MIPSEL         0x4441
+#define     DFMT_MIPSEB         0x1111
 #define     DFMT_PC             0x4441
 #define     DFMT_APPLE          0x1111
 #define     DFMT_APPLE_INTEL    0x4441
@@ -75,6 +77,12 @@
 #define     DFMT_IA64           0x4441
 #define     DFMT_LINUX64        0x4441
 #define     DFMT_POWERPC64      0x1111
+#define     DFMT_POWERPC64LE    0x4441
+#define     DFMT_ARMV4L         0x4441
+#define     DFMT_AARCH64        0x4441
+#define     DFMT_X86_64         0x4441
+#define     DFMT_SH		0x4441
+#define     DFMT_SHEB		0x1111

 /* I/O library constants */
 #define UNIXUNBUFIO 1
@@ -288,7 +296,7 @@ typedef int               hdf_pint_t;

 #endif /* IBM6000 */

-#if defined(HP9000) || (!defined(__convexc__) && (defined(hpux) || defined(__hpux)))
+#if defined(HP9000) || (!defined(__convexc__) && (defined(hpux) || defined(__hpux) || defined(__hppa__)))

 #ifndef HP9000
 #define HP9000
@@ -347,6 +355,10 @@ typedef int               hdf_pint_t;
 /*  what each does */
 #define JMEMSYS         MEM_ANSI

+#ifdef __linux__
+#define FNAME_POST_UNDERSCORE
+#endif
+
 #endif /* HP9000 */

@@ -666,6 +678,410 @@ typedef int               hdf_pint_t;
 #endif /* !(defined(__APPLE__)) */

 /*-----------------------------------------------------*/
+#if defined (__linux__) && defined (__mc68000__)
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#define DF_MT             DFMT_MOTOROLA
+
+#ifndef VOID    /* The stupid windows.h header file uses a #define instead of a typedef */
+typedef void              VOID;
+#endif  /* end VOID */
+typedef void *            VOIDP;
+typedef char *            _fcd;
+typedef char              char8;
+typedef unsigned char     uchar8;
+typedef char              int8;
+typedef unsigned char     uint8;
+typedef short int         int16;
+typedef unsigned short int uint16;
+typedef long int          int32;
+typedef unsigned long int uint32;
+typedef int               intn;
+typedef unsigned int      uintn;
+typedef float             float32;
+typedef double            float64;
+typedef long              intf;     /* size of INTEGERs in Fortran compiler */
+typedef int               hdf_pint_t;   /* an integer the same size as a pointer */
+#define FNAME_POST_UNDERSCORE
+#define _fcdtocp(desc) (desc)
+
+#ifdef  HAVE_FMPOOL
+#define FILELIB PAGEBUFIO  /* enable page buffering */
+#else
+#define FILELIB UNIXBUFIO
+#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/m68k */
+
+#if defined (__linux__) && defined (__sparc__)
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#define DF_MT             DFMT_SUN
+
+#ifndef VOID    /* The stupid windows.h header file uses a #define instead of a typedef */
+typedef void              VOID;
+#endif  /* end VOID */
+typedef void *            VOIDP;
+typedef char *            _fcd;
+typedef char              char8;
+typedef unsigned char     uchar8;
+typedef char              int8;
+typedef unsigned char     uint8;
+typedef short int         int16;
+typedef unsigned short int uint16;
+#ifdef _LP64 /* 64-bit environment */
+typedef int               int32;
+typedef unsigned int      uint32;
+#else /* 32-bit environment */
+typedef long int          int32;
+typedef unsigned long int uint32;
+#endif
+typedef int               intn;
+typedef unsigned int      uintn;
+typedef float             float32;
+typedef double            float64;
+typedef long              intf;     /* size of INTEGERs in Fortran compiler */
+#ifdef _LP64 /* 64-bit environment */
+typedef long              hdf_pint_t;   /* an integer the same size as a pointer */
+#else /* 32-bit environment */
+typedef int               hdf_pint_t;   /* an integer the same size as a pointer */
+#endif
+#define FNAME_POST_UNDERSCORE
+#define _fcdtocp(desc) (desc)
+
+#ifdef  HAVE_FMPOOL
+#define FILELIB PAGEBUFIO  /* enable page buffering */
+#else
+#define FILELIB UNIXBUFIO
+#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/Sparc */
+
+#if defined (__linux__) && defined (__powerpc__) && !defined(__powerpc64__)
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#define DF_MT             DFMT_MOTOROLA
+
+#ifndef VOID    /* The stupid windows.h header file uses a #define instead of a typedef */
+typedef void              VOID;
+#endif  /* end 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 long int          int32;
+typedef unsigned long int uint32;
+typedef int               intn;
+typedef unsigned int      uintn;
+typedef float             float32;
+typedef double            float64;
+typedef long              intf;     /* size of INTEGERs in Fortran compiler */
+typedef int               hdf_pint_t;   /* an integer the same size as a pointer */
+#define FNAME_POST_UNDERSCORE
+#define _fcdtocp(desc) (desc)
+
+#ifdef  HAVE_FMPOOL
+#define FILELIB PAGEBUFIO  /* enable page buffering */
+#else
+#define FILELIB UNIXBUFIO
+#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/powerpc */
+
+#if defined (__linux__) && defined (__s390__)
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#define DF_MT             DFMT_S390
+
+#ifndef VOID    /* The stupid windows.h header file uses a #define instead of a typedef */
+typedef void              VOID;
+#endif  /* end 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;
+#ifdef _LP64 /* 64-bit environment */
+typedef int               int32;
+typedef unsigned int      uint32;
+#else /* 32-bit environment */
+typedef long int          int32;
+typedef unsigned long int uint32;
+#endif
+typedef int               intn;
+typedef unsigned int      uintn;
+typedef float             float32;
+typedef double            float64;
+typedef long              intf;     /* size of INTEGERs in Fortran compiler */
+#ifdef _LP64 /* 64-bit environment */
+typedef long              hdf_pint_t;   /* an integer the same size as a pointer */
+#else /* 32-bit environment */
+typedef int               hdf_pint_t;   /* an integer the same size as a pointer */
+#endif
+#define FNAME_POST_UNDERSCORE
+#define _fcdtocp(desc) (desc)
+
+#ifdef  HAVE_FMPOOL
+#define FILELIB PAGEBUFIO  /* enable page buffering */
+#else
+#define FILELIB UNIXBUFIO
+#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/s390 */
+
+#if defined (__linux__) && (defined (__MIPSEB__) || defined(__MIPSEL__))
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#if defined (__MIPSEB__)
+#define DF_MT             DFMT_MIPSEB
+#elif defined(__MIPSEL__)
+#define DF_MT		  DFMT_MIPSEL
+#endif
+
+#ifndef VOID    /* The stupid windows.h header file uses a #define instead of a typedef */
+typedef void              VOID;
+#endif  /* end 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 long              intf;     /* size of INTEGERs in Fortran compiler */
+typedef long int               hdf_pint_t;   /* an integer the same size as a pointer */
+#define FNAME_POST_UNDERSCORE
+#define _fcdtocp(desc) (desc)
+
+#ifdef  HAVE_FMPOOL
+#define FILELIB PAGEBUFIO  /* enable page buffering */
+#else
+#define FILELIB UNIXBUFIO
+#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/mips */
+
+#if defined (__linux__) && defined (__arm__)
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#define DF_MT             DFMT_ARMV4L
+
+#ifndef VOID    /* The stupid windows.h header file uses a #define instead of a typedef */
+typedef void              VOID;
+#endif  /* end 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 long              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)
+
+#ifdef  HAVE_FMPOOL
+#define FILELIB PAGEBUFIO  /* enable page buffering */
+#else
+#define FILELIB UNIXBUFIO
+#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/arm */
+
+#if defined (__linux__) && defined (__aarch64__)
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#define DF_MT             DFMT_AARCH64
+
+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/aarch64 */
+
 #if defined(NEXT) || defined(NeXT)

 #ifndef NEXT
@@ -928,7 +1344,11 @@ Please check your Makefile.

 #include <sys/file.h>               /* for unbuffered i/o stuff */
 #include <sys/stat.h>
-#define DF_MT             DFMT_POWERPC64
+#ifdef __LITTLE_ENDIAN__
+#define DF_MT DFMT_POWERPC64LE
+#else
+#define DF_MT DFMT_POWERPC64
+#endif
 typedef void              VOID;
 typedef void              *VOIDP;
 typedef char              *_fcd;
@@ -952,6 +1372,11 @@ typedef long              hdf_pint_t;
 #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: */
@@ -1097,6 +1522,8 @@ typedef long              hdf_pint_t;
 #define _fcdtocp(desc) (desc)
 #define FILELIB UNIXBUFIO

+#define BIG_LONGS
+
 /* 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;

 #endif /* IA64 */

+/* Renesas SuperH SH3(little/big)/SH4(little/big) */
+#if defined (__linux__) && defined(__sh__)
+
+#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 <fcntl.h>
+#include <sys/types.h>      /* for unbuffered file I/O */
+#include <sys/stat.h>
+#include <unistd.h>
+#include <ctype.h>          /* for character macros */
+
+#if defined (__LITTLE_ENDIAN__)
+#define DF_MT             DFMT_SH
+#elif defined(__BIG_ENDIAN__)
+#define DF_MT		  DFMT_SHEB
+#endif
+
+#ifndef VOID /* The stupid windows.h header file uses a #define instead of a typedef */
+typedef void              VOID;
+#endif  /* end 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 long int          int32;
+typedef unsigned long int uint32;
+typedef int               intn;
+typedef unsigned int      uintn;
+typedef float             float32;
+typedef double            float64;
+typedef long              intf;
+typedef int               hdf_pint_t;
+#define FNAME_POST_UNDERSCORE
+#define _fcdtocp(desc) (desc)
+
+#ifdef  HAVE_FMPOOL
+#define FILELIB PAGEBUFIO  /* enable page buffering */
+#else
+#define FILELIB UNIXBUFIO
+#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/sh */
+
 #ifndef GOT_MACHINE
 No machine type has been defined.  Your Makefile needs to have someing like
 -DSUN or -DUNICOS in order for the HDF internal structures to be defined
--- a/hdf/src/hconv.h
+++ b/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__)
+#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__)
 #       define UI8_IN     DFKnb1b   /* Unsigned Integer, 8 bits */
 #       define UI8_OUT    DFKnb1b
 #       define SI16_IN    DFKnb2b   /* S = Signed */


code:
Remove/patch unreproducible config data.

diff --git a/configure b/configure
index eb9f346..ebab94d 100755
--- a/configure
+++ b/configure
@@ -23163,7 +23163,7 @@ H4_VERSION="`cut -d' ' -f3 $srcdir/README.txt | head -1`"

 ## Configuration date
- CONFIG_DATE="`date`"
+CONFIG_DATE=`date -u -d "@$SOURCE_DATE_EPOCH"`

 ## User doing the configuration
  CONFIG_USER="`whoami`@`hostname`"
diff --git a/libhdf4.settings.in b/libhdf4.settings.in
index 1d9bbb9..4180d72 100644
--- a/libhdf4.settings.in
+++ b/libhdf4.settings.in
@@ -5,10 +5,10 @@ General Information:
 -------------------
 		   HDF4 Version: @H4_VERSION@
 		  Configured on: @CONFIG_DATE@
-		  Configured by: @CONFIG_USER@
+		  Configured by: guix
 		 Configure mode: @CONFIG_MODE@
-		    Host system: @host_cpu@-@host_vendor@-@host_os@
-              Uname information: @UNAME_INFO@
+		    Host system: guix
+              Uname information: guix
 		      Libraries: @STATIC_SHARED@
 	     Installation point: @prefix@

--
2.10.0


code:
Allow building a shared library with Fortran.
---
 configure | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/configure b/configure
index f37d2fa..eb9f346 100755
--- a/configure
+++ b/configure
@@ -6141,12 +6141,6 @@ if test "X${enable_shared}" != "Xyes"; then
     enable_shared="no"
 fi

-if test "X${enable_shared}" = "Xyes"; then
-    if test "X${BUILD_FORTRAN}" = "Xyes"; then
-        as_fn_error $? "Cannot build shared fortran libraries. Please configure with --disable-fortran flag." "$LINENO" 5
-    fi
-fi
-

 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
 $as_echo_n "checking whether ln -s works... " >&6; }
--
2.10.0


code:
Build with libtirpc on all architectures because glibc no longer provides
SunRPC support.

diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -23635,10 +23635,13 @@
   *-pc-cygwin*)
     LIBS="$LIBS -ltirpc"
     CPPFLAGS="$CPPFLAGS -I/usr/include/tirpc"  ;;
+  *-linux-gnu)
+    LIBS="$LIBS -ltirpc"
+    CPPFLAGS="$CPPFLAGS"  ;;
   *) ;;
 esac

-if test "X$BUILD_XDR" != "Xyes"; then
+if test "X$BUILD_XDR" = "Xyes"; then
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */

@@ -23693,9 +23696,9 @@
   ## but we need to make sure that it is present on the system. Do that here,
   ## The SunRPC of the glibc has been replaced by a TI-RPC (Transport Independent RPC) library for IPv6 support
   case "$host" in
-    *-pc-cygwin*)
+    *)
       HAVE_RPC="yes"
-      ac_fn_c_check_header_mongrel "$LINENO" "rpc.h" "ac_cv_header_rpc_h" "$ac_includes_default"
+      ac_fn_c_check_header_mongrel "$LINENO" "rpc/rpc.h" "ac_cv_header_rpc_h" "$ac_includes_default"
 if test "x$ac_cv_header_rpc_h" = xyes; then :
   :
 else


code:
Honor SOURCE_DATE_EPOCH when exporting configuration date.
Autoconf-level patch submitted upstream on Wed Apr 13 17:03:23 UTC 2016

--- a/configure
+++ b/configure
@@ -27737,7 +28573,14 @@

 ## Configuration date
- CONFIG_DATE="`date`"
+ CONFIG_DATE="`date -u`"
+if test -n "$SOURCE_DATE_EPOCH"; then
+  CONFIG_DATE=`date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null \
+               || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null`
+  if test -z "$CONFIG_DATE"; then
+    as_fn_error $? "malformed SOURCE_DATE_EPOCH" "$LINENO" 5
+  fi
+fi

 ## User doing the configuration
  CONFIG_USER="`whoami`@`hostname`"


code:
Add libera.chat to the list of available networks and make it the
default.

Patches copied from upstream source repository:

https://github.com/hexchat/hexchat/commit/a25f2381689d2c2279a0e43b33f6c0ec8305a096
https://github.com/hexchat/hexchat/commit/d3545f37cd5f551ed8bc0ab7b20e5c8140adc0a6

From a25f2381689d2c2279a0e43b33f6c0ec8305a096 Mon Sep 17 00:00:00 2001
From: Panagiotis Vasilopoulos <hello@alwayslivid.com>
Date: Wed, 19 May 2021 16:25:16 +0300
Subject: [PATCH] Add Libera Chat to network list

---
 src/common/servlist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/common/servlist.c b/src/common/servlist.c
index e44a3f2df..33bd80f2d 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -239,6 +239,9 @@ static const struct defaultserver def[] =
 	/* Self signed */
 	{0,			"irc.librairc.net"},

+	{"Libera Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE},
+	{0,			"irc.libera.chat"},
+
 #ifdef USE_OPENSSL
 	{"LinkNet",	0},
 	{0,			"irc.link-net.org/+7000"},
From d3545f37cd5f551ed8bc0ab7b20e5c8140adc0a6 Mon Sep 17 00:00:00 2001
From: Patrick Griffis <pgriffis@igalia.com>
Date: Sun, 23 May 2021 21:15:43 -0500
Subject: [PATCH] Change default network to Libera.Chat

---
 src/common/servlist.c | 4 ++--
 src/fe-gtk/joind.c    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/common/servlist.c b/src/common/servlist.c
index de75c8b9a..93557f975 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -240,7 +240,7 @@ static const struct defaultserver def[] =
 	/* Self signed */
 	{0,			"irc.librairc.net"},

-	{"Libera Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE},
+	{"Libera.Chat", 0, 0, 0, LOGIN_SASL, 0, TRUE},
 	{0,			"irc.libera.chat"},

 #ifdef USE_OPENSSL
@@ -942,7 +942,7 @@ servlist_load_defaults (void)
 {
 	int i = 0, j = 0;
 	ircnet *net = NULL;
-	guint def_hash = g_str_hash ("freenode");
+	guint def_hash = g_str_hash ("Libera.Chat");

 	while (1)
 	{
diff --git a/src/fe-gtk/joind.c b/src/fe-gtk/joind.c
index f1d3da504..ce3cbcaec 100644
--- a/src/fe-gtk/joind.c
+++ b/src/fe-gtk/joind.c
@@ -247,7 +247,7 @@ joind_show_dialog (server *serv)
 							G_CALLBACK (joind_ok_cb), serv);

 	if (serv->network)
-		if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "freenode") == 0)
+		if (g_ascii_strcasecmp(((ircnet*)serv->network)->name, "Libera.Chat") == 0)
 		{
 			gtk_entry_set_text (GTK_ENTRY (entry1), "#hexchat");
 		}


code:
From fc70ce08f5818a286fb5899a1bc3aff5965a745e Mon Sep 17 00:00:00 2001
From: Fedor Indutny <fedor@indutny.com>
Date: Wed, 18 Nov 2020 20:50:21 -0800
Subject: [PATCH] http: unset `F_CHUNKED` on new `Transfer-Encoding`

Duplicate `Transfer-Encoding` header should be a treated as a single,
but with original header values concatenated with a comma separator. In
the light of this, even if the past `Transfer-Encoding` ended with
`chunked`, we should be not let the `F_CHUNKED` to leak into the next
header, because mere presence of another header indicates that `chunked`
is not the last transfer-encoding token.

CVE-ID: CVE-2020-8287
PR-URL: https://github.com/nodejs-private/node-private/pull/235
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
---
 http_parser.c |  7 +++++++
 test.c        | 26 ++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/http_parser.c b/http_parser.c
index 9be003e7322..e9b2b9e83b9 100644
--- a/http_parser.c
+++ b/http_parser.c
@@ -1344,6 +1344,13 @@ size_t http_parser_execute (http_parser *parser,
               } else if (parser->index == sizeof(TRANSFER_ENCODING)-2) {
                 parser->header_state = h_transfer_encoding;
                 parser->uses_transfer_encoding = 1;
+
+                /* Multiple `Transfer-Encoding` headers should be treated as
+                 * one, but with values separate by a comma.
+                 *
+                 * See: https://tools.ietf.org/html/rfc7230#section-3.2.2
+                 */
+                parser->flags &= ~F_CHUNKED;
               }
               break;

diff --git a/test.c b/test.c
index 3f7c77b3494..2e5a9ebd678 100644
--- a/test.c
+++ b/test.c
@@ -2154,6 +2154,32 @@ const struct message responses[] =
   ,.body= "2\r\nOK\r\n0\r\n\r\n"
   ,.num_chunks_complete= 0
   }
+#define HTTP_200_DUPLICATE_TE_NOT_LAST_CHUNKED 30
+, {.name= "HTTP 200 response with `chunked` and duplicate Transfer-Encoding"
+  ,.type= HTTP_RESPONSE
+  ,.raw= "HTTP/1.1 200 OK\r\n"
+         "Transfer-Encoding: chunked\r\n"
+         "Transfer-Encoding: identity\r\n"
+         "\r\n"
+         "2\r\n"
+         "OK\r\n"
+         "0\r\n"
+         "\r\n"
+  ,.should_keep_alive= FALSE
+  ,.message_complete_on_eof= TRUE
+  ,.http_major= 1
+  ,.http_minor= 1
+  ,.status_code= 200
+  ,.response_status= "OK"
+  ,.content_length= -1
+  ,.num_headers= 2
+  ,.headers=
+    { { "Transfer-Encoding", "chunked" }
+    , { "Transfer-Encoding", "identity" }
+    }
+  ,.body= "2\r\nOK\r\n0\r\n\r\n"
+  ,.num_chunks_complete= 0
+  }
 };

 /* strnlen() is a POSIX.2008 addition. Can't rely on it being available so


code:
Traverse the entities hash's keys in sorted order to ensure reproducibility.

--- libhubbub-0.3.3/build/make-entities.pl
+++ libhubbub-0.3.3/build/make-entities.pl
@@ -86,7 +86,7 @@

 my $trie;

-foreach my $key (keys %entities) {
+foreach my $key (sort keys %entities) {
    $trie = insert_node($trie, $key, $entities{$key});
 }


code:
This fixes linking libfstest/test-fcntl (and others).

As discussed with upstream: https://lists.gnu.org/archive/html/bug-hurd/2020-03/msg00018.html

From 96a9f67a8685e713f25259c18306797d54cc27a5 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 14 Mar 2020 11:28:31 +0100
Subject: [PATCH] build: Fix cross build on Guix.

As discussed in https://lists.gnu.org/archive/html/bug-hurd/2020-03/msg00018.html.

* Makeconf (lpath): Add -Wl,-rpath-link=<dir> next to -L<dir>.
---
 Makeconf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makeconf b/Makeconf
index 67f7ab1c..f68ff6e3 100644
--- a/Makeconf
+++ b/Makeconf
@@ -325,7 +325,8 @@ _libsubst=${libsubst$(patsubst %,-override,${libsubst-override})}

 # Direct the linker where to find shared objects specified in the
 # dependencies of other shared objects it encounters.
-lpath := -L. $(patsubst %,-L%,$(dir $(wildcard ../lib*/lib*.so)))
+lib_dirs := $(dir $(wildcard ../lib*/lib*.so))
+lpath := -L. $(lib_dirs:%=-L%) $(lib_dirs:%=-Wl,-rpath-link=%)

 # Main rule to link executables
 #
--
2.24.0


code:
From 75cb948c575fca3962c4cce115d31dd178bc389f Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" <janneke@gnu.org>
Date: Tue, 12 May 2020 07:39:59 +0200
Subject: [PATCH] ext2fs: Update to upstream Hurd-reserved xattr index for
 "gnu.*".

See
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3980bd3b406addb327d858aebd19e229ea340b9a

This supports setting (and reading) of passive trasnlators from
GNU/Linux, e.g.

    dd if=/dev/zero of=file bs=1k count=1000
    losetup /dev/loop0 file
    mke2fs -t ext2 -o hurd -O ext_attr /dev/loop0
    mount -t ext2 -o x-xattr-translator-records /dev/loop0 /mnt
    mkdir -p /mnt/servers/socket
    touch /mnt/servers/socket/1
    setfattr --name=gnu.translator --value='/hurd/pflocal\0' /mnt/servers/socket/1
    getfattr --name=gnu.translator /mnt/servers/socket/1
    # file: 1
    gnu.translator="/hurd/pflocal"

* ext2fs/xattr.c (struct _xattr_prefix): For "gnu.*", use index for
the Hurd (10).
---
 ext2fs/xattr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c
index f6ea0f39..78458214 100644
--- a/ext2fs/xattr.c
+++ b/ext2fs/xattr.c
@@ -1,6 +1,6 @@
  /* Ext2 support for extended attributes

-   Copyright (C) 2006, 2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2016, 2020 Free Software Foundation, Inc.

    Written by Thadeu Lima de Souza Cascardo <cascardo@dcc.ufmg.br>
    and Shengyu Zhang <lastavengers@outlook.com>
@@ -39,7 +39,7 @@ xattr_prefixes[] =
   {
   1, "user.", sizeof "user." - 1},
   {
-  7, "gnu.", sizeof "gnu." - 1},
+  10, "gnu.", sizeof "gnu." - 1},
   {
   0, NULL, 0}
 };
--
2.26.0


code:
--- hydra-20150407.4c0e3e4/tests/evaluation-tests.pl	2015-04-15 12:00:19.000000000 -0500
+++ hydra-20150407.4c0e3e4/tests/evaluation-tests.pl	2015-04-17 08:53:04.940301471 -0500
@@ -7,7 +7,7 @@

 my $db = Hydra::Model::DB->new;

-use Test::Simple tests => 72;
+use Test::Simple tests => 68;

 hydra_setup($db);

@@ -103,13 +103,6 @@
         uri => "$jobsBaseUri/hg-repo",
         update => getcwd . "/jobs/hg-update.sh"
     },
-    {
-        name => "darcs",
-        nixexpr => "darcs-input.nix",
-        type => "darcs",
-        uri => "$jobsBaseUri/darcs-repo",
-        update => getcwd . "/jobs/darcs-update.sh"
-    }
 );

 foreach my $scm ( @scminputs ) {


code:
Fixes needed when avoiding bundled libraries.

--- icecat-60.5.0/xpcom/build/moz.build.orig	2018-09-13 17:46:49.000000000 -0400
+++ icecat-60.5.0/xpcom/build/moz.build	2018-09-22 04:26:50.659564554 -0400
@@ -99,10 +99,5 @@
     '/docshell/base',
 ]

-if CONFIG['MOZ_VPX']:
-    LOCAL_INCLUDES += [
-        '/media/libvpx',
-    ]
-
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     CXXFLAGS += CONFIG['TK_CFLAGS']
--- icecat-60.5.0/storage/moz.build.orig	2018-09-13 17:51:11.000000000 -0400
+++ icecat-60.5.0/storage/moz.build	2018-09-22 04:26:50.659564554 -0400
@@ -117,7 +117,6 @@
     DEFINES['MOZ_MEMORY_TEMP_STORE_PRAGMA'] = True

 LOCAL_INCLUDES += [
-    '/db/sqlite3/src',
     '/dom/base',
 ]

--- icecat-60.5.0/dom/indexedDB/moz.build.orig	2018-09-13 17:49:42.000000000 -0400
+++ icecat-60.5.0/dom/indexedDB/moz.build	2018-09-22 04:26:50.663564574 -0400
@@ -102,7 +102,6 @@
     CXXFLAGS += ['-Wno-error=shadow']

 LOCAL_INCLUDES += [
-    '/db/sqlite3/src',
     '/dom/base',
     '/dom/storage',
     '/ipc/glue',
--- icecat-60.5.0/media/webrtc/trunk/webrtc/base/rtc_task_queue_gn/moz.build.orig	2018-09-13 17:40:54.000000000 -0400
+++ icecat-60.5.0/media/webrtc/trunk/webrtc/base/rtc_task_queue_gn/moz.build	2018-09-23 21:33:12.319975105 -0400
@@ -130,11 +130,6 @@
     DEFINES["WEBRTC_POSIX"] = True
     DEFINES["_FILE_OFFSET_BITS"] = "64"

-    LOCAL_INCLUDES += [
-        "/ipc/chromium/src/third_party/libevent/include/",
-        "/ipc/chromium/src/third_party/libevent/linux/"
-    ]
-
     UNIFIED_SOURCES += [
         "/media/webrtc/trunk/webrtc/base/task_queue_libevent.cc",
         "/media/webrtc/trunk/webrtc/base/task_queue_posix.cc"


code:
Make some of the changes needed to the 'makeicecat' script, to allow it to run
in a snippet without network access.  After this patch is applied, some
additional changes will be made using 'substitute*'.

diff --git a/makeicecat b/makeicecat
index 8be2362..48716f2 100755
--- a/makeicecat
+++ b/makeicecat
@@ -31,55 +31,55 @@ SOURCEDIR=icecat-$FFVERSION

 DATA="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"/data

-mkdir -p output
-cd output
+# mkdir -p output
+# cd output

 ###############################################################################
 # Retrieve FF source code
 ###############################################################################

-rm mozilla-esr${FFMAJOR} $SOURCEDIR -rf
-
-wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz
-wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc
-gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353
-gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc
-echo -n 1aa041db28cd742e93d663a9da8defd33040b38d8b9470350538473251621643 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
-
-echo Extracting Firefox tarball
-tar -xf firefox-${FFVERSION}esr.source.tar.xz
-
-mv firefox-${FFVERSION} $SOURCEDIR
+# rm mozilla-esr${FFMAJOR} $SOURCEDIR -rf
+#
+# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz
+# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc
+# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353
+# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc
+# echo -n 1aa041db28cd742e93d663a9da8defd33040b38d8b9470350538473251621643 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c -
+#
+# echo Extracting Firefox tarball
+# tar -xf firefox-${FFVERSION}esr.source.tar.xz
+#
+# mv firefox-${FFVERSION} $SOURCEDIR

 ###############################################################################
 # Retrieve l10n
 ###############################################################################

-mkdir l10n
-cd l10n
-while read line;do
-    line=$(echo $line |cut -d' ' -f1)
-    #[ $line = "es-ES" ] || continue # To speed up testing
-    [ $line = "en-US" ] && continue
-    hg clone https://hg.mozilla.org/l10n-central/$line
-    mkdir -p $line/browser/chrome/browser/preferences
-    touch $line/browser/chrome/browser/preferences/advanced-scripts.dtd
-    rm -rf $line/.hg*
-done < ../$SOURCEDIR/browser/locales/shipped-locales
-cd ..
-
-mv l10n $SOURCEDIR
-
-hg clone https://hg.mozilla.org/l10n/compare-locales/
-cd compare-locales/
-hg checkout RELEASE_8_0_0
-cd ..
-rm compare-locales/.hg* compare-locales/.git* -rf
-mv compare-locales $SOURCEDIR/l10n
+# mkdir l10n
+# cd l10n
+# while read line;do
+#     line=$(echo $line |cut -d' ' -f1)
+#     #[ $line = "es-ES" ] || continue # To speed up testing
+#     [ $line = "en-US" ] && continue
+#     hg clone https://hg.mozilla.org/l10n-central/$line
+#     mkdir -p $line/browser/chrome/browser/preferences
+#     touch $line/browser/chrome/browser/preferences/advanced-scripts.dtd
+#     rm -rf $line/.hg*
+# done < ../$SOURCEDIR/browser/locales/shipped-locales
+# cd ..
+#
+# mv l10n $SOURCEDIR
+#
+# hg clone https://hg.mozilla.org/l10n/compare-locales/
+# cd compare-locales/
+# hg checkout RELEASE_8_0_0
+# cd ..
+# rm compare-locales/.hg* compare-locales/.git* -rf
+# mv compare-locales $SOURCEDIR/l10n

 #######################################################

-cd $SOURCEDIR
+# cd $SOURCEDIR

 shopt -s nullglob
 for patch in $DATA/patches/*.patch; do
@@ -598,6 +598,6 @@ sed 's/777/755/;' -i toolkit/crashreporter/google-breakpad/Makefile.in
 # Fix CVE-2012-3386
 /bin/sed 's/chmod a+w/chmod u+w/' -i ./js/src/ctypes/libffi/Makefile.in ./toolkit/crashreporter/google-breakpad/Makefile.in ./toolkit/crashreporter/google-breakpad/src/third_party/glog/Makefile.in || true

-cd ..
-echo Packaging tarball
-tar cfj icecat-$ICECATVERSION.tar.bz2 $SOURCEDIR
+# cd ..
+# echo Packaging tarball
+# tar cfj icecat-$ICECATVERSION.tar.bz2 $SOURCEDIR


code:
From 2e8618d22568b6e00892a17303d437dd700eca98 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Tue, 5 May 2020 21:27:41 -0400
Subject: [PATCH] Revert "Update Reveal hidden HTML."

I prefer the user interface of the old version.

This reverts commit f6e3adb6b2344ee2c7bb453a305fd2d6fb4c194c.
---
 .../passive_improve_css.js                    | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js b/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js
index 7692990..ca57982 100644
--- a/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js
+++ b/data/extensions/SubmitMe@0xbeef.coffee/passive_improve_css.js
@@ -10,6 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
 */

+var bad = [];
+
 function escapeHTML (unsafe_str) {
     return unsafe_str
       .replace(/&/g, '&')
@@ -20,9 +22,14 @@ function escapeHTML (unsafe_str) {
       .replace(/\//g, '/')
 }

+function dounhide(){
+        for(var i = 0; i < bad.length; i++){
+                        bad[i].remove();
+                }
+}
+
 console.log("passive_improve_css.js");
 function reveal_css(){
-	var bad = [];

 	var elements = document.getElementsByTagName("style");
 	for(var i = 0; i < elements.length; i++){
@@ -41,16 +48,20 @@ function reveal_css(){

 		}
 	}
-	if(bad.length > 0 && window.confirm("Hidden HTML detected, would you like to reveal it?")){
-		for(var i = 0; i < bad.length; i++){
-			bad[i].remove();
-		}
+	if(bad.length > 0){
+		const insertedDiv = document.createElement('div');
+		insertedDiv.innerHTML= '
' +
+	                'Reveal hidden elements' +
+			'';
+		insertedDiv.style="position:fixed; bottom:1em; right:1em; opacity:0.8; z-index: 2147483647 !important; border-radius: 3px !important; background-color: #fff !important; padding: 0.5em !important;   box-shadow: 0 0 3px grey !important; font-color:#bbb!important; cursor: pointer!important;";
+		insertedDiv.addEventListener("click", dounhide, false);
+		document.body.insertBefore(insertedDiv, document.body.firstChild);
 	}
 }

 reveal_css();

-
 /*
 var a = document.getElementsByTagName("style")[2];
 var btn = document.createElement("style");        // Create a <button> element
--
2.26.2


code:
Allow building against system-wide graphite2/harfbuzz.
See <https://bugzilla.mozilla.org/show_bug.cgi?id=847568>
Based on:
  https://svnweb.freebsd.org/ports/head/www/firefox-esr/files/patch-bug847568?revision=472833&view=co
Modified for use with patch -p1, and to apply cleanly to GNU IceCat.

--- icecat-60.5.0/config/system-headers.mozbuild
+++ icecat-60.5.0/config/system-headers.mozbuild
@@ -1311,6 +1311,19 @@
         'pixman.h',
     ]

+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+    system_headers += [
+        'graphite2/Font.h',
+        'graphite2/Segment.h',
+    ]
+
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    system_headers += [
+        'harfbuzz/hb-glib.h',
+        'harfbuzz/hb-ot.h',
+        'harfbuzz/hb.h',
+    ]
+
 if CONFIG['MOZ_SYSTEM_LIBVPX']:
     system_headers += [
         'vpx_mem/vpx_mem.h',
--- icecat-60.5.0/dom/base/moz.build
+++ icecat-60.5.0/dom/base/moz.build
@@ -474,6 +474,9 @@
 if CONFIG['MOZ_X11']:
     CXXFLAGS += CONFIG['TK_CFLAGS']

+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 GENERATED_FILES += [
     'PropertyUseCounterMap.inc',
     'UseCounterList.h',
--- icecat-60.5.0/gfx/graphite2/moz-gr-update.sh
+++ icecat-60.5.0/gfx/graphite2/moz-gr-update.sh
@@ -1,6 +1,7 @@
 #!/bin/bash

 # Script used to update the Graphite2 library in the mozilla source tree
+# and bump version for --with-system-graphite2

 # This script lives in gfx/graphite2, along with the library source,
 # but must be run from the top level of the mozilla-central tree.
@@ -37,12 +38,16 @@ echo "See" $0 "for update procedure." >> gfx/graphite2/README.mozilla
 #find gfx/graphite2/ -name "*.cpp" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;
 #find gfx/graphite2/ -name "*.h" -exec perl -p -i -e "s/<cstdio>/<stdio.h>/;s/Windows.h/windows.h/;" {} \;

+# chase version for --with-system-graphite2
+perl -p -i -e "s/[0-9]+\,[0-9]+\,[0-9]+/$RELEASE/ and tr/./,/ \
+  if /GR2_VERSION_REQUIRE/" old-configure.in
+
 # summarize what's been touched
 echo Updated to $RELEASE.
 echo Here is what changed in the gfx/graphite2 directory:
 echo

-hg stat gfx/graphite2
+hg stat old-configure.in gfx/graphite2

 echo
 echo If gfx/graphite2/src/files.mk has changed, please make corresponding
--- icecat-60.5.0/gfx/moz.build
+++ icecat-60.5.0/gfx/moz.build
@@ -10,6 +10,12 @@ with Files('**'):
 if CONFIG['MOZ_TREE_CAIRO']:
     DIRS += ['cairo']

+if not CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+    DIRS += ['graphite2/src' ]
+
+if not CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    DIRS += ['harfbuzz/src']
+
 DIRS += [
     '2d',
     'ycbcr',
@@ -18,8 +24,6 @@ DIRS += [
     'qcms',
     'gl',
     'layers',
-    'graphite2/src',
-    'harfbuzz/src',
     'ots/src',
     'thebes',
     'ipc',
--- icecat-60.5.0/gfx/skia/generate_mozbuild.py
+++ icecat-60.5.0/gfx/skia/generate_mozbuild.py
@@ -148,6 +148,9 @@
         '-Wno-unused-private-field',
     ]

+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
--- icecat-60.5.0/gfx/skia/moz.build
+++ icecat-60.5.0/gfx/skia/moz.build
@@ -822,6 +822,9 @@
         '-Wno-unused-private-field',
     ]

+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk3', 'android'):
     CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
     CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
--- icecat-60.5.0/gfx/thebes/moz.build
+++ icecat-60.5.0/gfx/thebes/moz.build
@@ -272,7 +272,13 @@

 LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']

-DEFINES['GRAPHITE2_STATIC'] = True
+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+    CXXFLAGS += CONFIG['MOZ_GRAPHITE2_CFLAGS']
+else:
+    DEFINES['GRAPHITE2_STATIC'] = True
+
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']

 if CONFIG['CC_TYPE'] == 'clang':
     # Suppress warnings from Skia header files.
--- icecat-60.5.0/intl/unicharutil/util/moz.build
+++ icecat-60.5.0/intl/unicharutil/util/moz.build
@@ -25,4 +25,7 @@ UNIFIED_SOURCES += [
     'nsUnicodeProperties.cpp',
 ]

+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
+
 FINAL_LIBRARY = 'xul'
--- icecat-60.5.0/netwerk/dns/moz.build
+++ icecat-60.5.0/netwerk/dns/moz.build
@@ -76,3 +76,6 @@

 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
+
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    CXXFLAGS += CONFIG['MOZ_HARFBUZZ_CFLAGS']
--- icecat-60.5.0/old-configure.in
+++ icecat-60.5.0/old-configure.in
@@ -3971,6 +3971,27 @@
 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)

 dnl ========================================================
+dnl Check for graphite2
+dnl ========================================================
+if test -n "$MOZ_SYSTEM_GRAPHITE2"; then
+    dnl graphite2.pc has bogus version, check manually
+    _SAVE_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS $MOZ_GRAPHITE2_CFLAGS"
+    AC_TRY_COMPILE([ #include <graphite2/Font.h>
+                     #define GR2_VERSION_REQUIRE(major,minor,bugfix)  \
+                             ( GR2_VERSION_MAJOR * 10000 + GR2_VERSION_MINOR \
+                               * 100 + GR2_VERSION_BUGFIX >= \
+                               (major) * 10000 + (minor) * 100 + (bugfix) )
+                   ], [
+                     #if !GR2_VERSION_REQUIRE(1,3,10)
+                     #error "Insufficient graphite2 version."
+                     #endif
+                   ], [],
+                   [AC_MSG_ERROR([--with-system-graphite2 requested but no working libgraphite2 found])])
+    CFLAGS=$_SAVE_CFLAGS
+fi
+
+dnl ========================================================
 dnl Check for pixman and cairo
 dnl ========================================================

--- icecat-60.5.0/toolkit/library/moz.build
+++ icecat-60.5.0/toolkit/library/moz.build
@@ -235,6 +235,12 @@
 if CONFIG['MOZ_SYSTEM_PNG']:
     OS_LIBS += CONFIG['MOZ_PNG_LIBS']

+if CONFIG['MOZ_SYSTEM_GRAPHITE2']:
+    OS_LIBS += CONFIG['MOZ_GRAPHITE2_LIBS']
+
+if CONFIG['MOZ_SYSTEM_HARFBUZZ']:
+    OS_LIBS += CONFIG['MOZ_HARFBUZZ_LIBS']
+
 if CONFIG['MOZ_SYSTEM_HUNSPELL']:
     OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']

--- icecat-60.5.0/toolkit/moz.configure
+++ icecat-60.5.0/toolkit/moz.configure
@@ -1051,6 +1051,26 @@
 add_old_configure_assignment('FT2_CFLAGS',
                              ft2_info.cflags)

+# Graphite2
+# ==============================================================
+option('--with-system-graphite2',
+       help="Use system graphite2 (located with pkgconfig)")
+
+system_graphite2 = pkg_check_modules('MOZ_GRAPHITE2', 'graphite2',
+                                     when='--with-system-graphite2')
+
+set_config('MOZ_SYSTEM_GRAPHITE2', depends_if(system_graphite2)(lambda _: True))
+
+# HarfBuzz
+# ==============================================================
+option('--with-system-harfbuzz',
+       help="Use system harfbuzz (located with pkgconfig)")
+
+system_harfbuzz = pkg_check_modules('MOZ_HARFBUZZ', 'harfbuzz >= 1.7.4',
+                                    when='--with-system-harfbuzz')
+
+set_config('MOZ_SYSTEM_HARFBUZZ', depends_if(system_harfbuzz)(lambda _: True))
+
 # Mortar
 # ==============================================================
 option('--enable-mortar', help='Enable mortar extension')


code:
Support building with system media libraries.
See <https://bugzilla.mozilla.org/show_bug.cgi?id=517422>

Based on:
  https://svnweb.freebsd.org/ports/head/www/firefox-esr/files/patch-z-bug517422?revision=472833&view=markup

Changes to files within the bundled libraries are omitted, since those files
are removed from Guix sources.  Modified for use with patch -p1, and to apply
cleanly to GNU IceCat.

--- icecat-60.5.0/build/moz.configure/old.configure
+++ icecat-60.5.0/build/moz.configure/old.configure
@@ -273,7 +273,12 @@
     '--with-system-libvpx',
     '--with-system-nspr',
     '--with-system-nss',
+    '--with-system-ogg',
     '--with-system-png',
+    '--with-system-soundtouch',
+    '--with-system-theora',
+    '--with-system-tremor',
+    '--with-system-vorbis',
     '--with-system-zlib',
     '--with-thumb',
     '--with-thumb-interwork',
--- icecat-60.5.0/config/external/moz.build
+++ icecat-60.5.0/config/external/moz.build
@@ -23,12 +23,21 @@

 external_dirs += ['modules/xz-embedded']

-if CONFIG['MOZ_VORBIS']:
+if not CONFIG['MOZ_SYSTEM_OGG']:
+    external_dirs += ['media/libogg']
+
+if CONFIG['MOZ_VORBIS'] and not CONFIG['MOZ_SYSTEM_VORBIS']:
     external_dirs += ['media/libvorbis']

-if CONFIG['MOZ_TREMOR']:
+if CONFIG['MOZ_TREMOR'] and not CONFIG['MOZ_SYSTEM_TREMOR']:
     external_dirs += ['media/libtremor']

+if not CONFIG['MOZ_SYSTEM_THEORA']:
+    external_dirs += ['media/libtheora']
+
+if not CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
+    external_dirs += ['media/libsoundtouch']
+
 if CONFIG['MOZ_WEBM_ENCODER']:
     external_dirs += ['media/libmkv']

@@ -51,11 +60,8 @@
     'media/kiss_fft',
     'media/libcubeb',
     'media/libnestegg',
-    'media/libogg',
     'media/libopus',
-    'media/libtheora',
     'media/libspeex_resampler',
-    'media/libsoundtouch',
     'media/mp4parse-rust',
     'media/psshparser'
 ]
--- icecat-60.5.0/config/system-headers.mozbuild
+++ icecat-60.5.0/config/system-headers.mozbuild
@@ -1324,6 +1324,28 @@
         'harfbuzz/hb.h',
     ]

+if CONFIG['MOZ_SYSTEM_OGG']:
+    system_headers += [
+        'ogg/ogg.h',
+        'ogg/os_types.h',
+    ]
+
+if CONFIG['MOZ_SYSTEM_THEORA']:
+    system_headers += [
+        'theora/theoradec.h',
+    ]
+
+if CONFIG['MOZ_SYSTEM_VORBIS']:
+    system_headers += [
+        'vorbis/codec.h',
+        'vorbis/vorbisenc.h',
+    ]
+
+if CONFIG['MOZ_SYSTEM_TREMOR']:
+    system_headers += [
+        'tremor/ivorbiscodec.h',
+    ]
+
 if CONFIG['MOZ_SYSTEM_LIBVPX']:
     system_headers += [
         'vpx_mem/vpx_mem.h',
--- icecat-60.5.0/dom/media/AudioStream.cpp
+++ icecat-60.5.0/dom/media/AudioStream.cpp
@@ -128,7 +128,9 @@
     : mMonitor("AudioStream"),
       mChannels(0),
       mOutChannels(0),
+#ifndef MOZ_SYSTEM_SOUNDTOUCH
       mTimeStretcher(nullptr),
+#endif
       mDumpFile(nullptr),
       mState(INITIALIZED),
       mDataSource(aSource),
@@ -147,9 +149,11 @@
   if (mDumpFile) {
     fclose(mDumpFile);
   }
+#ifndef MOZ_SYSTEM_SOUNDTOUCH
   if (mTimeStretcher) {
     soundtouch::destroySoundTouchObj(mTimeStretcher);
   }
+#endif
 #if defined(XP_WIN)
   if (XRE_IsContentProcess()) {
     audio::AudioNotificationReceiver::Unregister(this);
@@ -170,7 +174,11 @@
 nsresult AudioStream::EnsureTimeStretcherInitializedUnlocked() {
   mMonitor.AssertCurrentThreadOwns();
   if (!mTimeStretcher) {
+#ifdef MOZ_SYSTEM_SOUNDTOUCH
+    mTimeStretcher = new soundtouch::SoundTouch();
+#else
     mTimeStretcher = soundtouch::createSoundTouchObj();
+#endif
     mTimeStretcher->setSampleRate(mAudioClock.GetInputRate());
     mTimeStretcher->setChannels(mOutChannels);
     mTimeStretcher->setPitch(1.0);
--- icecat-60.5.0/dom/media/AudioStream.h
+++ icecat-60.5.0/dom/media/AudioStream.h
@@ -15,7 +15,11 @@
 #include "mozilla/TimeStamp.h"
 #include "mozilla/UniquePtr.h"
 #include "CubebUtils.h"
+#ifdef MOZ_SYSTEM_SOUNDTOUCH
+#include "soundtouch/SoundTouch.h"
+#else
 #include "soundtouch/SoundTouchFactory.h"
+#endif

 #if defined(XP_WIN)
 #include "mozilla/audio/AudioNotificationReceiver.h"
@@ -293,7 +297,11 @@
   uint32_t mChannels;
   uint32_t mOutChannels;
   AudioClock mAudioClock;
+#ifdef MOZ_SYSTEM_SOUNDTOUCH
+  nsAutoPtr<soundtouch::SoundTouch> mTimeStretcher;
+#else
   soundtouch::SoundTouch* mTimeStretcher;
+#endif

   // Output file for dumping audio
   FILE* mDumpFile;
--- icecat-60.5.0/dom/media/moz.build
+++ icecat-60.5.0/dom/media/moz.build
@@ -327,6 +327,21 @@

 DEFINES['MOZILLA_INTERNAL_API'] = True

+if CONFIG['MOZ_SYSTEM_OGG']:
+    CXXFLAGS += CONFIG['MOZ_OGG_CFLAGS']
+
+if CONFIG['MOZ_SYSTEM_THEORA']:
+    CXXFLAGS += CONFIG['MOZ_THEORA_CFLAGS']
+
+if CONFIG['MOZ_SYSTEM_VORBIS']:
+    CXXFLAGS += CONFIG['MOZ_VORBIS_CFLAGS']
+
+if CONFIG['MOZ_SYSTEM_TREMOR']:
+    CXXFLAGS += CONFIG['MOZ_TREMOR_CFLAGS']
+
+if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
+    CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS']
+
 if CONFIG['MOZ_ANDROID_HLS_SUPPORT']:
     DEFINES['MOZ_ANDROID_HLS_SUPPORT'] = True

--- icecat-60.5.0/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
+++ icecat-60.5.0/dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
@@ -15,9 +15,13 @@
 #include <windows.h>
 #endif

+#ifdef MOZ_SYSTEM_SOUNDTOUCH
+#include "nsXPCOMPrivate.h" // for XUL_DLL
+#else
 // We use a known symbol located in lgpllibs to determine its location.
 // soundtouch happens to be always included in lgpllibs
 #include "soundtouch/SoundTouch.h"
+#endif

 namespace mozilla {

@@ -60,6 +64,12 @@

   sLinkStatus = LinkStatus_FAILED;

+#ifdef MOZ_SYSTEM_SOUNDTOUCH
+  // We retrieve the path of the XUL library as this is where mozavcodec and
+  // mozavutil libs are located.
+  char* path =
+    PR_GetLibraryFilePathname(XUL_DLL, (PRFuncPtr)&FFVPXRuntimeLinker::Init);
+#else
   // We retrieve the path of the lgpllibs library as this is where mozavcodec
   // and mozavutil libs are located.
   PathString lgpllibsname = GetLibraryName(nullptr, "lgpllibs");
@@ -68,6 +78,7 @@
   }
   PathString path = GetLibraryFilePathname(
       lgpllibsname.get(), (PRFuncPtr)&soundtouch::SoundTouch::getVersionId);
+#endif
   if (path.IsEmpty()) {
     return false;
   }
--- icecat-60.5.0/old-configure.in
+++ icecat-60.5.0/old-configure.in
@@ -2417,6 +2417,111 @@
 fi
 fi # COMPILE_ENVIRONMENT

+dnl ========================================================
+dnl Check for libogg
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-ogg,
+[  --with-system-ogg       Use system libogg (located with pkgconfig)],
+MOZ_SYSTEM_OGG=1,
+MOZ_SYSTEM_OGG=)
+
+if test -n "$MOZ_SYSTEM_OGG"; then
+    PKG_CHECK_MODULES(MOZ_OGG, ogg >= 1.3.3)
+
+    _SAVE_LIBS=$LIBS
+    LIBS="$LIBS $MOZ_OGG_LIBS"
+    AC_CHECK_FUNC(ogg_set_mem_functions, [],
+      [AC_DEFINE(MOZ_OGG_NO_MEM_REPORTING)])
+    LIBS=$_SAVE_LIBS
+fi
+
+AC_SUBST(MOZ_SYSTEM_OGG)
+
+dnl ========================================================
+dnl Check for libvorbis
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-vorbis,
+[  --with-system-vorbis    Use system libvorbis (located with pkgconfig)],
+MOZ_SYSTEM_VORBIS=1,
+MOZ_SYSTEM_VORBIS=)
+
+if test -n "$MOZ_SYSTEM_VORBIS"; then
+    PKG_CHECK_MODULES(MOZ_VORBIS, vorbis vorbisenc >= 1.3.6)
+fi
+
+AC_SUBST(MOZ_SYSTEM_VORBIS)
+
+dnl ========================================================
+dnl Check for integer-only libvorbis aka tremor
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-tremor,
+[  --with-system-tremor    Use system libtremor (located with pkgconfig)],
+MOZ_SYSTEM_TREMOR=1,
+MOZ_SYSTEM_TREMOR=)
+
+if test -n "$MOZ_SYSTEM_TREMOR"; then
+    PKG_CHECK_MODULES(MOZ_TREMOR, vorbisidec >= 1.2.1)
+fi
+
+AC_SUBST(MOZ_SYSTEM_TREMOR)
+
+dnl ========================================================
+dnl Check for libtheora
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-theora,
+[  --with-system-theora    Use system libtheora (located with pkgconfig)],
+MOZ_SYSTEM_THEORA=1,
+MOZ_SYSTEM_THEORA=)
+
+if test -n "$MOZ_SYSTEM_THEORA"; then
+    PKG_CHECK_MODULES(MOZ_THEORA, theora >= 1.2)
+fi
+
+AC_SUBST(MOZ_SYSTEM_THEORA)
+
+dnl ========================================================
+dnl Check for libSoundTouch
+dnl ========================================================
+
+MOZ_ARG_WITH_BOOL(system-soundtouch,
+[  --with-system-soundtouch Use system libSoundTouch (located with pkgconfig)],
+MOZ_SYSTEM_SOUNDTOUCH=1,
+MOZ_SYSTEM_SOUNDTOUCH=)
+
+if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
+    PKG_CHECK_MODULES(MOZ_SOUNDTOUCH, soundtouch >= 1.9.0)
+
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    _SAVE_CXXFLAGS=$CXXFLAGS
+    CXXFLAGS="$CXXFLAGS $MOZ_SOUNDTOUCH_CFLAGS"
+    AC_CACHE_CHECK(for soundtouch sample type,
+                   ac_cv_soundtouch_sample_type,
+                   [AC_TRY_COMPILE([#include <SoundTouch.h>
+                                    #ifndef SOUNDTOUCH_INTEGER_SAMPLES
+                                    #error soundtouch expects float samples
+                                    #endif],
+                                   [],
+                                   [ac_cv_soundtouch_sample_type=short],
+                                   [ac_cv_soundtouch_sample_type=float])])
+    CXXFLAGS=$_SAVE_CXXFLAGS
+    AC_LANG_RESTORE
+
+    if test \( -n "$MOZ_SAMPLE_TYPE_S16" -a "$ac_cv_soundtouch_sample_type" != short \) \
+         -o \( -n "$MOZ_SAMPLE_TYPE_FLOAT32" -a "$ac_cv_soundtouch_sample_type" != float \) ; then
+        AC_MSG_ERROR([SoundTouch library is built with incompatible sample type. Either rebuild the library with/without --enable-integer-samples, chase default Mozilla sample type or remove --with-system-soundtouch.])
+    fi
+fi
+
+if test -n "$MOZ_SYSTEM_SOUNDTOUCH"; then
+    AC_DEFINE(MOZ_SYSTEM_SOUNDTOUCH)
+fi
+AC_SUBST(MOZ_SYSTEM_SOUNDTOUCH)
+
 dnl system libvpx Support
 dnl ========================================================
 MOZ_ARG_WITH_BOOL(system-libvpx,
--- icecat-60.5.0/toolkit/library/moz.build
+++ icecat-60.5.0/toolkit/library/moz.build
@@ -244,6 +244,21 @@
 if CONFIG['MOZ_SYSTEM_HUNSPELL']:
     OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']

+if CONFIG['MOZ_SYSTEM_OGG']:
+    OS_LIBS += CONFIG['MOZ_OGG_LIBS']
+
+if CONFIG['MOZ_SYSTEM_THEORA']:
+    OS_LIBS += CONFIG['MOZ_THEORA_LIBS']
+
+if CONFIG['MOZ_SYSTEM_VORBIS']:
+    OS_LIBS += CONFIG['MOZ_VORBIS_LIBS']
+
+if CONFIG['MOZ_SYSTEM_TREMOR']:
+    OS_LIBS += CONFIG['MOZ_TREMOR_LIBS']
+
+if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
+    OS_LIBS += CONFIG['MOZ_SOUNDTOUCH_LIBS']
+
 if CONFIG['MOZ_SYSTEM_LIBEVENT']:
     OS_LIBS += CONFIG['MOZ_LIBEVENT_LIBS']

--- icecat-60.5.0/xpcom/build/XPCOMInit.cpp
+++ icecat-60.5.0/xpcom/build/XPCOMInit.cpp
@@ -139,7 +139,9 @@

 #include "mozilla/ipc/GeckoChildProcessHost.h"

+#ifndef MOZ_OGG_NO_MEM_REPORTING
 #include "ogg/ogg.h"
+#endif
 #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
 #if defined(HAVE_STDINT_H)
 // mozilla-config.h defines HAVE_STDINT_H, and then it's defined *again* in
@@ -635,10 +637,12 @@
   // this oddness.
   mozilla::SetICUMemoryFunctions();

+#ifndef MOZ_OGG_NO_MEM_REPORTING
   // Do the same for libogg.
   ogg_set_mem_functions(
       OggReporter::CountingMalloc, OggReporter::CountingCalloc,
       OggReporter::CountingRealloc, OggReporter::CountingFree);
+#endif

 #if defined(MOZ_VPX) && !defined(MOZ_VPX_NO_MEM_REPORTING)
   // And for VPX.