Skip to content

Instantly share code, notes, and snippets.

@NichtJens
Created February 27, 2013 12:52
Show Gist options
  • Save NichtJens/5047698 to your computer and use it in GitHub Desktop.
Save NichtJens/5047698 to your computer and use it in GitHub Desktop.
diff --git a/modules/eb/EbModule.py b/modules/eb/EbModule.py
index fd99ecb..8759639 100644
--- a/modules/eb/EbModule.py
+++ b/modules/eb/EbModule.py
@@ -7,7 +7,21 @@ try:
from modules.eb import NativeComp
hasNativeComp = True
except ImportError:
- hasNativeComp = False
+ try:
+ import os
+ old_dir = os.getcwd()
+ os.chdir("modules/eb")
+
+ from distutils.core import run_setup
+ options = "build_ext --inplace clean"
+ run_setup('build_NativeComp.py', options.split())
+
+ os.chdir(old_dir)
+
+ from modules.eb import NativeComp
+ hasNativeComp = True
+ except:
+ hasNativeComp = False
if not hasNativeComp:
print "WARNING: Could not load native EarthBound compression library"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment