Skip to content

Commit

Permalink
Attempt to fix issue with pymunk dll includes.
Browse files Browse the repository at this point in the history
  • Loading branch information
illume committed Dec 5, 2018
1 parent bd4e97e commit 03a7834
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from setuptools import setup, find_packages
import os
from os import path
import sys

Expand All @@ -18,9 +19,23 @@
#
from cx_Freeze import setup, Executable

import cx_Freeze.hooks
if not hasattr(cx_Freeze.hooks, 'load_pymunk'):
def load_pymunk(finder, module):
"""The chipmunk.dll or .dylib or .so is included in the package.
But it is not found by cx_Freeze, so we include it.
"""
import pymunk
finder.IncludeFiles(pymunk.chipmunk_path,
os.path.join(os.path.basename(pymunk.chipmunk_path)),
copyDependentFiles = False)
cx_Freeze.hooks.load_pymunk = load_pymunk

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {
"packages": ["os", "pygame", "sys", "random"],
"packages": [
"os", "pygame", "sys", "random", "pyscroll", "pytmx", "thorpy", "pymunk"
],
"excludes": ["tkinter"],
}
# GUI applications require a different base on Windows (the default is for a
Expand Down Expand Up @@ -70,7 +85,7 @@
# package_data={'stuntcat': []},
url='https://github.com/pygame/stuntcat',
install_requires=['pygame'],
version='0.0.10',
version='0.0.11',
entry_points={
'console_scripts': [
'stuntcat=stuntcat.cli:main',
Expand Down

0 comments on commit 03a7834

Please sign in to comment.