Fixed compiling and installing of so and xml

develop
RusAnon 2010-05-03 21:36:21 +11:00
parent 394002f688
commit 8eeb9296c3
2 changed files with 13 additions and 7 deletions

@ -11,12 +11,9 @@ from .vegetation import Vegetation
from .gui import GUI
class API(_pydfhack._API):
started = None
for file in ["Memory.xml", os.path.join("..","..","output","Memory.xml")]:
if os.path.isfile(file):
datafile = file
break
else:
path = os.path.dirname(os.path.abspath(__file__))
datafile = os.path.join(path, "Memory.xml")
if not os.path.isfile(datafile):
raise ImportError, "Memory.xml not found."
def prepare(self):

@ -8,7 +8,7 @@ except ImportError:
from distutils.core import Extension
from os import path
e = Extension("_pydfhack",
e = Extension("pydfhack._pydfhack",
sources=["DF_API.cpp", "DF_Buildings.cpp", "DF_Constructions.cpp", "DF_CreatureManager.cpp", "DF_GUI.cpp", "DF_Maps.cpp", "DF_Material.cpp", "DF_Position.cpp", "DF_Translate.cpp", "DF_Vegetation.cpp", "pydfhack.cpp"],
include_dirs=["../", path.join("..", "include"), path.join("..","depends","md5"), path.join("..","depends","tinyxml")],
library_dirs=[path.join("..","..","output")],
@ -16,11 +16,20 @@ e = Extension("_pydfhack",
libraries=["dfhack"],
export_symbols=["init_pydfhack", "ReadRaw", "WriteRaw"])
for file in ["Memory.xml", path.join("..","..","output","Memory.xml")]:
if path.isfile(file):
datafile = file
break
else:
raise Exception("Memory.xml not found.")
setup(
name="PyDFHack",
description="Python wrapper and bindings for DFHack library",
version="1.0",
packages=find_packages(exclude=['ez_setup']),
data_files=[('pydfhack', [datafile])],
include_package_data=True,
test_suite='nose.collector',
zip_safe=False,