Author: ArcRiley
Date: 2008-04-18 20:34:46 -0400 (Fri, 18 Apr 2008)
New Revision: 1238

Added:
   trunk/pysoy/config.py
   trunk/pysoy/setup.py
Log:
Ticket #954 :
  * new setup.py for PyMill
  * split extension/library info to config.py


Added: trunk/pysoy/config.py
===================================================================
--- trunk/pysoy/config.py                               (rev 0)
+++ trunk/pysoy/config.py       2008-04-19 00:34:46 UTC (rev 1238)
@@ -0,0 +1,68 @@
+''' PySoy's compile and install config '''
+__credits__ = '''Copyright (C) 2006,2007,2008 PySoy Group
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published
+    by the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see http://www.gnu.org/licenses/
+
+  $Id: setup.py 1141 2008-03-13 07:07:31Z ArcRiley $
+''' 
+
+import sys
+
+
+version = 'Trunk'
+
+
+libraries = {
+  'al'       : 'openal',
+  'cairo'    : 'cairo',
+  'gdi'      : 'gdi32',                # windows only
+  'gl'       : {
+    'linux2' : 'GL',
+    'darwin' : '',           # via Framework
+    'win32'  : 'opengl32'}[sys.platform], 
+  'glu'      : {
+    'linux2' : 'GLU',
+    'darwin' : '',                     # via Framework
+    'win32'  : 'glu32'}[sys.platform], 
+  'glew'     : ['GLEW', 'glew32'][sys.platform=='win32'],
+  'glib'     : 'glib-2.0',
+  'gthread'  : 'gthread-2.0',
+  'ode'      : 'ode',
+  'ogg'      : 'ogg',
+  'theora'   : 'theora',
+  'x11'      : 'X11',                  # X11 only
+  'xxf86vm'  : 'Xxf86vm',              # X11 only
+}
+
+
+modules = {
+  '_core'            : ['glew', 'gl', 'ode', 'glib'],
+  '_datatypes'       : ['glew', 'gl', 'ode', 'glib', 'al'],
+  '_internals'       : ['glib', 'gthread'],
+  'actions'          : ['ode'],
+  'atoms'            : [],
+  'audio'            : ['al'],
+  'bodies'           : ['glew', 'gl', 'ode'],
+  'colors'           : ['gl'],  
+  'controllers'      : [],
+  'fields'           : ['gl', 'ode'],
+  'joints'           : ['gl', 'ode'],
+  'materials'        : ['gl', 'glew'],
+  'models'           : ['glew', 'gl', 'glu', 'ode'],
+  'textures'         : ['glew', 'gl', 'theora', 'ogg', 'cairo'],
+  'scenes'           : ['gl', 'ode'],
+  'shapes'           : ['ode'],
+  'transports'       : ['ogg'],
+  'widgets'          : ['glew', 'gl', 'glu'], 
+}

Added: trunk/pysoy/setup.py
===================================================================
--- trunk/pysoy/setup.py                                (rev 0)
+++ trunk/pysoy/setup.py        2008-04-19 00:34:46 UTC (rev 1238)
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+''' PySoy's compile and install script '''
+
+__credits__ = '''Copyright (C) 2006,2007,2008 PySoy Group
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Affero General Public License as published
+    by the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero General Public License
+    along with this program.  If not, see http://www.gnu.org/licenses/
+'''
+
+__version__ = '$Id: setup.py 1141 2008-03-13 07:07:31Z ArcRiley $'
+
+
+import os, sys
+from config import *
+from mill.distutils.core import setup, Extension
+
+############################################################################
+# Setup lists
+
+extensions    = []
+scripts       = []
+include_path  = ['include/']
+extra_compile = []
+extra_link    = []
+
+#
+############################################################################
+# Platform-dependent code
+#
+#######################################
+# Microsoft Windows
+
+if   sys.platform == 'win32'  :
+  modules['_core'].append('gdi')
+  scripts.append('win32_postinstall.py')
+
+#
+#######################################
+# Apple OSX
+
+elif sys.platform == 'darwin' :
+  frameworks = ['-framework', 'Carbon',
+                '-framework', 'OpenGL']
+  extra_compile = frameworks
+  extra_link    = frameworks
+
+#
+#######################################
+# GNU/Linux, BSD, etc
+
+else :
+  modules['_core'].append('x11')
+  modules['_core'].append('xxf86vm')
+  include_path = include_path + [
+    '/usr/include/glib-2.0',
+    '/usr/lib/glib-2.0/include',
+    '/usr/include/cairo',
+    '/usr/local/include']
+#
+############################################################################
+# Populate extensions and include path
+
+for m in modules :
+  sources = []
+  for pfile in os.listdir('src/%s/'%m) :
+    if os.path.splitext(pfile)[1] == '.pym' :
+      sources.append('src/%s/%s'%(m,pfile))
+  extensions.append(Extension(
+    name=m,
+    sources=sources,
+    libraries=[libraries[i] for i in modules[m]],
+    extra_compile_args = extra_compile,
+    extra_link_args = extra_link))
+  include_path.append('src/%s/'%m)
+
+#
+############################################################################
+# Launch distutils
+
+setup (
+  name             = 'PySoy',
+  version          = version,
+  description      = '3D Game Engine for Python',
+  long_description = '''.''',
+  author           = 'PySoy Group',
+  author_email     = '[EMAIL PROTECTED]',
+  maintainer       = 'Arc Riley',
+  maintainer_email = '[EMAIL PROTECTED]',
+  url              = 'http://pysoy.org/',
+  download_url     = 'http://svn.pysoy.org/trunk/pysoy',
+  packages         = ['soy'],
+  package_dir      = {'soy' : 'scripts'},
+  ext_package      = 'soy',
+  ext_modules      = extensions,
+  classifiers      = [
+    'Development Status :: 4 - Beta',
+    'Intended Audience :: Developers',
+    'Natural Language :: English',
+    'Topic :: Education',
+    'Topic :: Games/Entertainment',
+    'Topic :: Multimedia :: Graphics',
+    'Topic :: Scientific/Engineering :: Artificial Intelligence',
+    'Topic :: Scientific/Engineering :: Human Machine Interfaces',
+    'Topic :: Scientific/Engineering :: Visualization',
+    'License :: OSI Approved :: GNU Affero General Public License (AGPL)' ],
+  license          = 'GNU Affero General Public License version 3 (AGPLv3)',
+  #include_dirs     = [os.path.abspath(p) for p in include_path],
+  include_dirs     = include_path,
+  scripts          = scripts)
+
+#
+############################################################################

_______________________________________________
PySoy-SVN mailing list
PySoy-SVN@pysoy.org
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to