From e0c8972f7f6dd6865b8ec0303c42c6cbd56e6341 Mon Sep 17 00:00:00 2001 From: Jerry James loganjerry@gmail.com Date: Fri, 31 Mar 2017 15:05:47 -0600 Subject: Bring back the -stat patch, still needed by gap-pkg-io.
--- gap-stat.patch | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ gap.spec | 10 +++- 2 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 gap-stat.patch
diff --git a/gap-stat.patch b/gap-stat.patch new file mode 100644 index 0000000..862dca2 --- /dev/null +++ b/gap-stat.patch @@ -0,0 +1,152 @@ +--- src/gmpints.c.orig 2016-03-19 16:35:29.000000000 -0600 ++++ src/gmpints.c 2016-04-02 07:38:28.517903402 -0600 +@@ -377,6 +377,41 @@ Obj ObjInt_UInt( UInt i ) + } + } + ++Obj ObjInt_LongLong( long long i ) ++{ ++ Obj gmp; ++ unsigned long long ull; ++ size_t j; ++ ++ if ( (-(1LL<<NR_SMALL_INT_BITS) <= i) && (i < 1LL<<NR_SMALL_INT_BITS )) ++ return INTOBJ_INT((Int) i); ++ ++ if ( i >= 0LL ) { ++ gmp = NewBag( T_INTPOS, sizeof(i) ); ++ ull = (unsigned long long) i; ++ } ++ else { ++ gmp = NewBag( T_INTNEG, sizeof(i) ); ++ ull = (unsigned long long) -i; ++ } ++ for ( j = 0U; j < sizeof(i) / sizeof(TypLimb); j++ ) ++ ((TypLimb *)ADDR_OBJ( gmp ))[j] = ull >> (j * sizeof(TypLimb)); ++ return GMP_NORMALIZE( gmp ); ++} ++ ++Obj ObjInt_ULongLong( unsigned long long i ) ++{ ++ Obj gmp; ++ size_t j; ++ ++ if ( i < 1ULL<<NR_SMALL_INT_BITS ) ++ return INTOBJ_INT((Int) i); ++ gmp = NewBag( T_INTPOS, sizeof(i) ); ++ for ( j = 0U; j < sizeof(i) / sizeof(TypLimb); j++ ) ++ ((TypLimb *)ADDR_OBJ( gmp ))[j] = i >> (j * sizeof(TypLimb)); ++ return GMP_NORMALIZE( gmp ); ++} ++ + + /**************************************************************************** + ** +--- src/gmpints.h.orig 2016-03-19 16:35:29.000000000 -0600 ++++ src/gmpints.h 2016-04-02 07:38:28.518903322 -0600 +@@ -87,6 +87,21 @@ typedef mp_size_t TypGMPSize; + Obj ObjInt_Int(Int i); + Obj ObjInt_UInt(UInt i); + ++ ++/************************************************************************** ++** The following two functions convert a C long long or unsigned long long ++** respectively into* a GAP integer, either an immediate, small integer if ++** possible or otherwise a new GAP bag with TNUM T_INTPOS or T_INTNEG. ++** ++*F ObjInt_LongLong(long long i) ++*F ObjInt_ULongLong(unsigned long long i) ++** ++****************************************************************************/ ++ ++Obj ObjInt_LongLong(long long i); ++Obj ObjInt_ULongLong(unsigned long long i); ++ ++ + /**************************************************************************** + ** + */ +--- src/integer.c.orig 2016-03-19 16:35:29.000000000 -0600 ++++ src/integer.c 2016-04-02 07:38:28.520903161 -0600 +@@ -216,6 +216,58 @@ Obj ObjInt_UInt(UInt i) + } + + ++/************************************************************************** ++** The following two functions convert a C long long or unsigned long long ++** respectively into a GAP integer, either an immediate, small integer if ++** possible or otherwise a new GAP bag with TNUM T_INTPOS or T_INTNEG. ++** ++*F ObjInt_LongLong(long long i) ++*F ObjInt_ULongLong(unsigned long long i) ++** ++****************************************************************************/ ++ ++#define NDIGITS_RAW (sizeof (long long) / sizeof (TypDigit)) ++#define NDIGITS (NDIGITS_RAW >= 4U ? NDIGITS_RAW : 4U) ++ ++Obj ObjInt_LongLong(long long i) ++{ ++ Obj n; ++ long long bound = 1LL << NR_SMALL_INT_BITS; ++ if (i >= bound) { ++ /* We have to make a big integer */ ++ size_t j; ++ n = NewBag(T_INTPOS, NDIGITS); ++ for ( j = 0U; j < NDIGITS; j++ ) ++ ADDR_INT(n)[j] = (TypDigit) (i >> (j * NR_DIGIT_BITS)); ++ return n; ++ } else if (-i > bound) { ++ size_t j; ++ n = NewBag(T_INTNEG, NDIGITS); ++ for ( j = 0U; j < NDIGITS; j++ ) ++ ADDR_INT(n)[j] = (TypDigit) ((-i) >> (j * NR_DIGIT_BITS)); ++ return n; ++ } else { ++ return INTOBJ_INT((Int) i); ++ } ++} ++ ++Obj ObjInt_ULongLong(unsigned long long i) ++{ ++ Obj n; ++ unsigned long long bound = 1ULL << NR_SMALL_INT_BITS; ++ if (i >= bound) { ++ /* We have to make a big integer */ ++ size_t j; ++ n = NewBag(T_INTPOS, NDIGITS); ++ for ( j = 0U; j < NDIGITS; j++ ) ++ ADDR_INT(n)[j] = (TypDigit) (i >> (j * NR_DIGIT_BITS)); ++ return n; ++ } else { ++ return INTOBJ_INT((Int) i); ++ } ++} ++ ++ + + /**************************************************************************** + ** +--- src/integer.h.orig 2016-03-19 16:35:29.000000000 -0600 ++++ src/integer.h 2016-04-02 07:38:28.521903081 -0600 +@@ -59,6 +59,20 @@ Obj ObjInt_Int(Int i); + Obj ObjInt_UInt(UInt i); + + ++/************************************************************************** ++** The following two functions convert a C long long or unsigned long long ++** respectively into a GAP integer, either an immediate, small integer if ++** possible or otherwise a new GAP bag with TNUM T_INTPOS or T_INTNEG. ++** ++*F ObjInt_LongLong(long long i) ++*F ObjInt_ULongLong(unsigned long long i) ++** ++****************************************************************************/ ++ ++Obj ObjInt_LongLong(long long i); ++Obj ObjInt_ULongLong(unsigned long long i); ++ ++ + /**************************************************************************** + ** + *F PrintInt( <int> ) . . . . . . . . . . . . . . . print an integer constant diff --git a/gap.spec b/gap.spec index d7417af..ddce951 100644 --- a/gap.spec +++ b/gap.spec @@ -6,7 +6,7 @@
Name: gap Version: %(sed -r "s/r|p/./g" <<< %upstreamver) -Release: 1%{?dist} +Release: 2%{?dist} Summary: Computational discrete algebra
License: GPLv2+ @@ -26,6 +26,10 @@ Patch0: %{name}-paths.patch # This patch applies a change from Debian to allow help files to be in gzip # compressed DVI files, and also adds support for viewing with xdg-open. Patch1: %{name}-help.patch +# Filed as an upstream git pull request. Force use of the 64-bit stat() +# routines to avoid overflow of the inode and size fields. The functions +# supplied by this patch are used by gap-pkg-io. +Patch2: %{name}-stat.patch
# Fix some unescaped curly braces in the tools Patch100: %{name}-escape.patch @@ -131,6 +135,7 @@ Both syntax highlighting and indentation are supported. %setup -q -n %{gapdirname} %patch0 %patch1 +%patch2
# Replace the CFLAGS and LDFLAGS sed -re "s|(gp_cv_prog_cc_cdynoptions=)"-fPIC -Wall -O2|\1"$RPM_OPT_FLAGS -fPIC -D_GNU_SOURCE|" \ @@ -348,6 +353,9 @@ make testinstall %{_datadir}/vim/vimfiles/syntax/gap.vim
%changelog +* Fri Mar 31 2017 Jerry James loganjerry@gmail.com - 4.8.7-2 +- Bring back the -stat patch, still needed by gap-pkg-io + * Fri Mar 31 2017 Jerry James loganjerry@gmail.com - 4.8.7-1 - New upstream release
scm-commits@lists.fedoraproject.org