singular stable port information

# DISCLAIMER: Max Horn is the sole maintainer of this package.
# Please DO NOT MAKE MODIFICATIONS without informing the maintainer.
# Preferably, send a patch to me instead of making changes yourself!
# If that is not possible due to extra urgency, at least send me a mail.
#
# Explanation: I am sick and tired of getting back to my packages and
# discovering that people have messed with it. I am then forced to
# retrace their steps, find out who, when and why did make a certain
# change etc. -- i.e. it makes my life as maintainer harder.
# Furthermore, as maintainer I am responsible for problems caused by my
# packages. But I am not willing to take responsibility for something I
# did not do. In particular, for changes that other people introduced
# behind my back, no matter how good and noble their intentions were. As
# such, I may see myself forced to drop responsibility for (and hence,
# maintainership of) the affected package.

Package: singular
Version: 3.1.4
Revision: 2
#
Maintainer: Max Horn
HomePage: http://www.singular.uni-kl.de
License: GPL
#
Depends: readline5-shlibs (>= 5.0-1004), libncurses5-shlibs (>= 5.4-20041023-1006), gmp5-shlibs, libmpfr4-shlibs
BuildDepends: readline5 (>= 5.0-1004), libncurses5 (>= 5.4-20041023-1006), gmp5, libmpfr4
BuildConflicts: broken-gcc
Suggests: surf, graphviz, singular-doc
#
Source: http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/3-1-4/Singular-3-1-4.tar.gz
Source-MD5: 5f79e63b2d35b662a322b7184174fd22
SourceDirectory: Singular-3-1-4
#
PatchFile: %n.patch
PatchFile-MD5: 37a2d4cade3f872fe5dbff1ff33543d6
#
ConfigureParams: <<
--disable-doc \
--libdir=%i/lib/Singular \
--includedir=%i/include/Singular \
--bindir=%i/lib/Singular \
--prefix=%i/share/Singular \
( %m != x86_64 ) --enable-MP \
--without-dynamic-kernel \
--with-malloc=system \
--with-valloc=system
<<
GCC: 4.0
SetCFLAGS: -O3
SetCXXFLAGS: -O3
#
CompileScript: <<
#! /bin/sh -ev
rm -rf gmp
rm -rf doc
./configure %c
<<
#
InstallScript: <<
#! /bin/sh -ev
VERSION="3-1-4"
#export ac_cv_header_boost_dynamic_bitset_hpp=no
echo "#define MAKE_DISTRIBUTION " >Singular/distrib.h

mkdir -p %i/bin
mkdir -p %i/share/Singular
make install

ln -sf Singular-$VERSION %i/lib/Singular/Singular
rm -f %i/share/Singular/LIB
cd Singular
make install-sharedist install_slibdir=%i/share/Singular/LIB
cd ..

cat >%i/bin/Singular < #!/bin/bash
export SINGULAR_BIN_DIR=%p/lib/Singular
export SINGULAR_ROOT_DIR=%p/share/Singular
export SINGULAR_INFO_FILE=%p/share/doc/Singular/info/singular.hlp
export SINGULAR_IDX_FILE=%p/share/doc/Singular/doc/singular.idx
export SINGULAR_HTML_DIR=%p/share/doc/Singular/html
export SINGULAR_EXAMPLES_DIR=%p/share/doc/Singular/examples
export PATH="%p/lib/Singular:%p/bin:\$PATH"
export SINGULAR_EXECUTABLE="%p/bin/Singular"
exec %p/lib/Singular/Singular-$VERSION \$*
!ANF
chmod 755 %i/bin/Singular

cat >%i/lib/Singular/singularsurf < #!/bin/bash
x11_app=X11

if [ -d /Applications/Utilities/X11.app ]; then
x11_app=/Applications/Utilities/X11.app
elif [ -d /Applications/X11.app ]; then
x11_app=/Applications/X11.app
fi

/usr/bin/open -a "\$x11_app"

sleep 1;

if [ -z \$DISPLAY ]; then
export DISPLAY=":0.0"
fi

exec surf \$*
!ANF

chmod 755 %i/lib/Singular/singularsurf

cat >%i/bin/ESingular < #!/bin/bash
export SINGULAR_BIN_DIR=%p/lib/Singular
export SINGULAR_ROOT_DIR=%p/share/Singular
export SINGULAR_INFO_FILE=%p/share/doc/Singular/info/singular.hlp
export SINGULAR_IDX_FILE=%p/share/doc/Singular/doc/singular.idx
export SINGULAR_HTML_DIR=%p/share/doc/Singular/html
export SINGULAR_EXAMPLES_DIR=%p/share/doc/Singular/examples
export PATH="%p/bin:\$PATH"
export SINGULAR_EXECUTABLE="%p/bin/Singular"
exec %p/lib/Singular/ESingular \$*
!ANF
chmod 755 %i/bin/ESingular

rm -rf %p/share/Singular/doc/doc/NTL
for f in `find . -name ChangeLog|sed -e 's,^\./,,'`; do
mkdir -p %i/share/doc/%N/`dirname $f`
cp -p $f %i/share/doc/%N/$f
done
<<
DocFiles: COPYING README
#
Description: Computer algebra system
DescDetail: <<
Singular is a computer algebra system for polynomial computations, with
special emphasis on commutative and non-commutative algebra, algebraic
geometry, and singularity theory.

Its main computational objects are ideals, modules and matrices over a
large number of baserings.
<<
DescPackaging: <<
Disabling MP on 64 bit as it requires sizeof(long)==4.

Patching libparse.{l,cc} to avoid error with strict C++ compilers.

Add explict include for to work around problems on 10.7
caused by singular trying to "trick" GMP into thinking it is being
compiled in a C compiler, not a C++ compiler.

Previous revisions by Michael Brickenstein.
<<

singular stable port .patch

diff -ru Singular-3-1-4/CMakeLists.txt Singular-3-1-4-patched/CMakeLists.txt
--- Singular-3-1-4/CMakeLists.txt 2010-09-21 20:22:04.000000000 +0200
+++ Singular-3-1-4-patched/CMakeLists.txt 2012-03-19 16:44:03.000000000 +0100
@@ -120,12 +120,12 @@

#set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wno-non-virtual-dtor")
set(CMAKE_C_FLAGS "-w -pipe ")
- set(CMAKE_CXX_FLAGS "-w -pipe ") #--no-rtti
+ set(CMAKE_CXX_FLAGS "-w -pipe ") #-fno-rtti
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

set(CMAKE_C_FLAGS_RELEASE "-O3 -fomit-frame-pointer")
- set(CMAKE_CXX_FLAGS_RELEASE "-O3 --no-rtti -fomit-frame-pointer")
+ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-rtti -fomit-frame-pointer")

#set(CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -DNDEBUG ")
#set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fomit-frame-pointer -DNDEBUG -DOM_NDEBUG")
diff -ru Singular-3-1-4/IntegerProgramming/gen_test.cc Singular-3-1-4-patched/IntegerProgramming/gen_test.cc
--- Singular-3-1-4/IntegerProgramming/gen_test.cc 2009-11-02 11:12:22.000000000 +0100
+++ Singular-3-1-4-patched/IntegerProgramming/gen_test.cc 2012-03-19 16:44:03.000000000 +0100
@@ -8,7 +8,7 @@

#include "testdata.h"

-main()
+int main()
{
ofstream output1("IP/testmatrix1");
random_matrix(3,4,0,5,output1);
diff -ru Singular-3-1-4/IntegerProgramming/si_gmp.h Singular-3-1-4-patched/IntegerProgramming/si_gmp.h
--- Singular-3-1-4/IntegerProgramming/si_gmp.h 2009-11-02 11:12:22.000000000 +0100
+++ Singular-3-1-4-patched/IntegerProgramming/si_gmp.h 2012-03-19 16:44:03.000000000 +0100
@@ -4,6 +4,7 @@
#ifndef INCL_CF_GMP_H
#define INCL_CF_GMP_H

+#include
#if defined(__cplusplus) && defined(__GNUC__)
extern "C" {
#undef __cplusplus
diff -ru Singular-3-1-4/Singular/configure Singular-3-1-4-patched/Singular/configure
--- Singular-3-1-4/Singular/configure 2012-01-24 20:00:05.000000000 +0100
+++ Singular-3-1-4-patched/Singular/configure 2012-03-19 16:44:03.000000000 +0100
@@ -1333,10 +1333,10 @@
ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cxx_cross

- # check whether gcc accepts --no-rtti
- echo $ac_n "checking whether gcc accepts --no-rtti""... $ac_c" 1>&6
-echo "configure:1361: checking whether gcc accepts --no-rtti" >&5
- CXXFLAGS="${CXXFLAGS} --no-rtti"
+ # check whether gcc accepts -fno-rtti
+ echo $ac_n "checking whether gcc accepts -fno-rtti""... $ac_c" 1>&6
+echo "configure:1361: checking whether gcc accepts -fno-rtti" >&5
+ CXXFLAGS="${CXXFLAGS} -fno-rtti"
if eval "test \"`echo '$''{'ac_cv_cxx_have_rtti'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1365,14 +1365,14 @@
if test "${ac_cv_cxx_have_rtti}" != yes; then
CXXFLAGS="$temp_flags"
else
- CXXFLAGS="${temp_flags} --no-rtti"
+ CXXFLAGS="${temp_flags} -fno-rtti"
temp_flags="${CXXFLAGS}"
fi

-# check whether gcc accepts --no-exceptions
- echo $ac_n "checking whether gcc accepts --no-exceptions""... $ac_c" 1>&6
-echo "configure:1397: checking whether gcc accepts --no-exceptions" >&5
- CXXFLAGS="${CXXFLAGS} --no-exceptions"
+# check whether gcc accepts -fno-exceptions
+ echo $ac_n "checking whether gcc accepts -fno-exceptions""... $ac_c" 1>&6
+echo "configure:1397: checking whether gcc accepts -fno-exceptions" >&5
+ CXXFLAGS="${CXXFLAGS} -fno-exceptions"
if eval "test \"`echo '$''{'ac_cv_cxx_have_exceptions'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1401,7 +1401,7 @@
if test "${ac_cv_cxx_have_exceptions}" != yes; then
CXXFLAGS="$temp_flags"
else
- CXXFLAGS="${temp_flags} --no-exceptions"
+ CXXFLAGS="${temp_flags} -fno-exceptions"
temp_flags="${CXXFLAGS}"
fi

@@ -1500,12 +1500,12 @@
fi
temp_flags="${CXXFLAGS}"
if test "${ac_cv_cxx_have_rtti}" = yes; then
- CXXFLAGS="${temp_flags} --no-rtti"
+ CXXFLAGS="${temp_flags} -fno-rtti"
fi
temp_flags="${CXXFLAGS}"
CXXTEMPLFLAGS="-fno-implicit-templates"
if test "${ac_cv_cxx_have_exceptions}" = yes; then
- CXXTEMPLFLAGS="${CXXTEMPLFLAGS} --no-exceptions"
+ CXXTEMPLFLAGS="${CXXTEMPLFLAGS} -fno-exceptions"
fi
if test "$ac_cv_is_aix" = yes; then
CXXNOOPTFLAGS="-w"
diff -ru Singular-3-1-4/Singular/libparse.cc Singular-3-1-4-patched/Singular/libparse.cc
--- Singular-3-1-4/Singular/libparse.cc 2011-04-14 10:41:39.000000000 +0200
+++ Singular-3-1-4-patched/Singular/libparse.cc 2012-03-19 16:44:03.000000000 +0100
@@ -3503,14 +3503,14 @@
}

#ifdef STANDALONE_PARSER
-main( int argc, char *argv[] )
+int main( int argc, char *argv[] )
{
lib_style_types lib_style;
main_init(argc, argv);
if(yyin == NULL)
{
fprintf(stderr, "No library found to parse.\n");
- exit(1);
+ return 1;
}
if (! (texinfo_out || category_out))
{
@@ -3532,7 +3532,7 @@
else if(pi!=NULL) printpi(pi);
if (texinfo_out)
printf("1;");
- exit(0);
+ return 0;
}

#endif /* STANDALONE_PARSER */
diff -ru Singular-3-1-4/Singular/libparse.l Singular-3-1-4-patched/Singular/libparse.l
--- Singular-3-1-4/Singular/libparse.l 2010-10-26 13:30:57.000000000 +0200
+++ Singular-3-1-4-patched/Singular/libparse.l 2012-03-19 16:44:03.000000000 +0100
@@ -964,14 +964,14 @@
}

#ifdef STANDALONE_PARSER
-main( int argc, char *argv[] )
+int main( int argc, char *argv[] )
{
lib_style_types lib_style;
main_init(argc, argv);
if(yyin == NULL)
{
fprintf(stderr, "No library found to parse.\n");
- exit(1);
+ return 1;
}
if (! (texinfo_out || category_out))
{
@@ -993,7 +993,7 @@
else if(pi!=NULL) printpi(pi);
if (texinfo_out)
printf("1;");
- exit(0);
+ return 0;
}

#endif /* STANDALONE_PARSER */
diff -ru Singular-3-1-4/dyn_modules/bigintm/SConstruct Singular-3-1-4-patched/dyn_modules/bigintm/SConstruct
--- Singular-3-1-4/dyn_modules/bigintm/SConstruct 2011-04-25 08:25:05.000000000 +0200
+++ Singular-3-1-4-patched/dyn_modules/bigintm/SConstruct 2012-03-19 16:44:03.000000000 +0100
@@ -17,7 +17,7 @@

#env.SharedObject(target = 'mod_main.o', source = 'mod_main.cc')

-CXXTEMPLFLAGS = "-fno-implicit-templates --no-exceptions"
+CXXTEMPLFLAGS = "-fno-implicit-templates -fno-exceptions"

if env ['PLATFORM'] == "darwin":
MACOSXMODULEFLAGS = '-twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup'
@@ -49,7 +49,7 @@
SHLIBSUFFIX = ".so",
CPPPATH = SING_INCLUDES,
CPPDEFINES = ["NDEBUG", "OM_NDEBUG"],
- CXXFLAGS = "-O3 -fomit-frame-pointer --no-rtti " + CXXTEMPLFLAGS,
+ CXXFLAGS = "-O3 -fomit-frame-pointer -fno-rtti " + CXXTEMPLFLAGS,
CCFLAGS="-O3 -fomit-frame-pointer ",
LDMODULEFLAGS = BUNDLETEMPFLAGS,
LIBS=[])
diff -ru Singular-3-1-4/dyn_modules/modgen/Makefile.in Singular-3-1-4-patched/dyn_modules/modgen/Makefile.in
--- Singular-3-1-4/dyn_modules/modgen/Makefile.in 2010-07-17 23:16:03.000000000 +0200
+++ Singular-3-1-4-patched/dyn_modules/modgen/Makefile.in 2012-03-19 16:44:03.000000000 +0100
@@ -44,7 +44,7 @@
##
## compiler and linker options
##
-CFLAGS += --no-rtti --no-exceptions -O3 -w -fomit-frame-pointer -pipe -fno-implicit-templates \
+CFLAGS += -fno-rtti -fno-exceptions -O3 -w -fomit-frame-pointer -pipe -fno-implicit-templates \
-g -I${includedir} -I../include -I${topsrcdir}/.. -DNDEBUG -DMODULE_GENERATOR \
-D${SING_UNAME}
LIBS += -L/usr/local/lib
diff -ru Singular-3-1-4/dyn_modules/syzextra/SConstruct Singular-3-1-4-patched/dyn_modules/syzextra/SConstruct
--- Singular-3-1-4/dyn_modules/syzextra/SConstruct 2011-04-25 08:25:05.000000000 +0200
+++ Singular-3-1-4-patched/dyn_modules/syzextra/SConstruct 2012-03-19 16:44:03.000000000 +0100
@@ -17,7 +17,7 @@

#env.SharedObject(target = 'mod_main.o', source = 'mod_main.cc')

-CXXTEMPLFLAGS = "-fno-implicit-templates --no-exceptions"
+CXXTEMPLFLAGS = "-fno-implicit-templates -fno-exceptions"

if env ['PLATFORM'] == "darwin":
MACOSXMODULEFLAGS = '-twolevel_namespace -weak_reference_mismatches weak -undefined dynamic_lookup'
@@ -49,7 +49,7 @@
SHLIBSUFFIX = ".so",
CPPPATH = SING_INCLUDES,
CPPDEFINES = ["NDEBUG", "OM_NDEBUG"],
- CXXFLAGS = "-O3 -fomit-frame-pointer --no-rtti " + CXXTEMPLFLAGS,
+ CXXFLAGS = "-O3 -fomit-frame-pointer -fno-rtti " + CXXTEMPLFLAGS,
CCFLAGS="-O3 -fomit-frame-pointer ",
LDMODULEFLAGS = BUNDLETEMPFLAGS,
LIBS=[])
diff -ru Singular-3-1-4/factory/CMakeLists.txt Singular-3-1-4-patched/factory/CMakeLists.txt
--- Singular-3-1-4/factory/CMakeLists.txt 2010-09-21 20:22:04.000000000 +0200
+++ Singular-3-1-4-patched/factory/CMakeLists.txt 2012-03-19 16:44:03.000000000 +0100
@@ -74,7 +74,7 @@
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")

#set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wno-non-virtual-dtor")
- set(CMAKE_CXX_FLAGS "-w --no-rtti -pipe ")
+ set(CMAKE_CXX_FLAGS "-w -fno-rtti -pipe ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
#add_definitions(-DNDEBUG -DOM_NDEBUG -Dx86_64_Linux -DHAVE_CONFIG_H)

diff -ru Singular-3-1-4/kernel/kutil.cc Singular-3-1-4-patched/kernel/kutil.cc
--- Singular-3-1-4/kernel/kutil.cc 2012-01-27 15:00:05.000000000 +0100
+++ Singular-3-1-4-patched/kernel/kutil.cc 2012-03-19 16:44:18.000000000 +0100
@@ -6670,7 +6670,7 @@

void kDebugPrint(kStrategy strat)
{
- extern long maxdegreeWecart(poly p,int *l, ring r = currRing); /*weight.h*/
+ extern long maxdegreeWecart(poly p,int *l, ring r); /*weight.h*/
PrintS("red: ");
if (strat->red==redFirst) PrintS("redFirst\n");
else if (strat->red==redHoney) PrintS("redHoney\n");
diff -ru Singular-3-1-4/kernel/si_gmp.h Singular-3-1-4-patched/kernel/si_gmp.h
--- Singular-3-1-4/kernel/si_gmp.h 2010-09-17 15:36:19.000000000 +0200
+++ Singular-3-1-4-patched/kernel/si_gmp.h 2012-03-19 16:44:03.000000000 +0100
@@ -2,6 +2,8 @@

#ifndef INCL_CF_GMP_H
#define INCL_CF_GMP_H
+
+#include
#ifdef HAVE_FACTORY
# include
#else
diff -ru Singular-3-1-4/libfac/CMakeLists.txt Singular-3-1-4-patched/libfac/CMakeLists.txt
--- Singular-3-1-4/libfac/CMakeLists.txt 2010-09-21 20:22:04.000000000 +0200
+++ Singular-3-1-4-patched/libfac/CMakeLists.txt 2012-03-19 16:44:03.000000000 +0100
@@ -35,7 +35,7 @@
if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")

#set(CMAKE_CXX_FLAGS "-W -Wall -Wextra -Wno-non-virtual-dtor")
- set(CMAKE_CXX_FLAGS "-w --no-rtti -pipe ")
+ set(CMAKE_CXX_FLAGS "-w -fno-rtti -pipe ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

singular _unstable_ port .patch