#1 Use system version of Box2D.
Merged 6 years ago by pbrobinson. Opened 6 years ago by cstratak.
Unknown source master  into  master

file modified
+9 -2
@@ -1,6 +1,6 @@

  Name:           sugar-physics

  Version:        32.1

- Release:        2%{?dist}

+ Release:        3%{?dist}

  Summary:        A physical world simulator and playground for Sugar

  

  Group:          Sugar/Activities
@@ -8,6 +8,9 @@

  URL:            http://wiki.sugarlabs.org/go/Activities/Physics

  Source0:        https://github.com/sugarlabs/physics/archive/v%{version}.tar.gz

  

+ # Use the system version of Box2D and not the one that upstream bundles.

+ Patch0: use-system-box2d.patch

+ 

  BuildRequires:  sugar-toolkit-gtk3

  BuildRequires:  gettext

  Requires:       sugar
@@ -22,7 +25,7 @@

  friction, and inertia.

  

  %prep

- %autosetup -n physics-%{version}

+ %autosetup -n physics-%{version} -p1

  

  # remove bundled libraries

  rm -rf lib olpcgames
@@ -45,6 +48,10 @@

  %{sugaractivitydir}/Physics.activity/

  

  %changelog

+ * Tue Oct 17 2017 Charalampos Stratakis <cstratak@redhat.com> - 32.1-3

+ - Use system version of Box2D and not the bundled one.

+ Resolves: rhbz#1446934

+ 

  * Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 32.1-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

  

@@ -0,0 +1,39 @@

+ diff --git a/myelements/elements.py b/myelements/elements.py

+ index dca83f1..19b2a3e 100644

+ --- a/myelements/elements.py

+ +++ b/myelements/elements.py

+ @@ -30,7 +30,7 @@ __contact__ = '<elements@linuxuser.at>'

+  

+  # Load Box2D

+  try:

+ -    import lib.Box2D as box2d

+ +    import Box2D as box2d

+  except:

+      print 'Could not load the pybox2d library (Box2D).'

+      print 'Please run "setup.py install" to install the dependencies.'

+ diff --git a/physics.py b/physics.py

+ index 15cbf0d..8f11906 100644

+ --- a/physics.py

+ +++ b/physics.py

+ @@ -36,7 +36,7 @@ from pygame.color import *

+  

+  # from sugar3.activity import activity

+  # sys.path.insert(0, os.path.join(activity.get_bundle_path(), 'lib'))

+ -import lib.Box2D as box2d

+ +import Box2D as box2d

+  import myelements as elements

+  

+  import tools

+ diff --git a/tools.py b/tools.py

+ index 94fd517..e858050 100644

+ --- a/tools.py

+ +++ b/tools.py

+ @@ -32,7 +32,7 @@ from gettext import gettext as _

+  from pygame.locals import *

+  from helpers import *

+  

+ -import lib.Box2D as box2d

+ +import Box2D as box2d

+  

+  from sugar3.activity import activity

+  

Upstream bundles their own copy of Box2D, for which
they append the directory to the python path and import it
the package.

However those import statements do not work, since the Fedora
package unbundles Box2D, thus we have to change them to rely
on the system one.

Resolves: rhbz#1446934

Pull-Request has been merged by pbrobinson

6 years ago
Metadata