[libgap-sage] 01/01: WIP: zlib support
Jerome Benoit
calculus-guest at moszumanska.debian.org
Sun Dec 18 21:53:04 UTC 2016
This is an automated email from the git hooks/post-receive script.
calculus-guest pushed a commit to branch unstable-sage
in repository libgap-sage.
commit f9451af695380b1b062018d43a1737cab6c03957
Author: Jerome Benoit <calculus at rezozer.net>
Date: Sun Dec 18 18:45:57 2016 +0000
WIP: zlib support
---
debian/adhoc/examples/Makefile | 26 +-
debian/changelog | 6 +
debian/control | 4 +-
debian/libgap-sage-4.symbols.common | 5 +-
debian/patches/debianization-pkgconfig.patch | 6 +-
debian/patches/debianization.patch | 19 +-
...ap-ds-upstream-autotoolization-adaptation.patch | 52 ++
.../gap-ds-upstream-fix-zlib-stringfile.patch | 643 +++++++++++++++++++++
...-ds-upstream-neutralize-experimental-code.patch | 51 ++
...ap-ds-upstream-revert-fix-gzip-stringfile.patch | 152 +++++
debian/patches/gap-ds-upstream-test-zlib-add.patch | 77 +++
.../gap-ds-upstream-upstream-env-tmpdir.patch | 2 +-
debian/patches/series | 8 +-
.../upstream-autotoolization-test-systemwide.patch | 6 +-
...achinery-gnu_source_reserved_keywords-add.patch | 21 +
15 files changed, 1058 insertions(+), 20 deletions(-)
diff --git a/debian/adhoc/examples/Makefile b/debian/adhoc/examples/Makefile
index 9c0d645..13da2e3 100644
--- a/debian/adhoc/examples/Makefile
+++ b/debian/adhoc/examples/Makefile
@@ -21,6 +21,10 @@
#
PROGRAMS = $(patsubst %.c,%,$(wildcard *.c))
+CLEARSAMPLES = gapbanner.txt gapinfo.txt
+
+LISTOFCOMPRESSOR = gz #xz
+SAMPLES = $(CLEARSAMPLES) $(foreach _AZ, $(LISTOFCOMPRESSOR) ,$(addprefix $(_AZ), $(addsuffix .$(_AZ) ,$(CLEARSAMPLES))))
default: all
@@ -32,11 +36,29 @@ all: build
build: $(PROGRAMS)
-check: build
+check: build $(SAMPLES)
@$(foreach eg, $(PROGRAMS), echo "*** $(eg) ***" ; ./$(eg) ; )
clean:
+ $(RM) tmp_file.txt output.data output.data.gz
$(RM) $(PROGRAMS)
- $(RM) tmp_file.txt
+ $(RM) $(SAMPLES)
maintainer-clean: clean
+
+
+gapbanner.txt:
+ LC_ALL=C echo 'QUIT;' | $(CGAP) -T > $@
+
+gapinfo.txt:
+ LC_ALL=C echo 'GAPInfo; QUIT;' | $(CGAP) -T > $@
+
+
+gz%.gz: %
+ gzip --best -c $< > $@
+
+xz%.xz: %
+ xz --best -c $< > $@
+
+
+CGAP ?= /usr/bin/gap
diff --git a/debian/changelog b/debian/changelog
index 9381133..154ce37 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+libgap-sage (4.8.6+3+20160327g69a66f0+dsx-2~sage19~7) UNRELEASED; urgency=medium
+
+ * WIP: zlib support.
+
+ -- Jerome Benoit <calculus at rezozer.net> Sun, 18 Dec 2016 18:44:38 +0000
+
libgap-sage (4.8.6+3+20160327g69a66f0+dsx-1) unstable; urgency=medium
* New GAP upstream minor/patch release.
diff --git a/debian/control b/debian/control
index 21bd22d..787446c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,9 +4,9 @@ Priority: optional
Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
Uploaders: Jerome Benoit <calculus at rezozer.net>
Build-Depends:
- debhelper (>= 9), gnulib, dh-autoreconf, libtool, python-ply,
+ debhelper (>= 9), dh-autoreconf, gnulib, pkg-config, libtool, python-ply,
gap (>= 4r8p6), gap (<< 4r8p7),
- libgmp-dev
+ libgmp-dev, zlib1g-dev
Build-Depends-Indep:
Standards-Version: 3.9.8
Homepage: https://bitbucket.org/vbraun/libgap
diff --git a/debian/libgap-sage-4.symbols.common b/debian/libgap-sage-4.symbols.common
index f0d3c2d..63dd8e2 100644
--- a/debian/libgap-sage-4.symbols.common
+++ b/debian/libgap-sage-4.symbols.common
@@ -3070,6 +3070,8 @@ libgap-sage.so.4 libgap-sage-4 #MINVER#
libGAP_STD_ITER at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_STEVES_TRACING at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SUM_FFE_LARGE at LIBGAP_SAGE_4.8.6 4.8.6
+ libGAP_SYS_COOKIE_IO_GZ_FUNC at LIBGAP_SAGE_4.8.6 4.8.6
+ libGAP_SYS_FILE_AZIO_FOPEN at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SaveBlist at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SaveBody at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SaveBool at LIBGAP_SAGE_4.8.6 4.8.6
@@ -3225,6 +3227,7 @@ libgap-sage.so.4 libgap-sage-4 #MINVER#
libGAP_SyFindOrLinkGapRootFile at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyFopen at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyFputs at LIBGAP_SAGE_4.8.6 4.8.6
+ libGAP_SyFread at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyFseek at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyFtell at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyGAPCRC at LIBGAP_SAGE_4.8.6 4.8.6
@@ -3265,7 +3268,7 @@ libgap-sage.so.4 libgap-sage-4 #MINVER#
libGAP_SyPutc at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyQuiet at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyReadStringFid at LIBGAP_SAGE_4.8.6 4.8.6
- libGAP_SyReadStringFile at LIBGAP_SAGE_4.8.6 4.8.6
+ libGAP_SyReadStringZFile at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyRemoveFile at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyRestoring at LIBGAP_SAGE_4.8.6 4.8.6
libGAP_SyRmdir at LIBGAP_SAGE_4.8.6 4.8.6
diff --git a/debian/patches/debianization-pkgconfig.patch b/debian/patches/debianization-pkgconfig.patch
index 7f49e7a..6efe705 100644
--- a/debian/patches/debianization-pkgconfig.patch
+++ b/debian/patches/debianization-pkgconfig.patch
@@ -26,15 +26,15 @@ Last-Update: 2016-11-11
+Cflags: -I${includearchdir}/libgap-sage -I${includedir}/libgap-sage
--- a/configure.ac
+++ b/configure.ac
-@@ -11,6 +11,7 @@
- AC_CONFIG_HEADERS([src/config.h])
+@@ -12,6 +12,7 @@
+ AC_USE_SYSTEM_EXTENSIONS
AC_CONFIG_FILES([
+ libgap-sage.pc
Makefile
libgap/Makefile
src/Makefile
-@@ -188,14 +189,19 @@
+@@ -194,14 +195,19 @@
LIBGAP_VERSION_MICRO=${PACKAGE_VERSION##*.}
LIBGAP_VERSION_MICRO=${LIBGAP_VERSION_MICRO%-*}
LIBGAP_LT_VERSION="$(expr ${LIBGAP_VERSION_MAJOR} + ${LIBGAP_VERSION_MINOR}):${LIBGAP_VERSION_MICRO}:${LIBGAP_VERSION_MINOR}"
diff --git a/debian/patches/debianization.patch b/debian/patches/debianization.patch
index 0785e71..d71d47e 100644
--- a/debian/patches/debianization.patch
+++ b/debian/patches/debianization.patch
@@ -4,7 +4,7 @@ Description: debianization
Origin: vendor, Debian
Forwarded: not-needed
Author: Jerome Benoit <calculus at rezozer.net>
-Last-Update: 2016-11-18
+Last-Update: 2016-12-03
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -53,7 +53,7 @@ Last-Update: 2016-11-18
costab.h gvars.h objccoll.h range.h string.h \
pperm.h trans.h \
libgap.h libgap_internal.h \
-@@ -47,14 +48,17 @@
+@@ -47,14 +48,16 @@
objscoll-impl.h profile.h thread.h tls.h \
gap_version.h
@@ -61,13 +61,12 @@ Last-Update: 2016-11-18
+ config.h
-libgap_la_CFLAGS = $(AM_CFLAGS) \
-+
+libgap_sage_la_CFLAGS = $(AM_CFLAGS) \
- -DCONFIG_H @GMP_CFLAGS@ @SAGE_CFLAGS@
+ -DCONFIG_H @GMP_CFLAGS@ @ZLIB_CFLAGS@ @SAGE_CFLAGS@
# the no-undefined is necessary for Cygwin
--libgap_la_LDFLAGS = $(libgap_la_LT_INFO) $(libgap_la_LD_VERSION_SCRIPT) @GMP_LIBS@ -lm -no-undefined
-+libgap_sage_la_LDFLAGS = $(libgap_sage_la_LT_INFO) $(libgap_sage_la_LD_VERSION_SCRIPT) @GMP_LIBS@ -lm -no-undefined
+-libgap_la_LDFLAGS = $(libgap_la_LT_INFO) $(libgap_la_LD_VERSION_SCRIPT) @GMP_LIBS@ @ZLIB_LIBS@ -lm -no-undefined
++libgap_sage_la_LDFLAGS = $(libgap_sage_la_LT_INFO) $(libgap_sage_la_LD_VERSION_SCRIPT) @GMP_LIBS@ @ZLIB_LIBS@ -lm -no-undefined
-header-links: $(libgapinclude_HEADERS)
+header-links: $(libgapinclude_HEADERS) $(libgapincludearch_HEADERS)
@@ -76,7 +75,7 @@ Last-Update: 2016-11-18
--- a/test/Makefile.am
+++ b/test/Makefile.am
-@@ -6,17 +6,17 @@
+@@ -7,17 +7,17 @@
test_SOURCES = test.c
test_CFLAGS = @GMP_CFLAGS@
@@ -97,6 +96,12 @@ Last-Update: 2016-11-18
error_handler_LDFLAGS = -lgmp -lm
dist-hook:
+@@ -56,4 +56,4 @@
+ xz --best -c $< > $@
+
+
+-CGAP ?= gap
++CGAP ?= /usr/bin/gap
--- a/src/libgap.map
+++ b/src/libgap.map
@@ -1,4 +1,4 @@
diff --git a/debian/patches/gap-ds-upstream-autotoolization-adaptation.patch b/debian/patches/gap-ds-upstream-autotoolization-adaptation.patch
new file mode 100644
index 0000000..6e8b40b
--- /dev/null
+++ b/debian/patches/gap-ds-upstream-autotoolization-adaptation.patch
@@ -0,0 +1,52 @@
+Description: GAP patch: autotoolization: adaptation
+ Attempt to adapt the autotools machinery to the applied patches that are
+ imported (and adapted) form the GAP Debian Source.
+Origin: vendor, Debian
+Forwarded: not-needed
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-12-03
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -9,6 +9,7 @@
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_SRCDIR([src/libgap.c])
+ AC_CONFIG_HEADERS([src/config.h])
++AC_USE_SYSTEM_EXTENSIONS
+
+ AC_CONFIG_FILES([
+ Makefile
+@@ -44,6 +45,10 @@
+ dnl This is currently disabled (TODO for LibGAP)
+ #AC_DEFINE(USE_GMP, 1, [use GMP for integers])
+
++dnl Find the ZLIB general purpose compression library
++PKG_CHECK_MODULES(ZLIB,zlib >= 1.2.8,[],[])
++AC_DEFINE(USE_ZLIB, 1, [use ZLIB for reading/writing compressed files])
++
+ dnl Find SAGE_LOCAL
+ AC_ARG_WITH(sage,
+ [AS_HELP_STRING([--with-sage=<path>],
+@@ -110,6 +115,7 @@
+ AC_CHECK_FUNCS([sendto sendmsg getsockopt setsockopt getprotobyname gethostbyname])
+ AC_CHECK_FUNCS([opendir closedir dirfd readdir rewinddir seekdir telldir])
+ AC_CHECK_FUNCS([gettimeofday])
++AC_CHECK_FUNCS([fopencookie])
+
+ # sigsetjmp is a macro on some platforms, cannot use AC_CHECK_FUNCS
+ AC_MSG_CHECKING(for sigsetjmp())
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -49,10 +49,10 @@
+
+
+ libgap_la_CFLAGS = $(AM_CFLAGS) \
+- -DCONFIG_H @GMP_CFLAGS@ @SAGE_CFLAGS@
++ -DCONFIG_H @GMP_CFLAGS@ @ZLIB_CFLAGS@ @SAGE_CFLAGS@
+
+ # the no-undefined is necessary for Cygwin
+-libgap_la_LDFLAGS = $(libgap_la_LT_INFO) $(libgap_la_LD_VERSION_SCRIPT) @GMP_LIBS@ -lm -no-undefined
++libgap_la_LDFLAGS = $(libgap_la_LT_INFO) $(libgap_la_LD_VERSION_SCRIPT) @GMP_LIBS@ @ZLIB_LIBS@ -lm -no-undefined
+
+ header-links: $(libgapinclude_HEADERS)
+ $(MKDIR_P) @top_builddir@/libgap/gap
diff --git a/debian/patches/gap-ds-upstream-fix-zlib-stringfile.patch b/debian/patches/gap-ds-upstream-fix-zlib-stringfile.patch
new file mode 100644
index 0000000..875f072
--- /dev/null
+++ b/debian/patches/gap-ds-upstream-fix-zlib-stringfile.patch
@@ -0,0 +1,643 @@
+Description: zlib support
+ Uncompressing .gz files on the fly through pipes causes the doctests failures
+ related to GAP. This patch suggest to uncompress directly with zlib to avoid
+ the underlying EPIPE signal mess that creates `Boken pipes'. The zlib support
+ is implemented as custom stream through the GNU cookie facility. Furhtermore,
+ besides the .gz compression format, other compression format (e.g., xz) can be
+ easily compressed.
+Origin: vendor, Debian
+Forwarded: not-needed
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-12-06
+Comment:
+ Imported as-is and adapted by hand from GAP Debian material version
+ 4r8p6-1+sage19 (the autotools machinery parts were discarded).
+
+--- a/gapcore/gap4r8p6/src/streams.c
++++ b/gapcore/gap4r8p6/src/streams.c
+@@ -1826,7 +1826,7 @@
+ {
+ do {
+ csize = (ilim == -1 || (ilim- len) > 20000) ? 20000 : ilim - len;
+- lstr = read(syBuf[ifid].fp, buf, csize);
++ lstr = SyFread(ifid, buf, csize);
+ } while (lstr == -1 && errno == EAGAIN);
+ }
+ if (lstr <= 0)
+@@ -1978,10 +1978,7 @@
+ (Int)TNAM_OBJ(fid), 0L,
+ "you can replace <fid> via 'return <fid>;'" );
+ }
+- if ( syBuf[INT_INTOBJ(fid)].pipe == 1 ) {
+- ErrorMayQuit("<fid> is a pipe, not a file", 0L, 0L);
+- }
+- return SyReadStringFile(INT_INTOBJ(fid));
++ return SyReadStringFid(INT_INTOBJ(fid));
+ }
+
+ /****************************************************************************
+--- a/gapcore/gap4r8p6/src/sysfiles.c
++++ b/gapcore/gap4r8p6/src/sysfiles.c
+@@ -60,6 +60,9 @@
+ #endif
+
+ #include <stdio.h> /* standard input/output functions */
++#ifdef USE_ZLIB
++# include <zlib.h> /* zlib input/output functions */
++#endif
+ #include <stdlib.h> /* ANSI standard functions */
+ #include <string.h> /* string functions */
+ #include <time.h> /* time functions */
+@@ -812,6 +815,136 @@
+ SYS_SY_BUFFER syBuffers [ 32];
+
+
++#if HAVE_FOPENCOOKIE
++
++#if USE_ZLIB
++
++static
++ssize_t SYS_COOKIE_IO_GZ_Read(void *cookie, char *buffer, size_t size) {
++ ssize_t numberof_byte=-1;
++ if (cookie != NULL) {
++ numberof_byte=(ssize_t)(gzread((gzFile)(cookie),(voidp)(buffer),size));
++ }
++ else {
++ errno=EINVAL;
++ }
++ return (numberof_byte); }
++
++static
++ssize_t SYS_COOKIE_IO_GZ_Write(void *cookie, const char *buffer, size_t size) {
++ ssize_t numberof_byte=-1;
++ if (cookie != NULL) {
++ numberof_byte=(ssize_t)(gzwrite((gzFile)(cookie),(const voidp)(buffer),size));
++ }
++ else {
++ errno=EINVAL;
++ }
++ return (numberof_byte); }
++
++static
++int SYS_COOKIE_IO_GZ_Seek(void *cookie, off_t *position, int whence) {
++ int status=-1;
++ if (cookie != NULL) {
++ status=(int)(gzseek((gzFile)(cookie),(z_off_t)(*position),whence));
++ }
++ else {
++ errno=EINVAL;
++ }
++ return (status); }
++
++static
++int SYS_COOKIE_IO_GZ_Close(void *cookie) {
++ int status=-1;
++ if (cookie != NULL) {
++ gzFile cracker=(gzFile)(cookie);
++ gzflush(cracker,Z_FINISH);
++ status=gzclose(cracker);
++ status=(status==Z_OK)?0:-1;
++ }
++ else {
++ errno=EINVAL;
++ }
++ return (status); }
++
++cookie_io_functions_t SYS_COOKIE_IO_GZ_FUNC = {
++ .read = SYS_COOKIE_IO_GZ_Read,
++ .write = SYS_COOKIE_IO_GZ_Write,
++ .seek = SYS_COOKIE_IO_GZ_Seek,
++ .close = SYS_COOKIE_IO_GZ_Close,
++ };
++
++#endif
++
++#endif /* HAVE_FOPENCOOKIE */
++
++FILE* SYS_FILE_AZIO_FOPEN(
++ const Char * name,
++ const Char * mode )
++{
++ FILE * Stream = NULL;
++
++ if ( strncmp(mode,"w",1) == 0 )
++ {
++ Char * extension;
++ if ( (extension = strrchr( name, '.')) == NULL ) extension = ".NONE";
++#if HAVE_FOPENCOOKIE
++#ifdef USE_ZLIB
++ if ( strncmp(extension, ".gz", 3) == 0 )
++ {
++ gzFile zhandle = NULL;
++ if ( (zhandle = gzopen( name, "w")) != NULL )
++ {
++ if ( (Stream = fopencookie( (void *)zhandle, "w", SYS_COOKIE_IO_GZ_FUNC)) == NULL )
++ {
++ gzclose( zhandle);
++ }
++ }
++ }
++ else
++#endif /* USE_ZLIB */
++#endif /* HAVE_FOPENCOOKIE */
++ {
++ Stream = fopen(name, "w");
++ }
++ }
++ else if ( strncmp(mode,"r",1) == 0 )
++ {
++ Char namegz [1024];
++ namegz[0] = '\0';
++ if (strlen(name) <= 1018) {
++#if HAVE_FOPENCOOKIE
++#ifdef USE_ZLIB
++ gzFile zhandle = NULL;
++ strxcpy( namegz, name, sizeof(namegz) );
++ strxcat( namegz, ".gz", sizeof(namegz) );
++ if ( (zhandle = gzopen( namegz, "r")) != NULL )
++ {
++ if ( (Stream = fopencookie( (void *)zhandle, "r", SYS_COOKIE_IO_GZ_FUNC)) == NULL )
++ {
++ gzclose( zhandle);
++ }
++ }
++ else
++#endif /* USE_ZLIB */
++#endif /* HAVE_FOPENCOOKIE */
++ {
++ Stream = fopen(name, "r");
++ }
++ }
++ else
++ {
++ Stream = fopen(name, "r");
++ }
++ }
++ else
++ {
++ Pr("Panic: Unknown mode %s\n",(Int) mode, 0);
++ SyExit(2);
++ }
++
++ return Stream;
++}
++
+ /****************************************************************************
+ **
+ *F SyFopen( <name>, <mode> ) . . . . . . . . open the file with name <name>
+@@ -842,8 +975,6 @@
+ const Char * mode )
+ {
+ Int fid;
+- Char namegz [1024];
+- Char cmd [1024];
+ int flags = 0;
+
+ /* handle standard files */
+@@ -885,15 +1016,6 @@
+ return (Int)-1;
+ }
+
+- /* set up <namegz> and <cmd> for pipe command */
+- namegz[0] = '\0';
+- if (strlen(name) <= 1018) {
+- strxcpy( namegz, name, sizeof(namegz) );
+- strxcat( namegz, ".gz", sizeof(namegz) );
+-
+- strxcpy( cmd, "gunzip <", sizeof(cmd) );
+- strxcat( cmd, namegz, sizeof(cmd) );
+- }
+ if (strncmp( mode, "r", 1 ) == 0)
+ flags = O_RDONLY;
+ else if (strncmp( mode, "w",1 ) == 0)
+@@ -912,26 +1034,25 @@
+ #endif
+ /* try to open the file */
+ if ( 0 <= (syBuf[fid].fp = open(name,flags, 0644)) ) {
+- syBuf[fid].pipe = 0;
++ syBuf[fid].stream = NULL;
+ syBuf[fid].echo = syBuf[fid].fp;
+ syBuf[fid].ateof = 0;
+ syBuf[fid].crlast = 0;
+ syBuf[fid].bufno = -1;
+ syBuf[fid].isTTY = 0;
+ }
+-#if HAVE_POPEN
++#ifdef USE_ZLIB
+ else if ( strncmp(mode,"r",1) == 0
+- && SyIsReadableFile(namegz) == 0
+- && ( (syBuf[fid].pipehandle = popen(cmd,"r"))
+- ) ) {
+- syBuf[fid].pipe = 1;
+- syBuf[fid].fp = fileno(syBuf[fid].pipehandle);
++ && (syBuf[fid].stream = SYS_FILE_AZIO_FOPEN(name, "r")) != NULL
++ ) {
++ syBuf[fid].fp = -2;
++ syBuf[fid].echo = -2;
+ syBuf[fid].ateof = 0;
+ syBuf[fid].crlast = 0;
+ syBuf[fid].bufno = -1;
+ syBuf[fid].isTTY = 0;
+ }
+-#endif
++#endif /* USE_ZLIB */
+ else {
+ HashUnlock(&syBuf);
+ return (Int)-1;
+@@ -984,6 +1105,8 @@
+ Int SyFclose (
+ Int fid )
+ {
++ int status = 0;
++
+ /* check file identifier */
+ if ( sizeof(syBuf)/sizeof(syBuf[0]) <= fid || fid < 0 ) {
+ fputs("gap: panic 'SyFclose' asked to close illegal fid!\n",stderr);
+@@ -1000,12 +1123,20 @@
+ }
+ HashLock(&syBuf);
+ /* try to close the file */
+- if ( (syBuf[fid].pipe == 0 && close( syBuf[fid].fp ) == EOF)
+- || (syBuf[fid].pipe == 1 && pclose( syBuf[fid].pipehandle ) == -1
+-#ifdef ECHILD
+- && errno != ECHILD
++#ifdef USE_ZLIB
++ if (syBuf[fid].fp == -2) {
++ if (fclose( syBuf[fid].stream ) == EOF) {
++ status = -1;
++ }
++ } else
+ #endif
+- ) )
++ {
++ if (close( syBuf[fid].fp ) == EOF) {
++ status = -1;
++ }
++ }
++
++ if (status)
+ {
+ fputs("gap: 'SyFclose' cannot close file, ",stderr);
+ fputs("maybe your file system is full?\n",stderr);
+@@ -1022,6 +1153,26 @@
+ return 0;
+ }
+
++/****************************************************************************
++**
++*F SyFread( <fid>, <buffer>, <size> ) . read <size> bytes from the file <fid>
++*/
++int SyFread (Int fid, void* buffer, size_t size)
++{
++ int fp = syBuf[fid].fp;
++/*
++ if (fp == -1) {
++ return -1;
++ }
++*/
++ if (fp == -2) {
++ return (int)fread( buffer, 1, size, syBuf[fid].stream);
++ } else {
++ return (int)read( fp, buffer, size);
++ }
++
++}
++
+
+ /****************************************************************************
+ **
+@@ -1828,15 +1979,14 @@
+ return -1;
+ }
+
+- /* cannot seek in a pipe */
+- if ( syBuf[fid].pipe ) {
+- return -1;
++ /* get the position */
++ if (syBuf[fid].fp == -2) {
++ return (Int) fseek( syBuf[fid].stream, 0, SEEK_CUR);
++ } else {
++ return (Int) lseek( syBuf[fid].fp, 0, SEEK_CUR);
+ }
+
+- /* get the position
+- */
+-
+- return (Int) lseek(syBuf[fid].fp, 0, SEEK_CUR);
++ return -1;
+ }
+
+
+@@ -1856,13 +2006,13 @@
+ return -1;
+ }
+
+- /* cannot seek in a pipe */
+- if ( syBuf[fid].pipe ) {
+- return -1;
++ /* get the position */
++ if (syBuf[fid].fp == -2) {
++ fseek( syBuf[fid].stream, pos, SEEK_SET);
++ } else {
++ lseek( syBuf[fid].fp, pos, SEEK_SET);
+ }
+
+- /* get the position */
+- lseek( syBuf[fid].fp, pos, SEEK_SET );
+ return 0;
+ }
+
+@@ -1976,7 +2126,7 @@
+ tryagain:
+ #endif
+ if (syBuf[fid].bufno < 0)
+- while ( (ret = read( syBuf[fid].fp, &ch, 1 )) == -1 && errno == EAGAIN)
++ while ( (ret = SyFread( fid, &ch, 1 )) == -1 && errno == EAGAIN)
+ ;
+ else {
+ bufno = syBuf[fid].bufno;
+@@ -1984,7 +2134,7 @@
+ ch = syBuffers[bufno].buf[syBuffers[bufno].bufstart++];
+ ret = 1;
+ } else {
+- while ( (ret = read( syBuf[fid].fp,
++ while ( (ret = SyFread( fid,
+ syBuffers[bufno].buf,
+ SYS_FILE_BUF_SIZE )) == -1 && errno == EAGAIN)
+ ;
+@@ -2328,7 +2478,7 @@
+
+ Int HasAvailableBytes( UInt fid )
+ {
+-#if ! (HAVE_SELECT)
++#if !defined(HAVE_SELECT) || defined(USE_ZLIB)
+ Int ret;
+ #endif
+ UInt bufno;
+@@ -2343,7 +2493,10 @@
+ return 1;
+ }
+
+-#if HAVE_SELECT
++#if defined(HAVE_SELECT)
++#if defined(USE_ZLIB)
++ if ( -2 < syBuf[fid].fp )
++#endif /* USE_ZLIB */
+ {
+ fd_set set;
+ struct timeval tv;
+@@ -2353,10 +2506,16 @@
+ tv.tv_usec = 0;
+ return select( syBuf[fid].fp + 1, &set, NULL, NULL, &tv);
+ }
+-#else
+- /* best guess */
+- ret = SyIsEndOfFile( fid);
+- return (ret != -1 && ret != 1);
++#if defined(USE_ZLIB)
++ else
++#endif /* USE_ZLIB */
++#endif /* HAVE_SELECT */
++#if !defined(HAVE_SELECT) || defined(USE_ZLIB)
++ /* best guess */
++ {
++ ret = SyIsEndOfFile( fid);
++ return (ret != -1 && ret != 1);
++ }
+ #endif
+ }
+
+@@ -3649,16 +3808,16 @@
+ Int SyIsReadableFile ( const Char * name )
+ {
+ Int res;
+-#ifdef HAVE_POPEN
++#ifdef USE_ZLIB
+ Char xname[1024];
+ #endif
+
+ SyClearErrorNo();
+ res = access( name, R_OK );
+ if ( res == -1 ) {
+- /* if there is popen then we might be able to read the file via gunzip */
++ /* if we use zlib then we might be able to read the compressed file */
+
+-#ifdef HAVE_POPEN
++#ifdef USE_ZLIB
+ /* beware of buffer overflows */
+ if ( strlcpy(xname, name, sizeof(xname)) < sizeof(xname) &&
+ strlcat(xname, ".gz", sizeof(xname)) < sizeof(xname) ) {
+@@ -4076,8 +4235,10 @@
+ }
+
+ #else
++# define SyReadStringFile SyReadStringZFile
++#endif
+
+-Obj SyReadStringFile(Int fid)
++Obj SyReadStringZFile(Int fid)
+ {
+ Char buf[32769];
+ Int ret, len;
+@@ -4088,7 +4249,7 @@
+ str = NEW_STRING(0);
+ len = 0;
+ do {
+- ret = read( syBuf[fid].fp , buf, 32768);
++ ret = SyFread( fid , buf, 32768);
+ if (ret < 0) {
+ SySetErrorNo();
+ return Fail;
+@@ -4109,7 +4270,17 @@
+ return str;
+ }
+
+-#endif
++Obj SyReadStringFid(Int fid)
++{
++ if (syBuf[fid].fp == -2) {
++ return SyReadStringZFile(fid);
++ }
++ else
++ {
++ return SyReadStringFile(fid);
++ }
++ return Fail;
++}
+
+ /****************************************************************************
+ **
+--- a/gapcore/gap4r8p6/src/sysfiles.h
++++ b/gapcore/gap4r8p6/src/sysfiles.h
+@@ -120,6 +120,16 @@
+ *F * * * * * * * * * * * * * * * * open/close * * * * * * * * * * * * * * * *
+ */
+
++/****************************************************************************
++**
++*F SYS_FILE_AZIO_FOPEN( <name>, <mode> ) . open a stream for I/O to file <name>
++**
++** The function 'SYS_FILE_AZIO_FOPEN' is meant to mimic gzfopen for files
++** compressed with Any Arbitrary (but effectively supported) compressor;
++** this a low level function which is employed by SyFopen and for profiling
++** (see 'src/profile.c').
++*/
++extern FILE* SYS_FILE_AZIO_FOPEN( const Char * name, const Char * mode );
+
+ /****************************************************************************
+ **
+@@ -131,9 +141,8 @@
+ */
+ typedef struct {
+ int fp; /* file descriptor for this file */
++ FILE * stream; /* file stream (fp == -2) */
+ int echo; /* file descriptor for the echo */
+- UInt pipe; /* file is really a pipe */
+- FILE *pipehandle; /* for pipes we need to remember the file handle */
+ UInt ateof; /* set to 1 by any read operation that hits eof
+ reset to 0 by a subsequent successful read */
+ UInt crlast; /* records that last character read was \r for
+@@ -630,17 +639,31 @@
+ const Char * cmd,
+ const Char * str );
+
++/****************************************************************************
++**
++*F SyFread( <fid>, <buffer>, <size> ) . read <size> bytes from the file <fid>
++**
++** 'SyFread' reads up to <size> bytes from the file with the identifier <fid>
++** which is obtained from 'SyFopen', storing them in the <buffer>.
++*/
++
++extern int SyFread(Int fid, void* buffer, size_t size);
++
+ /***************************************************************************
+ **
+- *F SyReadFileString( <fid> )
+- ** - read file given by <fid> file into a string
++ *F SyReadStringFid( <fid> )
++ ** - read file given by <fid> into a string
++ *F SyReadStringFile( <fid> )
++ ** - read (uncompressed) file given by <fid> file into a string
++ *F SyReadStringZFile( <fid> )
++ ** - read compressed (or uncompressed) file given by <fid> file into
++ ** a string
+ */
+
+-extern Obj SyReadStringFile (
+- Int fid );
+-
++extern Obj SyReadStringFid(Int fid);
++extern Obj SyReadStringFile(Int fid);
++extern Obj SyReadStringZFile(Int fid);
+
+-
+ /****************************************************************************
+ **
+
+--- a/gapcore/gap4r8p6/src/profile.c
++++ b/gapcore/gap4r8p6/src/profile.c
+@@ -142,10 +142,8 @@
+
+ struct ProfileState
+ {
+- // C steam we are writing to
++ // C stream we are writing to
+ FILE* Stream;
+- // Did we use 'popen' to open the stream (matters when closing)
+- int StreamWasPopened;
+ // Are we currently outputting repeats (false=code coverage)
+ Int OutputRepeats;
+ // Are we colouring output (not related to profiling directly)
+@@ -228,47 +226,16 @@
+ ** of GAP's execution, before anything else is done.
+ */
+
+-#if HAVE_POPEN
+-static int endsWithgz(char* s)
+-{
+- s = strrchr(s, '.');
+- if(s)
+- return strcmp(s, ".gz") == 0;
+- else
+- return 0;
+-}
+-#endif
+-
+ static void fopenMaybeCompressed(char* name, struct ProfileState* ps)
+ {
+-#if HAVE_POPEN
+- char popen_buf[4096];
+- if(endsWithgz(name) && strlen(name) < 3000)
+- {
+- strcpy(popen_buf, "gzip > ");
+- strcat(popen_buf, name);
+- ps->Stream = popen(popen_buf, "w");
+- ps->StreamWasPopened = 1;
+- return;
+- }
+-#endif
+-
+- ps->Stream = fopen(name, "w");
+- ps->StreamWasPopened = 0;
++ ps->Stream = SYS_FILE_AZIO_FOPEN(name, "w");
++ return ;
+ }
+
+ static void fcloseMaybeCompressed(struct ProfileState* ps)
+ {
+-#if HAVE_POPEN
+- if(ps->StreamWasPopened)
+- {
+- pclose(ps->Stream);
+- ps->Stream = 0;
+- return;
+- }
+-#endif
+ fclose(ps->Stream);
+- ps->Stream = 0;
++ ps->Stream = NULL;
+ }
+
+ /****************************************************************************
+--- a/gapcore/gap4r8p6/src/gap.c
++++ b/gapcore/gap4r8p6/src/gap.c
+@@ -10,6 +10,8 @@
+ **
+ ** This file contains the various read-eval-print loops and related stuff.
+ */
++#include "config.h" /* autoconf */
++
+ #include <stdio.h>
+ #include <assert.h>
+ #include <string.h> /* memcpy */
+@@ -21,8 +23,8 @@
+ #include <sys/stat.h>
+ #endif
+
+-#include <sys/time.h>
+-#include <unistd.h> /* move this and wrap execvp later */
++#include <sys/time.h>
++#include <unistd.h> /* move this and wrap execvp later */
+
+ #include "gasman.h" /* garbage collector */
+ #include "objects.h" /* objects */
+@@ -496,7 +498,8 @@
+ TLS(UserHasQuit) = 0;
+ return res;
+ }
+-#ifdef HAVE_REALPATH
++
++#if defined(HAVE_REALPATH) && defined(HAVE_POPEN)
+
+ static void StrAppend(char **st, const char *st2)
+ {
+@@ -743,7 +746,7 @@
+ Obj func; /* function (compiler) */
+ Int4 crc; /* crc of file to compile */
+
+-#ifdef HAVE_REALPATH
++#if defined(HAVE_REALPATH) && defined(HAVE_POPEN)
+ if (argc >= 3 && !strcmp(argv[1],"--createstartupscript")) {
+ return DoCreateStartupScript(argc,argv,0);
+ }
diff --git a/debian/patches/gap-ds-upstream-neutralize-experimental-code.patch b/debian/patches/gap-ds-upstream-neutralize-experimental-code.patch
new file mode 100644
index 0000000..dba65e0
--- /dev/null
+++ b/debian/patches/gap-ds-upstream-neutralize-experimental-code.patch
@@ -0,0 +1,51 @@
+Description: experimental code neutralization
+ Neutralize experimental code found in `src/gap.c'.
+Origin: vendor, Debian
+Forwarded: not-needed
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-12-03
+Comment:
+ Imported as-is by hand from GAP Debian material version 4r8p6-1+sage17 .
+
+--- a/gapcore/gap4r8p6/src/gap.c
++++ b/gapcore/gap4r8p6/src/gap.c
+@@ -499,7 +499,11 @@
+ return res;
+ }
+
+-#if defined(HAVE_REALPATH) && defined(HAVE_POPEN)
++#if defined(HAVE_REALPATH) && defined(HAVE_POPEN) && 0
++# define EXPERIMENTAL
++#endif
++
++#ifdef EXPERIMENTAL
+
+ static void StrAppend(char **st, const char *st2)
+ {
+@@ -731,7 +735,7 @@
+ }
+ return 0;
+ }
+-#endif
++#endif /* EXPERIMENTAL */
+
+ #ifdef COMPILECYGWINDLL
+ #define main realmain
+@@ -746,7 +750,7 @@
+ Obj func; /* function (compiler) */
+ Int4 crc; /* crc of file to compile */
+
+-#if defined(HAVE_REALPATH) && defined(HAVE_POPEN)
++#ifdef EXPERIMENTAL
+ if (argc >= 3 && !strcmp(argv[1],"--createstartupscript")) {
+ return DoCreateStartupScript(argc,argv,0);
+ }
+@@ -759,7 +763,7 @@
+ if (argc >= 2 && !strcmp(argv[1],"--fixgac")) {
+ return DoFixGac(argv[0]);
+ }
+-#endif
++#endif /* EXPERIMENTAL */
+
+ original_argv0 = argv[0];
+ sysargv = argv;
diff --git a/debian/patches/gap-ds-upstream-revert-fix-gzip-stringfile.patch b/debian/patches/gap-ds-upstream-revert-fix-gzip-stringfile.patch
new file mode 100644
index 0000000..11678a8
--- /dev/null
+++ b/debian/patches/gap-ds-upstream-revert-fix-gzip-stringfile.patch
@@ -0,0 +1,152 @@
+Description: revert the former fix-gzip-stringfile patch
+Origin: vendor, Debian
+Forwarded: not-needed
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-12-03
+Comment:
+ Imported as-is by hand from GAP Debian material version 4r8p6-1+sage17 .
+
+--- a/gapcore/gap4r8p6/src/streams.c
++++ b/gapcore/gap4r8p6/src/streams.c
+@@ -1978,7 +1978,10 @@
+ (Int)TNAM_OBJ(fid), 0L,
+ "you can replace <fid> via 'return <fid>;'" );
+ }
+- return SyReadStringFid(INT_INTOBJ(fid));
++ if ( syBuf[INT_INTOBJ(fid)].pipe == 1 ) {
++ ErrorMayQuit("<fid> is a pipe, not a file", 0L, 0L);
++ }
++ return SyReadStringFile(INT_INTOBJ(fid));
+ }
+
+ /****************************************************************************
+--- a/gapcore/gap4r8p6/src/sysfiles.c
++++ b/gapcore/gap4r8p6/src/sysfiles.c
+@@ -4034,43 +4034,11 @@
+ #endif
+ #endif
+
+-Obj SyReadStringFile(Int fid)
+-{
+- Char buf[32769];
+- Int ret, len;
+- UInt lstr;
+- Obj str;
+-
+- /* read <fid> until we see eof (in 32kB pieces) */
+- str = NEW_STRING(0);
+- len = 0;
+- do {
+- ret = read( syBuf[fid].fp , buf, 32768);
+- if (ret < 0) {
+- SySetErrorNo();
+- return Fail;
+- }
+- len += ret;
+- GROW_STRING( str, len );
+- lstr = GET_LEN_STRING(str);
+- memcpy( CHARS_STRING(str)+lstr, buf, ret );
+- *(CHARS_STRING(str)+lstr+ret) = '\0';
+- SET_LEN_STRING(str, lstr+ret);
+- } while(ret > 0);
+-
+- /* fix the length of <str> */
+- len = GET_LEN_STRING(str);
+- ResizeBag( str, SIZEBAG_STRINGLEN(len) );
+-
+- syBuf[fid].ateof = 1;
+- return str;
+-}
+-
+ #if !defined(SYS_IS_CYGWIN32) && defined(HAVE_STAT)
+ /* fstat seems completely broken under CYGWIN */
+ /* first try to get the whole file as one chunk, this avoids garbage
+ collections because of the GROW_STRING calls below */
+-Obj SyReadStringFileStat(Int fid)
++Obj SyReadStringFile(Int fid)
+ {
+ Int ret, len;
+ Obj str;
+@@ -4107,25 +4075,42 @@
+ }
+ }
+
+-Obj SyReadStringFid(Int fid)
++#else
++
++Obj SyReadStringFile(Int fid)
+ {
+- if(syBuf[fid].pipe == 1) {
+- return SyReadStringFile(fid);
+- } else {
+- return SyReadStringFileStat(fid);
+- }
+-}
++ Char buf[32769];
++ Int ret, len;
++ UInt lstr;
++ Obj str;
+
+-#else
++ /* read <fid> until we see eof (in 32kB pieces) */
++ str = NEW_STRING(0);
++ len = 0;
++ do {
++ ret = read( syBuf[fid].fp , buf, 32768);
++ if (ret < 0) {
++ SySetErrorNo();
++ return Fail;
++ }
++ len += ret;
++ GROW_STRING( str, len );
++ lstr = GET_LEN_STRING(str);
++ memcpy( CHARS_STRING(str)+lstr, buf, ret );
++ *(CHARS_STRING(str)+lstr+ret) = '\0';
++ SET_LEN_STRING(str, lstr+ret);
++ } while(ret > 0);
+
+-Obj SyReadStringFid(Int fid) {
+- return SyReadStringFile(fid);
++ /* fix the length of <str> */
++ len = GET_LEN_STRING(str);
++ ResizeBag( str, SIZEBAG_STRINGLEN(len) );
++
++ syBuf[fid].ateof = 1;
++ return str;
+ }
+
+ #endif
+
+-
+-
+ /****************************************************************************
+ **
+ *V GVarFuncs . . . . . . . . . . . . . . . . . . list of functions to export
+--- a/gapcore/gap4r8p6/src/sysfiles.h
++++ b/gapcore/gap4r8p6/src/sysfiles.h
+@@ -632,19 +632,15 @@
+
+ /***************************************************************************
+ **
+- *F SyReadStringFid( <fid> )
+- ** - read file given by <fid> into a string
+- *F SyReadStringFile( <fid> )
+- ** - read file given by <fid> into a string, only rely on read()
+- *F SyReadStringFileStat( <fid> )
+- ** - read file given by <fid> into a string, use stat() to determine
+- ** size of file before reading. This does not work for pipes
++ *F SyReadFileString( <fid> )
++ ** - read file given by <fid> file into a string
+ */
+
+-extern Obj SyReadStringFid(Int fid);
+-extern Obj SyReadStringFile(Int fid);
+-extern Obj SyReadStringFileGeneric(Int fid);
++extern Obj SyReadStringFile (
++ Int fid );
+
++
++
+ /****************************************************************************
+ **
+
diff --git a/debian/patches/gap-ds-upstream-test-zlib-add.patch b/debian/patches/gap-ds-upstream-test-zlib-add.patch
new file mode 100644
index 0000000..8e8ebe3
--- /dev/null
+++ b/debian/patches/gap-ds-upstream-test-zlib-add.patch
@@ -0,0 +1,77 @@
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -2,6 +2,7 @@
+
+ TESTS = test shell error_handler
+
++check_DATA = gapbanner.txt gapinfo.txt gzgapbanner.txt.gz gzgapinfo.txt.gz
+ check_PROGRAMS = test shell error_handler
+
+ test_SOURCES = test.c
+@@ -37,6 +38,23 @@
+ $(distdir)/*.c
+ echo '***************************************************'
+
+-clean-local:
+- -rm -rf tmp_file.txt
++CLEANFILES = \
++ $(check_DATA) \
++ tmp_file.txt \
++ output.data output.data.gz
+
++gapbanner.txt:
++ LC_ALL=C echo 'QUIT;' | $(CGAP) -T > $@
++
++gapinfo.txt:
++ LC_ALL=C echo 'GAPInfo; QUIT;' | $(CGAP) -T > $@
++
++
++gz%.gz: %
++ gzip --best -c $< > $@
++
++xz%.xz: %
++ xz --best -c $< > $@
++
++
++CGAP ?= gap
+--- a/test/test.c
++++ b/test/test.c
+@@ -228,6 +228,37 @@
+ "Printed Message");
+
+ eval("1/0;\n");
+-
++
++ if (!((access("gapbanner.txt",R_OK))||(access("gzgapbanner.txt.gz",R_OK)))) {
++ eval("dum_str:=StringFile(\"gapbanner.txt\");\n");
++ eval("gzdum_str:=StringFile(\"gzgapbanner.txt\");\n");
++ check("dum_str = gzdum_str;\n","true");
++ }
++
++ if (!((access("gapinfo.txt",R_OK))||(access("gzgapinfo.txt.gz",R_OK)))) {
++ check("dum:=InputTextFile(\"gapinfo.txt\");","InputTextFile(gapinfo.txt)");
++ check("gzdum:=InputTextFile(\"gzgapinfo.txt\");","InputTextFile(gzgapinfo.txt)");
++ for(int i=0;i<3;++i) {
++ eval("Print(ReadLine(dum));\n");
++ eval("Print(ReadLine(gzdum));\n");
++ }
++ eval("dum_str:=ReadLine(dum);\n");
++ eval("gzdum_str:=ReadLine(gzdum);\n");
++ check("dum_str = gzdum_str;\n","true");
++ for(int i=0;i<3;++i) {
++ eval("Print(ReadLine(gzdum));\n");
++ }
++ check("RewindStream(dum);\n","true");
++ check("RewindStream(gzdum);\n","true");
++ eval("dum_str:=ReadAll(dum);\n");
++ eval("gzdum_str:=ReadAll(gzdum);\n");
++ check("dum_str = gzdum_str;\n","true");
++ }
++
++ unlink("output.data.gz");
++ eval("ProfileLineByLine(\"output.data.gz\");\n");
++ eval("Size(AlternatingGroup(10));\n");
++ check("UnprofileLineByLine();\n","true");
++
+ return 0;
+ }
diff --git a/debian/patches/gap-ds-upstream-upstream-env-tmpdir.patch b/debian/patches/gap-ds-upstream-upstream-env-tmpdir.patch
index a0f39a9..313263b 100644
--- a/debian/patches/gap-ds-upstream-upstream-env-tmpdir.patch
+++ b/debian/patches/gap-ds-upstream-upstream-env-tmpdir.patch
@@ -7,7 +7,7 @@ Comment:
--- a/gapcore/gap4r8p6/src/sysfiles.c
+++ b/gapcore/gap4r8p6/src/sysfiles.c
-@@ -3992,7 +3992,13 @@
+@@ -3988,7 +3988,13 @@
{
static char name[1024];
static const char *base = TMPDIR_BASE;
diff --git a/debian/patches/series b/debian/patches/series
index 6cb8d47..58aaff8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,8 @@
-gap-ds-upstream-fix-MY_CLOCK.patch
gap-ds-upstream-upstream-env-tmpdir.patch
+gap-ds-upstream-fix-MY_CLOCK.patch
+gap-ds-upstream-revert-fix-gzip-stringfile.patch
+gap-ds-upstream-fix-zlib-stringfile.patch
+gap-ds-upstream-neutralize-experimental-code.patch
upstream-source-lintian-spelling-error-silence.patch
upstream-source-test-disable_autoloading.patch
upstream-autotoolization-autoconf-srcdir-truly_libgap.patch
@@ -7,6 +10,9 @@ upstream-autotoolization-libtool-version_triplet.patch
upstream-autotoolization-libtool-version_script.patch
upstream-autotoolization-header_folder.patch
upstream-autotoolization-test-systemwide.patch
+gap-ds-upstream-autotoolization-adaptation.patch
+gap-ds-upstream-test-zlib-add.patch
+upstream-machinery-gnu_source_reserved_keywords-add.patch
upstream-hacking-upgrade-version.patch
debianization.patch
debianization-pkgconfig.patch
diff --git a/debian/patches/upstream-autotoolization-test-systemwide.patch b/debian/patches/upstream-autotoolization-test-systemwide.patch
index 3650c10..5182e77 100644
--- a/debian/patches/upstream-autotoolization-test-systemwide.patch
+++ b/debian/patches/upstream-autotoolization-test-systemwide.patch
@@ -1,8 +1,8 @@
Description: autotoolization: systemwide test
Attempt to harden the tests by rendering systemwide: this transformation
- permits to use the tests to grossely check installation by hand or through
- automates (as done nowadays by some distributions). Meant to be submitted
- to the upstream maintainer.
+ permits one to use the tests to grossely check installation by hand or
+ through automates (as done nowadays by some distributions). Meant to be
+ submitted to the upstream maintainer.
Origin: vendor, Debian
Forwarded: https://bitbucket.org/vbraun/libgap/pull-requests/8
Author: Jerome Benoit <calculus at rezozer.net>
diff --git a/debian/patches/upstream-machinery-gnu_source_reserved_keywords-add.patch b/debian/patches/upstream-machinery-gnu_source_reserved_keywords-add.patch
new file mode 100644
index 0000000..885c9ab
--- /dev/null
+++ b/debian/patches/upstream-machinery-gnu_source_reserved_keywords-add.patch
@@ -0,0 +1,21 @@
+Description: libgapification: extra reserved keywords: _GNU_SOURCE support
+ A lazzy approach based on GNU custom stream is used to implement zlib support:
+ extra reserved keywords have to be considered (actually only one).
+Origin: vendor, Debian
+Forwarded: not-needed
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2016-12-03
+
+--- a/scripts/libGAPify.py
++++ b/scripts/libGAPify.py
+@@ -36,7 +36,9 @@
+ 'mp_limb_t', 'mp_size_t',
+ # C99-int specific stuff
+ 'int8_t', 'int16_t', 'int32_t', 'int64_t',
+- 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t'
++ 'uint8_t', 'uint16_t', 'uint32_t', 'uint64_t',
++ # _GNU_SOURCE reserved keywords
++ 'cookie_io_functions_t'
+ )
+
+ tokens = (
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libgap-sage.git
More information about the debian-science-commits
mailing list