[python-polybori] New upstream version. Drop upstreamed m4ri patch. Add upstream patch to adapt to ipython 0.11. Add w

Jerry James jjames at fedoraproject.org
Wed Sep 7 23:38:43 UTC 2011


commit 3c6a79760e6bf62b5194aae5219bf65f4ce1591b
Author: Jerry James <loganjerry at gmail.com>
Date:   Wed Sep 7 17:37:38 2011 -0600

    New upstream version.
    Drop upstreamed m4ri patch.
    Add upstream patch to adapt to ipython 0.11.
    Add warning patch to silence a few warnings, and fix one actual bug.

 .gitignore                        |    2 +-
 polybori-dont-build-libcudd.patch |   56 ++++++++--------
 polybori-ipython.patch            |  134 +++++++++++++++++++++++++++++++++++++
 polybori-m4ri.patch               |   36 ----------
 polybori-warning.patch            |   84 +++++++++++++++++++++++
 polybori.desktop                  |    2 +-
 python-polybori.spec              |   78 ++++++++++++---------
 sources                           |    2 +-
 8 files changed, 293 insertions(+), 101 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 3217670..1cef8d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1 @@
-/polybori-0.7.1.tar.gz
+/polybori-0.7.2.tar.gz
diff --git a/polybori-dont-build-libcudd.patch b/polybori-dont-build-libcudd.patch
index 0166537..1fadaf2 100644
--- a/polybori-dont-build-libcudd.patch
+++ b/polybori-dont-build-libcudd.patch
@@ -1,6 +1,6 @@
---- SConstruct.orig	2011-04-27 05:00:31.000000000 -0600
-+++ SConstruct	2011-05-23 16:04:42.723216338 -0600
-@@ -527,12 +527,12 @@
+--- SConstruct.orig	2011-09-05 17:11:21.000000000 -0600
++++ SConstruct	2011-09-07 14:27:58.450940097 -0600
+@@ -711,12 +711,12 @@
      for file in glob(CuddPath(fname)):
          cudd_resources.remove(file)
  
@@ -17,16 +17,16 @@
  
  def SymlinkReadableLibname(files):
      """ Generate symbolik link with more readable library name."""
-@@ -569,7 +569,7 @@
- #    slib=env.LoadableModule
- 
- 
+@@ -750,7 +750,7 @@
+ slib = env.SharedLibrary
+ if env['SHLIBVERSIONING']:
+     slib = VersionatedSharedLibrary
 -libCuddShared = slib(CuddPath(cudd_name), list(shared_resources))
 +#libCuddShared = slib(CuddPath(cudd_name), list(shared_resources))
  
  
  ######################################################################
-@@ -633,17 +633,17 @@
+@@ -819,17 +819,17 @@
  
  for t in tests_pb:
      env.Program(TestsPath(t), 
@@ -36,10 +36,10 @@
  
  for t in tests_gb:
      env.Program(TestsPath(t), 
--        [TestsPath('src', t + ".cc"), libpb, gb]+ libCudd, 
-+        [TestsPath('src', t + ".cc"), libpb, gb], #+ libCudd, 
-         CPPPATH=CPPPATH)
- 
+-                [TestsPath('src', t + ".cc"), libpb, gb]+ libCudd,
++                [TestsPath('src', t + ".cc"), libpb, gb], #+ libCudd,
+                 LIBS = env['LIBS'] + GD_LIBS,
+                 CPPPATH=CPPPATH)
  for t in ['booleenv_test']:
      env.Program(TestsPath(t), 
 -                [TestsPath('src', t + ".cc"), TestsPath('src', t + "_static.cc"), libpb]+ libCudd, 
@@ -47,8 +47,8 @@
                  CPPPATH=CPPPATH)
  
  testclasses = Split("""BooleEnv BooleSet BooleConstant BoolePolyRing
-@@ -652,7 +652,7 @@
-              testclasses] + [TestsPath('src', "unittests.cc")]
+@@ -839,7 +839,7 @@
+ 
  
  env.Program(TestsPath("unittests"),
 -            testfiles + [libpb, gb] + libCudd, 
@@ -56,7 +56,7 @@
              CPPPATH=CPPPATH, LIBS = env['LIBS'] + ["boost_unit_test_framework"],
              CPPDEFINES = env['CPPDEFINES'] +
              ["BOOST_TEST_DYN_LINK"] )
-@@ -663,7 +663,7 @@
+@@ -850,7 +850,7 @@
               testclassesorderings] + [TestsPath('src', "unittests_orderings.cc")]
  
  env.Program(TestsPath("unittests_orderings"),
@@ -65,8 +65,8 @@
              CPPPATH=CPPPATH, LIBS = env['LIBS'] + ["boost_unit_test_framework"],
              CPPDEFINES = env['CPPDEFINES'] +
              ["BOOST_TEST_DYN_LINK"] )
-@@ -731,7 +731,7 @@
- 
+@@ -932,7 +932,7 @@
+         DefaultBuild(env.Install(polybori_modules, f))
  
      
 -    to_append_for_profile = [libpb, gb] + libCudd
@@ -74,21 +74,21 @@
      #to_append_for_profile=File('/lib/libutil.a')
      env.Program(PyPBPath('profiled'), wrapper_files+to_append_for_profile,
              LDMODULESUFFIX=".so",SHLIBPREFIX="", 
-@@ -890,7 +890,7 @@
-     env.AlwaysBuild(srcdistri)
-     env.Alias('distribute', srcdistri)
-     
+@@ -1093,7 +1093,7 @@
+ 
+ dylibs += libpbShared + libgbShared
+ 
 -devellibs = [libpb,gb] + libCudd + libpbShared + libgbShared + libCuddShared
 +devellibs = [libpb,gb] + libpbShared + libgbShared
- readabledevellibs = SymlinkReadableLibname(devellibs)
+ stlibs += [libpb, gb]
  
- # Installation for development purposes
-@@ -902,7 +902,7 @@
-     env.Install(DevelInstPath('include/polybori'), glob(PBPath('include/*.h')))
+ readabledevellibs = pb_symlinks + gb_symlinks + SymlinkReadableLibname([libpb,
+@@ -1116,7 +1116,7 @@
      env.Install(DevelInstPath('include/polybori/groebner'),
                  glob(GBPath('src/*.h')))
--    env.Install(DevelInstPath('include/cudd'), cudd_headers)
-+    #env.Install(DevelInstPath('include/cudd'), cudd_headers)
+     # Install our own copy the cudd header to ensure correct (patched) version 
+-    env.Install(DevelInstInclPath('cudd'), cudd_headers)
++    # env.Install(DevelInstInclPath('cudd'), cudd_headers)
      if not(external_m4ri):
-         env.Install(DevelInstPath('include/m4ri'), glob('M4RI/*.h'))
+         env.Install(DevelInstInclPath('m4ri'), glob('M4RI/m4ri/*.h'))
          
diff --git a/polybori-ipython.patch b/polybori-ipython.patch
new file mode 100644
index 0000000..4c2f89c
--- /dev/null
+++ b/polybori-ipython.patch
@@ -0,0 +1,134 @@
+--- ./ipbori/ipythonrc-polybori.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./ipbori/ipythonrc-polybori	2011-09-07 15:40:52.223977416 -0600
+@@ -21,20 +21,6 @@
+ # PolyBoRi path (either set by wrapper or assumed to be the parent directory)
+ # Note: change "execute pbdir = '..'", if you manually install this profile
+ execute from os import environ as env
+-execute from os import path as os_path
+-execute pbdir = '..'
+-execute if 'PBDIR' in env.keys(): pbdir = env['PBDIR']
+-
+-execute ipbdir = os_path.join(pbdir, 'ipbori')
+-execute if 'IPBDIR' in env.keys(): pbdir = env['IPBDIR']
+-
+-                              
+-# Get program name and prompt something
+-execute ipbname = 'ipbori'
+-execute if 'IPBNAME' in env.keys(): ipbname = env['IPBNAME']
+-execute print ipbname, "-- PolyBoRi's interactive command line tool"
+-execute print 'Type "polybori_copyright()" or "polybori_license()"',
+-execute print 'for more information.\n'
+ 
+ # Uncomment, if we want to skip the banner 
+ # banner 0
+@@ -42,26 +28,17 @@
+ # Include base config from current IPYTHONDIR and only add some extras
+ include ipythonrc
+ 
+-# Append the PolyBoRi application directory to current search path
+-execute from sys import path
+-
+-# The following string may be changed by install. If not installed, use default.
+-execute relpyroot = '$RELATIVEPYPREFIX'
+-execute if relpyroot[0] == '$': relpyroot = '../pyroot'
+-execute pyroot = os_path.join(ipbdir, relpyroot)
+-execute path.insert(0, pyroot)
++# execute PolyBoRi settings
++execut from os import environ as env
++execute exec(env["IPBORI_INIT_CMDS"])
++execute print ''
+ 
+ # Get all basic stuff from PyPolyBoRi
+ execute from polybori.PyPolyBoRi import *
+-execute r = Ring(10000)
+-execute x = Variable
+ 
+ # Get all-inclusive groebner routine
+ execute from polybori.gbcore import groebner_basis
+ 
+-# Import some high-level modelling functionality
+-execute from polybori import *
+-
+ execute pb_copy =  "Copyright (c) 2007-2010 by The PolyBoRi Team.\n"
+ execute pb_copy +=  "  Michael Brickenstein (MFO)  brickenstein at mfo.de\n"
+ execute pb_copy +=  "  Alexander Dreyer (ITWM)     "
+@@ -90,9 +67,3 @@
+ 
+ execute def polybori_copyright(): print pb_copy 
+ execute def polybori_license(): print pb_lic
+-
+-# Get special stuff for this user interface
+-execute from polybori.frontend import *
+-
+-# Simplify ring declaration
+-execute def declare_ring(arg1, arg2 = None): return ternary_declare_ring(arg1, arg2, globals())
+--- ./ipbori/ipbori.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./ipbori/ipbori	2011-09-07 15:27:58.534959479 -0600
+@@ -65,5 +65,23 @@
+ # installing the profile, but custom settings like IPYTHONDIR/ipythonrc are
+ # still available. 
+ # (For the latter, ipythonrc-polybori needs to import ipythonrc.)
+-${IPYTHONPREFIX}ipython -rcfile ${IPBDIR}/ipythonrc-polybori  $@
++#${IPYTHONPREFIX}ipython -rcfile ${IPBDIR}/ipythonrc-polybori  $@
++
++export PBORI_SITE="pyroot/"
++
++# Note: $PBORI_SITE is replaced on installation with relative path
++# to the PolyBoRi python site
++export IPBORI_INIT_CMDS="import sys; sys.path.insert(0, '$PBDIR/$PBORI_SITE');\
++from polybori.frontend import *; polybori_start(globals())"
++
++IPYTHON=${IPYTHONPREFIX}ipython
+ 
++# RCfiles are supported up to ipython 0.11
++if [[ `$IPYTHON --c="import IPython; \
++    ([eval(elt) for elt in IPython.__version__.split('.')[:2] ]< [0, 11]) "\
++    -quick` =~ "True" ]]
++then
++    ${IPYTHON} -rcfile ${IPBDIR}/ipythonrc-polybori $@
++else
++    ${IPYTHON} --c="print'';$IPBORI_INIT_CMDS" --i
++fi
+--- ./pyroot/polybori/frontend.py.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./pyroot/polybori/frontend.py	2011-09-07 15:44:38.499331854 -0600
+@@ -1,15 +1,7 @@
++# Import basic functionality
++from polybori import *
+ from polybori.blocks import declare_ring as orig_declare_ring
+-
+-def ternary_declare_ring(blocks, context, global_context):
+-    """This is just a wrapper fpr declare_ring, which selects context, if it is
+-    not None and global_context otherwise."""
+-    if context is None:
+-        context = global_context
+-        
+-    return orig_declare_ring(blocks, context)
+-
+-
+-
++from os import environ as env, path as os_path
+ 
+ def block_scheme_names(blocks):
+     """Helper for Singular interface."""
+@@ -19,3 +11,21 @@
+     declare_block_scheme(blocks, context)
+ 
+     return context.keys()
++
++ipbname = 'ipbori'
++
++def polybori_start(global_context):
++    def declare_ring(blocks, context=None):
++        if context is None:
++            context = global_context
++
++        return orig_declare_ring(blocks, context)
++    declare_ring.__doc__ = orig_declare_ring.__doc__
++    global_context["declare_ring"] = declare_ring
++
++    print ipbname + """ -- PolyBoRi's interactive command line tool
++Type "polybori_copyright()" or "polybori_license()" for more information."""
++
++# Here come the defaults
++r = Ring(10000)
++x = Variable
diff --git a/polybori-warning.patch b/polybori-warning.patch
new file mode 100644
index 0000000..d913bfa
--- /dev/null
+++ b/polybori-warning.patch
@@ -0,0 +1,84 @@
+--- ./polybori/src/CCheckedIdx.cc.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./polybori/src/CCheckedIdx.cc	2011-09-07 15:59:56.582554627 -0600
+@@ -1,6 +1,6 @@
+ // -*- c++ -*-
+ //*****************************************************************************
+-/** @file CCheckedIdx.c
++/** @file CCheckedIdx.cc
+  *
+  * @author Alexander Dreyer
+  * @date 2011-02-31
+--- ./polybori/include/CTermStack.h.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./polybori/include/CTermStack.h	2011-09-07 15:59:37.112952015 -0600
+@@ -403,7 +403,7 @@
+     bool invalid = true;
+     while (!base::empty() && invalid) {
+       incrementElse();
+-      if (invalid = base::isInvalid())
++      if ((invalid = base::isInvalid()))
+         base::decrementNode();
+     }
+   }
+@@ -611,7 +611,7 @@
+     while (!atBegin() && invalid) {
+       assert(!base::isConstant());
+       base::incrementElse();
+-      if (invalid = base::isInvalid())
++      if ((invalid = base::isInvalid()))
+         base::decrementNode();
+     }
+   }
+@@ -785,7 +785,7 @@
+         }
+         base::gotoEnd();
+ 
+-        if (doloop = (base::isInvalid() || (base::size() != size)) )
++        if ((doloop = (base::isInvalid() || (base::size() != size)) ))
+           base::decrementNode();
+ 
+     } while (!base::empty() && doloop);
+--- ./polybori/include/CCallbackWrapper.h.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./polybori/include/CCallbackWrapper.h	2011-09-07 16:02:30.144421218 -0600
+@@ -30,7 +30,7 @@
+  * If applies a stored member function pointer (together with a stored object
+  * reference) to the argument of operator().
+  *
+- * It is to be used as a face of @Type, e. g. for @c CCallbackWrapper below.
++ * It is to be used as a face of @c Type, e. g. for @c CCallbackWrapper below.
+  *
+  * @note Specialized variant to void member functions
+  * @attention Currently, the class supports unary functions only.
+--- ./polybori/include/order_tags.h.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./polybori/include/order_tags.h	2011-09-07 16:01:03.231194487 -0600
+@@ -35,7 +35,7 @@
+  **/
+ struct dp_asc_tag {};
+ 
+-/**@class block_tag<Tag>
++/**@class block_tag
+  * @brief Marker for block orderings.
+  **/
+ template <class TagType>
+--- ./polybori/include/CCuddInterface.h.orig	2011-09-05 17:11:22.000000000 -0600
++++ ./polybori/include/CCuddInterface.h	2011-09-07 15:59:37.112952015 -0600
+@@ -43,15 +43,15 @@
+   // get cudd error texts
+ inline const char* error_text(DdManager* mgr) {
+     switch (Cudd_ReadErrorCode(mgr)) {
+-    CUDD_MEMORY_OUT:
++    case CUDD_MEMORY_OUT:
+       return("Out of memory.");
+-    CUDD_TOO_MANY_NODES:
++    case CUDD_TOO_MANY_NODES:
+       return("To many nodes.");
+-    CUDD_MAX_MEM_EXCEEDED:
++    case CUDD_MAX_MEM_EXCEEDED:
+       return("Maximum memory exceeded.");
+-    CUDD_INVALID_ARG:
++    case CUDD_INVALID_ARG:
+       return("Invalid argument.");
+-    CUDD_INTERNAL_ERROR:
++    case CUDD_INTERNAL_ERROR:
+       return("Internal error.");
+     }
+     return("Unexpected error.");
diff --git a/polybori.desktop b/polybori.desktop
index ce70826..d7159a8 100644
--- a/polybori.desktop
+++ b/polybori.desktop
@@ -8,4 +8,4 @@ Exec=PolyGUI %U
 TryExec=PolyGUI
 Terminal=false
 StartupNotify=false
-Categories=Education;Science;Math;Qt
+Categories=Education;Science;Math;Qt;
diff --git a/python-polybori.spec b/python-polybori.spec
index f34ab6c..7d4c545 100644
--- a/python-polybori.spec
+++ b/python-polybori.spec
@@ -1,18 +1,24 @@
-Name:           python-polybori
-Version:        0.7.1
-Release:        3%{?dist}
+%global rootname polybori
+
+Name:           python-%{rootname}
+Version:        0.7.2
+Release:        1%{?dist}
 Summary:        Framework for Boolean Rings
 Group:          Development/Libraries
 License:        GPLv2+
 URL:            http://polybori.sourceforge.net/
-Source0:        http://downloads.sourceforge.net/polybori/polybori-%{version}.tar.gz
-Source1:        polybori.desktop
-# Use system CUDD libraries instead of building the included CUDD sources
+Source0:        http://downloads.sourceforge.net/%{rootname}/%{rootname}-%{version}.tar.gz
+Source1:        %{rootname}.desktop
+# This patch is specific to Fedora.  Use system CUDD libraries instead of
+# building the included CUDD sources
 Patch0:         polybori-dont-build-libcudd.patch
-# Adapt to m4ri 20110613
-Patch1:         polybori-m4ri.patch
-# Fix a broken import
-Patch2:         polybori-import.patch
+# This patch was sent upstream 7 Sep 2011.  Fix a broken import
+Patch1:         polybori-import.patch
+# This patch was sent upstream 7 Sep 2011.  Fix some broken code that leads to
+# compiler warnings.
+Patch2:         polybori-warning.patch
+# This patch was produced by upstream.  It adapts to ipython 0.11.
+Patch3:         polybori-ipython.patch
 
 BuildRequires:  boost-devel
 BuildRequires:  cudd-devel
@@ -31,17 +37,17 @@ Requires:       ipython
 Requires:       python-imaging
 Requires:       pyparsing
 
-%global __provides_exclude_from %{python_sitearch}/.*\\\.so$
+%global __provides_exclude_from ^%{python_sitearch}/.*\\\.so$
 
 
 %description
-PolyBoRi is a special purpose computer algebra system for computations in
-Boolean Rings. The core is a C++ library, which provides high-level data
-types for Boolean polynomials and related structures. As a unique
+PolyBoRi is a special purpose computer algebra system for computations
+in Boolean Rings.  The core is a C++ library, which provides high-level
+data types for Boolean polynomials and related structures.  As a unique
 approach, binary decision diagrams are used as internal storage type for
-polynomial structures. On top of this, we provide a Python interface for
-parsing of complex polynomial systems, as well as for sophisticated and
-extendable strategies for Gröbner base computation.
+polynomial structures.  On top of this, we provide a Python interface
+for parsing of complex polynomial systems, as well as for sophisticated
+and extendable strategies for Gröbner base computation.
 
 
 %package        gui
@@ -83,16 +89,16 @@ Static libraries for %{name}.
 
 
 %prep
-%setup -q -n polybori-0.7
+%setup -q -n %{rootname}-%{version}
 %patch0
 %patch1
 %patch2
+%patch3
 
-# Save a doc file
-mv Singular/README README.Singular
+# Remove private copy of system libs (cudd, m4ri, singular, and pyparsing)
+rm -rf Cudd M4RI Singular PyPolyBoRi/pyparsing.py
 
-# Remove private copy of system libs (cudd, m4ri, and singular)
-rm -rf Cudd M4RI Singular
+# Fix up includes of cudd header files
 sed -r -i 's|^(#[[:blank:]]*include[[:blank:]]+)"(cudd.*)"|\1<\2>|' \
   polybori/include/CCuddDDFacade.h polybori/include/CCuddInterface.h \
   polybori/include/CDDOperations.h polybori/include/CRingCore.h \
@@ -100,18 +106,16 @@ sed -r -i 's|^(#[[:blank:]]*include[[:blank:]]+)"(cudd.*)"|\1<\2>|' \
   polybori/src/BoolePolyRing.cc polybori/src/pbori_routines.cc \
   polybori/src/testobj.cc testsuite/src/monomial.cc
 
-# Remove private copy of pyparsing
-rm -f PyPolyBoRi/pyparsing.py
-
 # Fix library path for 64 bit systems
 if [ %{__isa_bits} = "64" ]; then
-  sed -i -e "s|DevelInstPath('lib')|DevelInstPath('lib64')|" SConstruct
+  sed -i "s|'\$DEVEL_PREFIX/lib'|'\$DEVEL_PREFIX/lib64'|" SConstruct
 fi
 
 
 %build
-# scons = suck
-# we have to build in the install section
+scons %{?_smp_mflags} prepare-install \
+  CCFLAGS="%{optflags} -I%{_includedir}/cudd -I%{_includedir}/m4ri" \
+  LIBS="-lcudd -lcuddutil"
 
 
 %install
@@ -146,12 +150,12 @@ g++ -o $RPM_BUILD_ROOT%{python_sitearch}/polybori/PyPolyBoRi.so -shared \
 #rm $RPM_BUILD_ROOT%%{_includedir}/polybori/cacheopts.h
 
 # Remove buildroot from a generated file
-sed -i -e 's|%{buildroot}||' %{buildroot}%{_datadir}/%{name}/ipbori/ipythonrc-polybori
+sed -i 's|%{buildroot}||' %{buildroot}%{_datadir}/%{name}/ipbori/ipythonrc-polybori
 
 # Install the desktop file
 cp -p %{SOURCE1} .
 desktop-file-install --dir=$RPM_BUILD_ROOT%{_datadir}/applications \
-  polybori.desktop
+  %{rootname}.desktop
 
 
 %post -p /sbin/ldconfig
@@ -170,18 +174,18 @@ fi
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE README README.Singular
+%doc LICENSE README
 %{_bindir}/ipbori
 %{_mandir}/man1/ipbori.1*
 %{_datadir}/%{name}
-%{python_sitearch}/polybori
+%{python_sitearch}/%{rootname}
 %{_libdir}/lib*.so.*
 %exclude %{_datadir}/%{name}/gui
 
 
 %files gui
 %{_bindir}/PolyGUI
-%{_datadir}/applications/polybori.desktop
+%{_datadir}/applications/%{rootname}.desktop
 %{_datadir}/%{name}/gui
 %{_mandir}/man1/PolyGUI.1*
 
@@ -193,7 +197,7 @@ fi
 %files devel
 %doc ChangeLog
 %{_libdir}/lib*.so
-%{_includedir}/polybori
+%{_includedir}/%{rootname}
 
 
 %files static
@@ -201,6 +205,12 @@ fi
 
 
 %changelog
+* Wed Sep  7 2011 Jerry James <loganjerry at gmail.com> - 0.7.2-1
+- New upstream version
+- Drop upstreamed m4ri patch
+- Add upstream patch to adapt to ipython 0.11
+- Add warning patch to silence a few warnings, and fix one actual bug
+
 * Thu Jul 21 2011 Jerry James <loganjerry at gmail.com> - 0.7.1-3
 - Rebuild for new m4ri and new boost
 - Use new rpm 4.9 filter scheme
diff --git a/sources b/sources
index 5934988..36600f2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-75d96d234c53dc40ea05a41975b0d80b  polybori-0.7.1.tar.gz
+0449f38b9e7d15de4ac009e9346a60a0  polybori-0.7.2.tar.gz


More information about the scm-commits mailing list