mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 13:20:08 +02:00
pygame recipe. Only x86_gcc2. Patchset in wrong format as haikuporter -e does not work for me.
This commit is contained in:
@@ -1,204 +0,0 @@
|
||||
diff -urN pygame-1.9.1release/config.py pygame-1.9.1release-haiku/config.py
|
||||
--- pygame-1.9.1release/config.py 2009-07-09 06:13:20.025952256 +0000
|
||||
+++ pygame-1.9.1release-haiku/config.py 2010-09-17 09:54:05.000000000 +0000
|
||||
@@ -119,6 +119,9 @@
|
||||
elif sys.platform == 'win32':
|
||||
print_('Using WINDOWS mingw/msys configuration...\n')
|
||||
import config_msys as CFG
|
||||
+ elif sys.platform == 'haiku1':
|
||||
+ print_('Using Haiku configuration...\n')
|
||||
+ import config_haiku as CFG
|
||||
elif sys.platform == 'darwin':
|
||||
print_('Using Darwin configuration...\n')
|
||||
import config_darwin as CFG
|
||||
diff -urN pygame-1.9.1release/config_haiku.py pygame-1.9.1release-haiku/config_haiku.py
|
||||
--- pygame-1.9.1release/config_haiku.py 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ pygame-1.9.1release-haiku/config_haiku.py 2010-09-17 10:02:14.000000000 +0000
|
||||
@@ -0,0 +1,187 @@
|
||||
+"""Config on Haiku"""
|
||||
+
|
||||
+import os, sys
|
||||
+from glob import glob
|
||||
+from distutils.sysconfig import get_python_inc
|
||||
+
|
||||
+# Python 2.x/3.x compatibility
|
||||
+try:
|
||||
+ raw_input
|
||||
+except NameError:
|
||||
+ raw_input = input
|
||||
+
|
||||
+configcommand = os.environ.get('SDL_CONFIG', 'sdl-config',)
|
||||
+configcommand = configcommand + ' --version --cflags --libs'
|
||||
+localbase = os.environ.get('LOCALBASE', '')
|
||||
+
|
||||
+#these get prefixes with '/usr' and '/usr/local' or the $LOCALBASE
|
||||
+origincdirs = ['/include', '/include/SDL', '/include/SDL',
|
||||
+ '/include/smpeg' ]
|
||||
+origlibdirs = ['/lib','/lib64','/X11R6/lib']
|
||||
+
|
||||
+def confirm(message):
|
||||
+ "ask a yes/no question, return result"
|
||||
+ reply = raw_input('\n' + message + ' [Y/n]:')
|
||||
+ if reply and (reply[0].lower()) == 'n':
|
||||
+ return 0
|
||||
+ return 1
|
||||
+
|
||||
+class DependencyProg:
|
||||
+ def __init__(self, name, envname, exename, minver, defaultlibs):
|
||||
+ self.name = name
|
||||
+ command = os.environ.get(envname, exename)
|
||||
+ self.lib_dir = ''
|
||||
+ self.inc_dir = ''
|
||||
+ self.libs = []
|
||||
+ self.cflags = ''
|
||||
+ try:
|
||||
+ config = os.popen(command + ' --version --cflags --libs').readlines()
|
||||
+ flags = ' '.join(config[1:]).split()
|
||||
+
|
||||
+ # remove this GNU_SOURCE if there... since python has it already,
|
||||
+ # it causes a warning.
|
||||
+ if '-D_GNU_SOURCE=1' in flags:
|
||||
+ flags.remove('-D_GNU_SOURCE=1')
|
||||
+ self.ver = config[0].strip()
|
||||
+ if minver and self.ver < minver:
|
||||
+ err= 'WARNING: requires %s version %s (%s found)' % (self.name, self.ver, minver)
|
||||
+ raise ValueError(err)
|
||||
+ self.found = 1
|
||||
+ self.cflags = ''
|
||||
+ for f in flags:
|
||||
+ if f[:2] in ('-l', '-D', '-I', '-L'):
|
||||
+ self.cflags += f + ' '
|
||||
+ elif f[:3] == '-Wl':
|
||||
+ self.cflags += '-Xlinker ' + f + ' '
|
||||
+ if self.name == 'SDL':
|
||||
+ inc = '-I' + '/usr/X11R6/include'
|
||||
+ self.cflags = inc + ' ' + self.cflags
|
||||
+ except:
|
||||
+ print ('WARNING: "%s" failed!' % command)
|
||||
+ self.found = 0
|
||||
+ self.ver = '0'
|
||||
+ self.libs = defaultlibs
|
||||
+
|
||||
+ def configure(self, incdirs, libdir):
|
||||
+ if self.found:
|
||||
+ print (self.name + ' '[len(self.name):] + ': found ' + self.ver)
|
||||
+ self.found = 1
|
||||
+ else:
|
||||
+ print (self.name + ' '[len(self.name):] + ': not found')
|
||||
+
|
||||
+class Dependency:
|
||||
+ def __init__(self, name, checkhead, checklib, libs):
|
||||
+ self.name = name
|
||||
+ self.inc_dir = None
|
||||
+ self.lib_dir = None
|
||||
+ self.libs = libs
|
||||
+ self.found = 0
|
||||
+ self.checklib = checklib
|
||||
+ self.checkhead = checkhead
|
||||
+ self.cflags = ''
|
||||
+
|
||||
+ def configure(self, incdirs, libdirs):
|
||||
+ incname = self.checkhead
|
||||
+ libnames = self.checklib, self.name.lower()
|
||||
+
|
||||
+ if incname:
|
||||
+ for dir in incdirs:
|
||||
+ path = os.path.join(dir, incname)
|
||||
+ if os.path.isfile(path):
|
||||
+ self.inc_dir = dir
|
||||
+
|
||||
+ for dir in libdirs:
|
||||
+ for name in libnames:
|
||||
+ path = os.path.join(dir, name)
|
||||
+ if filter(os.path.isfile, glob(path+'*')):
|
||||
+ self.lib_dir = dir
|
||||
+
|
||||
+ if (incname and self.lib_dir and self.inc_dir) or (not incname and self.lib_dir):
|
||||
+ print (self.name + ' '[len(self.name):] + ': found')
|
||||
+ self.found = 1
|
||||
+ else:
|
||||
+ print (self.name + ' '[len(self.name):] + ': not found')
|
||||
+
|
||||
+class DependencyPython:
|
||||
+ def __init__(self, name, module, header):
|
||||
+ self.name = name
|
||||
+ self.lib_dir = ''
|
||||
+ self.inc_dir = ''
|
||||
+ self.libs = []
|
||||
+ self.cflags = ''
|
||||
+ self.found = 0
|
||||
+ self.ver = '0'
|
||||
+ self.module = module
|
||||
+ self.header = header
|
||||
+
|
||||
+ def configure(self, incdirs, libdirs):
|
||||
+ self.found = 1
|
||||
+ if self.module:
|
||||
+ try:
|
||||
+ self.ver = __import__(self.module).__version__
|
||||
+ except ImportError:
|
||||
+ self.found = 0
|
||||
+ if self.found and self.header:
|
||||
+ fullpath = os.path.join(get_python_inc(0), self.header)
|
||||
+ if not os.path.isfile(fullpath):
|
||||
+ self.found = 0
|
||||
+ else:
|
||||
+ self.inc_dir = os.path.split(fullpath)[0]
|
||||
+ if self.found:
|
||||
+ print (self.name + ' '[len(self.name):] + ': found', self.ver)
|
||||
+ else:
|
||||
+ print (self.name + ' '[len(self.name):] + ': not found')
|
||||
+
|
||||
+sdl_lib_name = 'SDL'
|
||||
+
|
||||
+def main():
|
||||
+ print ('\nHunting dependencies...')
|
||||
+ DEPS = [
|
||||
+ DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', ['sdl']),
|
||||
+ Dependency('FONT', 'SDL_ttf.h', 'libSDL_ttf.so', ['SDL_ttf']),
|
||||
+ Dependency('IMAGE', 'SDL_image.h', 'libSDL_image.so', ['SDL_image']),
|
||||
+ Dependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer.so', ['SDL_mixer']),
|
||||
+ DependencyProg('SMPEG', 'SMPEG_CONFIG', 'smpeg-config', '0.4.3', ['smpeg']),
|
||||
+ Dependency('PNG', 'png.h', 'libpng', ['png']),
|
||||
+ Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
|
||||
+ Dependency('SCRAP', '', 'libX11', ['X11']),
|
||||
+ Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.so', ['portmidi']),
|
||||
+ Dependency('PORTTIME', 'porttime.h', 'libporttime.so', ['porttime']),
|
||||
+ #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
|
||||
+ ]
|
||||
+ if not DEPS[0].found:
|
||||
+ print ('Unable to run "sdl-config". Please make sure a development version of SDL is installed.')
|
||||
+ raise SystemExit
|
||||
+
|
||||
+ if localbase:
|
||||
+ incdirs = [localbase+d for d in origincdirs]
|
||||
+ libdirs = [localbase+d for d in origlibdirs]
|
||||
+ else:
|
||||
+ incdirs = []
|
||||
+ libdirs = []
|
||||
+ incdirs += ["/boot/common"+d for d in origincdirs]
|
||||
+ libdirs += ["/boot/common"+d for d in origlibdirs]
|
||||
+
|
||||
+ for arg in DEPS[0].cflags.split():
|
||||
+ if arg[:2] == '-I':
|
||||
+ incdirs.append(arg[2:])
|
||||
+ elif arg[:2] == '-L':
|
||||
+ libdirs.append(arg[2:])
|
||||
+ for d in DEPS:
|
||||
+ d.configure(incdirs, libdirs)
|
||||
+
|
||||
+ for d in DEPS[1:]:
|
||||
+ if not d.found:
|
||||
+ if not confirm("""
|
||||
+Warning, some of the pygame dependencies were not found. Pygame can still
|
||||
+compile and install, but games that depend on those missing dependencies
|
||||
+will not run. Would you like to continue the configuration?"""):
|
||||
+ raise SystemExit
|
||||
+ break
|
||||
+
|
||||
+ return DEPS
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ print ("""This is the configuration subscript for Unix.
|
||||
+Please run "config.py" for full configuration.""")
|
||||
+
|
||||
1496
dev-python/pygame/patches/pygame-1.9.1.patchset
Normal file
1496
dev-python/pygame/patches/pygame-1.9.1.patchset
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,32 +1,85 @@
|
||||
SUMMARY="PyGame - a popular game development module for python"
|
||||
DESCRIPTION="
|
||||
pygame - python bindings to sdl and other libs that facilitate game production.
|
||||
PyGame - python bindings to sdl and other libs that facilitate game production.
|
||||
"
|
||||
HOMEPAGE="http://www.pygame.org"
|
||||
HOMEPAGE="http://www.pygame.org/"
|
||||
SRC_URI="http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz"
|
||||
CHECKSUM_MD5="1c4cdc708d17c8250a2d78ef997222fc"
|
||||
REVISION="1"
|
||||
STATUS_HAIKU="stable"
|
||||
DEPEND="dev-lang/python >= 2.6.4
|
||||
media-libs/libsdl >= 1.2.14
|
||||
media-libs/sdl-image >= 1.2.10
|
||||
media-libs/smpeg >= 0.4.5"
|
||||
CHECKSUM_SHA256="a26095472ae4be9631e0d5bfb9a52ac57a3a091e45757913128e4a473807d433"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
cd pygame-1.9.1release
|
||||
LOCALBASE=/boot/common/
|
||||
python setup.py build
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd pygame-1.9.1release
|
||||
python setup.py install --root=${DESTDIR}
|
||||
}
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
COPYRIGHT="2000-2004, 2007 Pete Shinners
|
||||
2004 Takafumi Mizuno
|
||||
2006-2007 Rene Dudfield
|
||||
2007 Richard Goedeken
|
||||
2007-2008 Marcus von Appen
|
||||
"
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
REVISION="1"
|
||||
|
||||
#
|
||||
# No stable python_x86 => impossible to build _x86
|
||||
#
|
||||
ARCHITECTURES="x86 ?x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 ?x86"
|
||||
|
||||
#ARCHITECTURES="x86"
|
||||
#if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
|
||||
# # x86_gcc2 is fine as primary target architecture as long as we're building
|
||||
# # for a different secondary architecture.
|
||||
# ARCHITECTURES="$ARCHITECTURES x86_gcc2"
|
||||
#fi
|
||||
#SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
SOURCE_DIR="pygame-1.9.1release"
|
||||
|
||||
PROVIDES="
|
||||
pygame${secondaryArchSuffix} = $portVersion
|
||||
"
|
||||
# python$secondaryArchSuffix >= 2.6.4
|
||||
REQUIRES="
|
||||
python >= 2.6.4
|
||||
libsdl$secondaryArchSuffix >= 1.2.14
|
||||
sdl_image$secondaryArchSuffix >= 1.2.10
|
||||
sdl_ttf$secondaryArchSuffix >= 1.2
|
||||
sdl_mixer$secondaryArchSuffix >= 1.2
|
||||
smpeg$secondaryArchSuffix >= 0.4.5
|
||||
lib:libpng$secondaryArchSuffix
|
||||
jpeg$secondaryArchSuffix
|
||||
sdl_gfx$secondaryArchSuffix
|
||||
"
|
||||
# portmidi ^
|
||||
# portmap |
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel >= $haikuVersion
|
||||
python >= 2.6.4
|
||||
gcc${secondaryArchSuffix}
|
||||
libsdl${secondaryArchSuffix}_devel >= 1.2.14
|
||||
sdl_image${secondaryArchSuffix}_devel >= 1.2.10
|
||||
sdl_ttf${secondaryArchSuffix}_devel >= 1.2
|
||||
sdl_mixer${secondaryArchSuffix}_devel >= 1.2
|
||||
libpng${secondaryArchSuffix}_devel
|
||||
jpeg${secondaryArchSuffix}_devel
|
||||
smpeg${secondaryArchSuffix}_devel >= 0.4.5
|
||||
sdl_gfx${secondaryArchSuffix}_devel
|
||||
"
|
||||
#libjpeg ^
|
||||
# |
|
||||
|
||||
BUILD_PREREQUIRES="
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# $portPackageLinksDir/cmd~python/bin/python setup.py build
|
||||
# don't build without features
|
||||
echo "n" | python setup.py build || exit 1
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
# don't build without features
|
||||
echo "n" | python setup.py install \
|
||||
--prefix=$prefix || exit 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user