PyGame: bump (#5469)

* PyGame: bump

* Cleanup
This commit is contained in:
extrowerk
2021-01-13 07:23:20 +01:00
committed by GitHub
parent 139b28bef6
commit c5c0f0c26c
4 changed files with 453 additions and 451 deletions

View File

@@ -1,378 +0,0 @@
From 266fb5c31a3a4a9ac69b04778c4c84b2072e994f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sun, 6 Aug 2017 17:59:18 +0200
Subject: [PATCH] Haiku patches
---
Setup.in | 6 +-
config.py | 4 +
config_haiku.py | 221 ++++++++++++++++++++++++++++++++++++++++++++
pygame.egg-info/SOURCES.txt | 6 +-
setup.py | 18 +---
src/pgcompat.h | 4 +-
src/transform.c | 2 +-
7 files changed, 232 insertions(+), 29 deletions(-)
create mode 100644 config_haiku.py
diff --git a/Setup.in b/Setup.in
index ae6791b..28e7f20 100644
--- a/Setup.in
+++ b/Setup.in
@@ -29,8 +29,8 @@ imageext src/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
font src/font.c $(SDL) $(FONT) $(DEBUG)
mixer src/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src/music.c $(SDL) $(MIXER) $(DEBUG)
-scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
-pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
+#scrap src/scrap.c $(SDL) $(SCRAP) $(DEBUG)
+#pypm src/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
GFX = src/SDL_gfx/SDL_gfxPrimitives.c
#GFX = src/SDL_gfx/SDL_gfxBlitFunc.c src/SDL_gfx/SDL_gfxPrimitives.c
@@ -61,7 +61,7 @@ joystick src/joystick.c $(SDL) $(DEBUG)
draw src/draw.c $(SDL) $(DEBUG)
image src/image.c $(SDL) $(DEBUG)
overlay src/overlay.c $(SDL) $(DEBUG)
-transform src/transform.c src/rotozoom.c src/scale2x.c src/scale_mmx.c $(SDL) $(DEBUG) -D_NO_MMX_FOR_X86_64
+transform src/transform.c src/rotozoom.c src/scale2x.c $(SDL) $(DEBUG) -D_NO_MMX_FOR_X86_64
mask src/mask.c src/bitmask.c $(SDL) $(DEBUG)
bufferproxy src/bufferproxy.c $(SDL) $(DEBUG)
pixelarray src/pixelarray.c $(SDL) $(DEBUG)
diff --git a/config.py b/config.py
index 8418946..8ea4de9 100644
--- a/config.py
+++ b/config.py
@@ -142,12 +142,16 @@ def main():
elif sys.platform == 'win32':
print_('Using WINDOWS mingw/msys configuration...\n')
import config_msys as CFG
+ elif sys.platform == 'haiku1' or sys.platform == 'haiku1_x86':
+ print_('Using Haiku configuration...\n')
+ import config_haiku as CFG
elif sys.platform == 'darwin':
print_('Using Darwin configuration...\n')
import config_darwin as CFG
additional_platform_setup = open("Setup_Darwin.in", "r").readlines()
else:
print_('Using UNIX configuration...\n')
+ print_(sys.platform)
import config_unix as CFG
additional_platform_setup = open("Setup_Unix.in", "r").readlines()
diff --git a/config_haiku.py b/config_haiku.py
new file mode 100644
index 0000000..8c4dd8e
--- /dev/null
+++ b/config_haiku.py
@@ -0,0 +1,221 @@
+"""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 = ['/develop/headers', '/develop/headers/SDL', '/develop/headers/x86/SDL']
+origlibdirs = ['/develop/lib','/develop/lib/x86']
+if 'ORIGLIBDIRS' in os.environ and os.environ['ORIGLIBDIRS'] != "":
+ origlibdirs = os.environ['ORIGLIBDIRS'].split(":")
+
+
+def confirm(message):
+ "ask a yes/no question, return result"
+ if not sys.stdout.isatty():
+ return False
+ reply = raw_input('\n' + message + ' [Y/n]:')
+ if reply and (reply[0].lower()) == 'n':
+ return False
+ return True
+
+class DependencyProg:
+ def __init__(self, name, envname, exename, minver, defaultlibs, version_flag="--version"):
+ self.name = name
+ command = os.environ.get(envname, exename)
+ self.lib_dir = ''
+ self.inc_dir = ''
+ self.libs = []
+ self.cflags = ''
+ try:
+ # freetype-config for freetype2 version 2.3.7 on Debian lenny
+ # does not recognize multiple command line options. So execute
+ # 'command' separately for each option.
+ config = (os.popen(command + ' ' + version_flag).readlines() +
+ os.popen(command + ' --cflags').readlines() +
+ os.popen(command + ' --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 += f + ' '
+ if self.name == 'SDL':
+ inc = '-I' + '/boot/system/develop/headers/SDL'
+ 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...')
+
+ def get_porttime_dep():
+ """ returns the porttime Dependency
+
+ On some distributions, such as Fedora, porttime is compiled into portmidi.
+ On others, such as Debian, it is a separate library.
+ """
+ portmidi_as_porttime = True
+
+ if 'PORTMIDI_INC_PORTTIME' in os.environ:
+ inc_porttime = os.environ.get('PORTMIDI_INC_PORTTIME')
+ portmidi_as_porttime = True if inc_porttime in ['1', 'True'] else False
+ else:
+ if os.path.exists('/etc/redhat-release'):
+ portmidi_as_porttime = True
+ else:
+ portmidi_as_porttime = False
+
+ if portmidi_as_porttime:
+ return Dependency('PORTTIME', 'porttime.h', 'libportmidi.so', ['portmidi'])
+ else:
+ return Dependency('PORTTIME', 'porttime.h', 'libporttime.so', ['porttime'])
+
+ porttime_dep = get_porttime_dep()
+
+ 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']),
+ Dependency('PNG', 'png.h', 'libpng', ['png']),
+ Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
+ Dependency('SCRAP', '', 'libX11', ['X11']),
+ Dependency('PORTMIDI', 'portmidi.h', 'libportmidi.so', ['portmidi']),
+ porttime_dep,
+ DependencyProg('FREETYPE', 'FREETYPE_CONFIG', 'freetype-config', '2.0',
+ ['freetype'], '--ftversion'),
+ #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
+ ]
+ if not DEPS[0].found:
+ sys.exit('Unable to run "sdl-config". Please make sure a development version of SDL is installed.')
+
+ incdirs = []
+ libdirs = []
+ incdirs += ["/system"+d for d in origincdirs]
+ libdirs += ["/system"+d for d in origlibdirs]
+ if localbase:
+ incdirs = [localbase+d for d in origincdirs]
+ libdirs = [localbase+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 "-auto" not in sys.argv and 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("Missing dependencies")
+ break
+
+ return DEPS
+
+if __name__ == '__main__':
+ print ("""This is the configuration subscript for Unix.
+Please run "config.py" for full configuration.""")
+
diff --git a/pygame.egg-info/SOURCES.txt b/pygame.egg-info/SOURCES.txt
index 82ff000..f9a302f 100644
--- a/pygame.egg-info/SOURCES.txt
+++ b/pygame.egg-info/SOURCES.txt
@@ -556,11 +556,7 @@ src/pypm.pyx
src/rect.c
src/rotozoom.c
src/rwobject.c
-src/scale.h
src/scale2x.c
-src/scale_mmx.c
-src/scale_mmx32.c
-src/scale_mmx64.c
src/scale_mmx64_gcc.c
src/scale_mmx64_msvc.c
src/scrap.c
@@ -836,4 +832,4 @@ test/util/build_page/results/.htaccess
test/util/build_page/results/index.py
test/util/build_page/results/results.css
test/util/build_page/upload_results/.htaccess
-test/util/build_page/upload_results/index.py
\ No newline at end of file
+test/util/build_page/upload_results/index.py
diff --git a/setup.py b/setup.py
index e9fc8b4..4aa891a 100644
--- a/setup.py
+++ b/setup.py
@@ -163,7 +163,7 @@ else:
#headers to install
headers = glob.glob(os.path.join('src', '*.h'))
-headers.remove(os.path.join('src', 'scale.h'))
+#headers.remove(os.path.join('src', 'scale.h'))
# option for not installing the headers.
if "-noheaders" in sys.argv:
@@ -457,22 +457,6 @@ if sys.platform == 'win32':
build_ext.run(self)
cmdclass['build_ext'] = WinBuildExt
- # Add the precompiled smooth scale MMX functions to transform.
- def replace_scale_mmx():
- for e in extensions:
- if e.name == 'transform':
- if '64 bit' in sys.version:
- e.extra_objects.append(
- os.path.join('obj', 'win64', 'scale_mmx.obj'))
- else:
- e.extra_objects.append(
- os.path.join('obj', 'win32', 'scale_mmx.obj'))
- for i in range(len(e.sources)):
- if e.sources[i].endswith('scale_mmx.c'):
- del e.sources[i]
- return
- replace_scale_mmx()
-
#clean up the list of extensions
for e in extensions[:]:
diff --git a/src/pgcompat.h b/src/pgcompat.h
index bd18431..324130f 100644
--- a/src/pgcompat.h
+++ b/src/pgcompat.h
@@ -81,9 +81,7 @@
#define DECREF_MOD(mod)
/* Type header differs. */
-#define TYPE_HEAD(x,y) \
- PyObject_HEAD_INIT(x) \
- 0,
+#define TYPE_HEAD(x,y) PyObject_HEAD_INIT(x) 0,
/* Text interface. Use ascii strings. */
#define Text_Type PyString_Type
diff --git a/src/transform.c b/src/transform.c
index c1c77f7..919ae51 100644
--- a/src/transform.c
+++ b/src/transform.c
@@ -29,7 +29,7 @@
#include "doc/transform_doc.h"
#include <math.h>
#include <string.h>
-#include "scale.h"
+//#include "scale.h"
typedef void (* SMOOTHSCALE_FILTER_P)(Uint8 *, Uint8 *, int, int, int, int, int);
--
2.16.4

View File

@@ -0,0 +1,364 @@
From a4183f0963861f86d1bb4750d14c6396c4bd3577 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 4 Dec 2020 18:45:29 +0100
Subject: Haiku patches
diff --git a/buildconfig/Setup.SDL2.in b/buildconfig/Setup.SDL2.in
index 8a6afa1..b567e6e 100644
--- a/buildconfig/Setup.SDL2.in
+++ b/buildconfig/Setup.SDL2.in
@@ -29,8 +29,8 @@ imageext src_c/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
font src_c/font.c $(SDL) $(FONT) $(DEBUG)
mixer src_c/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src_c/music.c $(SDL) $(MIXER) $(DEBUG)
-scrap src_c/scrap.c $(SDL) $(SCRAP) $(DEBUG)
-pypm src_c/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
+#scrap src_c/scrap.c $(SDL) $(SCRAP) $(DEBUG)
+#pypm src_c/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
_sdl2.sdl2 src_c/_sdl2/sdl2.c $(SDL) $(DEBUG) -Isrc_c
_sdl2.audio src_c/_sdl2/audio.c $(SDL) $(DEBUG) -Isrc_c
@@ -68,7 +68,7 @@ time src_c/time.c $(SDL) $(DEBUG)
joystick src_c/joystick.c $(SDL) $(DEBUG)
draw src_c/draw.c $(SDL) $(DEBUG)
image src_c/image.c $(SDL) $(DEBUG)
-transform src_c/transform.c src_c/rotozoom.c src_c/scale2x.c src_c/scale_mmx.c $(SDL) $(DEBUG)
+transform src_c/transform.c src_c/rotozoom.c src_c/scale2x.c $(SDL) $(DEBUG)
mask src_c/mask.c src_c/bitmask.c $(SDL) $(DEBUG)
bufferproxy src_c/bufferproxy.c $(SDL) $(DEBUG)
pixelarray src_c/pixelarray.c $(SDL) $(DEBUG)
diff --git a/buildconfig/config.py b/buildconfig/config.py
index d92c366..48fb8ea 100644
--- a/buildconfig/config.py
+++ b/buildconfig/config.py
@@ -191,6 +191,9 @@ def main(auto=False):
import config_msys as CFG
except ImportError:
import buildconfig.config_msys as CFG
+ elif sys.platform == 'haiku1' or sys.platform == 'haiku1_x86':
+ print_('Using Haiku configuration...\n')
+ import buildconfig.config_haiku as CFG
elif sys.platform == 'darwin':
print_('Using Darwin configuration...\n')
try:
diff --git a/buildconfig/config_haiku.py b/buildconfig/config_haiku.py
new file mode 100644
index 0000000..f126996
--- /dev/null
+++ b/buildconfig/config_haiku.py
@@ -0,0 +1,229 @@
+"""Config on Unix"""
+
+import os, sys
+from glob import glob
+import platform
+import logging
+from distutils.sysconfig import get_python_inc
+
+configcommand = os.environ.get('SDL_CONFIG', 'sdl-config',)
+configcommand = configcommand + ' --version --cflags --libs'
+localbase = os.environ.get('LOCALBASE', '')
+if os.environ.get('PYGAME_EXTRA_BASE', ''):
+ extrabases = os.environ['PYGAME_EXTRA_BASE'].split(':')
+else:
+ extrabases = []
+
+
+class DependencyProg:
+ def __init__(self, name, envname, exename, minver, defaultlibs, version_flag="--version"):
+ self.name = name
+ command = os.environ.get(envname, exename)
+ self.lib_dir = ''
+ self.inc_dir = ''
+ self.libs = []
+ self.cflags = ''
+ try:
+ # freetype-config for freetype2 version 2.3.7 on Debian lenny
+ # does not recognize multiple command line options. So execute
+ # 'command' separately for each option.
+ config = (os.popen(command + ' ' + version_flag).readlines() +
+ os.popen(command + ' --cflags').readlines() +
+ os.popen(command + ' --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 + ' '
+ except (ValueError, TypeError):
+ 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 any(map(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')
+ print(self.name, self.checkhead, self.checklib, incdirs, libdirs)
+
+
+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(sdl2=False):
+ global origincdirs, origlibdirs
+
+ #these get prefixes with the $LOCALBASE
+ if sdl2:
+ origincdirs = ['/headers/x86/', '/headers/', '/headers/x86/SDL2/', '/headers/SDL2/']
+ origlibdirs = ['/develop/lib/x86/','develop/lib/','/lib/x86/', '/lib/']
+
+ else:
+ origincdirs = ['/headers/x86', '/headers/', '/headers/x86/SDL', '/headers/SDL']
+ origlibdirs = ['/develop/lib/x86/','develop/lib/','/lib/x86/', '/lib/']
+ if 'ORIGLIBDIRS' in os.environ and os.environ['ORIGLIBDIRS'] != "":
+ origlibdirs = os.environ['ORIGLIBDIRS'].split(":")
+
+ print ('\nHunting dependencies...')
+
+ def find_freetype():
+ """ modern freetype uses pkg-config. However, some older systems don't have that.
+ """
+ pkg_config = DependencyProg(
+ 'FREETYPE', 'FREETYPE_CONFIG', 'pkg-config freetype2', '2.0',
+ ['freetype2'], '--modversion'
+ )
+ if pkg_config.found:
+ return pkg_config
+
+ freetype_config = DependencyProg(
+ 'FREETYPE', 'FREETYPE_CONFIG', 'freetype-config', '2.0',
+ ['freetype'], '--ftversion'
+ )
+ if freetype_config.found:
+ return freetype_config
+ return pkg_config
+
+ if sdl2:
+ DEPS = [
+ DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl']),
+ Dependency('FONT', 'SDL_ttf.h', 'libSDL2_ttf.so', ['SDL2_ttf']),
+ Dependency('IMAGE', 'SDL_image.h', 'libSDL2_image.so', ['SDL2_image']),
+ Dependency('MIXER', 'SDL_mixer.h', 'libSDL2_mixer.so', ['SDL2_mixer']),
+ #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL2_gfx.so', ['SDL2_gfx']),
+ ]
+ else:
+ 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']),
+ #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
+ ]
+ DEPS.extend([
+ Dependency('PNG', 'png.h', 'libpng', ['png']),
+ Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
+ #Dependency('SCRAP', '', 'libX11', ['X11']),
+ #Dependency('GFX', 'SDL_gfxPrimitives.h', 'libSDL_gfx.so', ['SDL_gfx']),
+ ])
+
+ DEPS.append(find_freetype())
+
+ if not DEPS[0].found:
+ raise RuntimeError('Unable to run "sdl-config". Please make sure a development version of SDL is installed.')
+
+ incdirs = []
+ libdirs = []
+ for extrabase in extrabases:
+ incdirs += [extrabase + d for d in origincdirs]
+ libdirs += [extrabase + d for d in origlibdirs]
+ incdirs += ["/boot/system/develop"+d for d in origincdirs]
+ libdirs += ["/boot/system/"+d for d in origlibdirs]
+
+ if localbase:
+ incdirs = [localbase+d for d in origincdirs]
+ libdirs = [localbase+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 "-auto" not in sys.argv:
+ logging.warning(
+ "Some pygame dependencies were not found. "
+ "Pygame can still compile and install, but games that "
+ "depend on those missing dependencies will not run. "
+ "Use -auto to continue building without all dependencies. "
+ )
+ raise SystemExit("Missing dependencies")
+ break
+
+ return DEPS
+
+if __name__ == '__main__':
+ print ("""This is the configuration subscript for Haiku.
+Please run "config.py" for full configuration.""")
+
diff --git a/setup.py b/setup.py
index 1c4c6a3..09737ab 100644
--- a/setup.py
+++ b/setup.py
@@ -269,7 +269,7 @@ else:
#headers to install
headers = glob.glob(os.path.join('src_c', '*.h'))
-headers.remove(os.path.join('src_c', 'scale.h'))
+#headers.remove(os.path.join('src_c', 'scale.h'))
headers.append(os.path.join('src_c', 'include'))
import distutils.command.install_headers
@@ -616,22 +616,6 @@ if sys.platform == 'win32':
build_ext.build_extensions(self)
- # Add the precompiled smooth scale MMX functions to transform.
- def replace_scale_mmx():
- for e in extensions:
- if e.name == 'transform':
- if '64 bit' in sys.version:
- e.extra_objects.append(
- os.path.join('buildconfig', 'obj', 'win64', 'scale_mmx.obj'))
- else:
- e.extra_objects.append(
- os.path.join('buildconfig', 'obj', 'win32', 'scale_mmx.obj'))
- for i in range(len(e.sources)):
- if e.sources[i].endswith('scale_mmx.c'):
- del e.sources[i]
- return
- replace_scale_mmx()
-
#clean up the list of extensions
for e in extensions[:]:
diff --git a/src_c/transform.c b/src_c/transform.c
index c6e5631..b7ddb38 100644
--- a/src_c/transform.c
+++ b/src_c/transform.c
@@ -33,7 +33,7 @@
#include <math.h>
#include <string.h>
-#include "scale.h"
+//#include "scale.h"
typedef void (*SMOOTHSCALE_FILTER_P)(Uint8 *, Uint8 *, int, int, int, int,
int);
--
2.28.0
From 2a59ac4301994c7f836ae2b3d91698b3690185a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Fri, 4 Dec 2020 19:18:35 +0100
Subject: SDL1 support
diff --git a/buildconfig/Setup.SDL1.in b/buildconfig/Setup.SDL1.in
index 9f2cc98..9b650f7 100644
--- a/buildconfig/Setup.SDL1.in
+++ b/buildconfig/Setup.SDL1.in
@@ -29,8 +29,8 @@ imageext src_c/imageext.c $(SDL) $(IMAGE) $(PNG) $(JPEG) $(DEBUG)
font src_c/font.c $(SDL) $(FONT) $(DEBUG)
mixer src_c/mixer.c $(SDL) $(MIXER) $(DEBUG)
mixer_music src_c/music.c $(SDL) $(MIXER) $(DEBUG)
-scrap src_c/scrap.c $(SDL) $(SCRAP) $(DEBUG)
-pypm src_c/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
+#scrap src_c/scrap.c $(SDL) $(SCRAP) $(DEBUG)
+#pypm src_c/pypm.c $(SDL) $(PORTMIDI) $(PORTTIME) $(DEBUG)
GFX = src_c/SDL_gfx/SDL_gfxPrimitives.c
#GFX = src_c/SDL_gfx/SDL_gfxBlitFunc.c src_c/SDL_gfx/SDL_gfxPrimitives.c
@@ -63,7 +63,7 @@ joystick src_c/joystick.c $(SDL) $(DEBUG)
draw src_c/draw.c $(SDL) $(DEBUG)
image src_c/image.c $(SDL) $(DEBUG)
overlay src_c/overlay.c $(SDL) $(DEBUG)
-transform src_c/transform.c src_c/rotozoom.c src_c/scale2x.c src_c/scale_mmx.c $(SDL) $(DEBUG)
+transform src_c/transform.c src_c/rotozoom.c src_c/scale2x.c $(SDL) $(DEBUG)
mask src_c/mask.c src_c/bitmask.c $(SDL) $(DEBUG)
bufferproxy src_c/bufferproxy.c $(SDL) $(DEBUG)
pixelarray src_c/pixelarray.c $(SDL) $(DEBUG)
--
2.28.0

View File

@@ -0,0 +1,89 @@
SUMMARY="A popular game development module for python"
DESCRIPTION="PyGame - python bindings to sdl and other libs that facilitate \
game production."
HOMEPAGE="https://www.pygame.org/"
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"
SOURCE_URI="https://files.pythonhosted.org/packages/source/p/pygame/pygame-$portVersion.tar.gz"
CHECKSUM_SHA256="63b038da116a643046181b02173fd894d87d2f85ecfd6aa7d5ece73c6ef501e9"
SOURCE_DIR="pygame-$portVersion"
PATCHES="pygame-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
pygame$secondaryArchSuffix = $portVersion
"
REQUIRES="
cmd:cython3$secondaryArchSuffix
cmd:f2py3
cmd:python3
lib:libfreetype$secondaryArchSuffix
lib:libjpeg$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libSDL_1.2$secondaryArchSuffix
lib:libSDL_gfx$secondaryArchSuffix
lib:libSDL_image_1.2$secondaryArchSuffix
lib:libSDL_mixer_1.2$secondaryArchSuffix
lib:libSDL_ttf_2.0$secondaryArchSuffix
# lib:libSDL2_2.0$secondaryArchSuffix
# lib:libSDL2_gfx_1.0$secondaryArchSuffix
# lib:libSDL2_image_2.0$secondaryArchSuffix
# lib:libSDL2_mixer_2.0$secondaryArchSuffix
# lib:libSDL2_ttf_2.0$secondaryArchSuffix
lib:libsmpeg_0.4
"
# portmidi
# portmap
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
setuptools_python3
devel:libfreetype$secondaryArchSuffix
devel:libjpeg$secondaryArchSuffix
devel:libpng16$secondaryArchSuffix
devel:libSDL_1.2$secondaryArchSuffix
devel:libSDL_gfx$secondaryArchSuffix
devel:libSDL_image_1.2$secondaryArchSuffix
devel:libSDL_mixer_1.2$secondaryArchSuffix
devel:libSDL_ttf_2.0$secondaryArchSuffix
# devel:libSDL2_2.0$secondaryArchSuffix
# devel:libSDL2_gfx_1.0$secondaryArchSuffix
# devel:libSDL2_image_2.0$secondaryArchSuffix
# devel:libSDL2_mixer_2.0$secondaryArchSuffix
# devel:libSDL2_ttf_2.0$secondaryArchSuffix
devel:libsmpeg_0.4
"
BUILD_PREREQUIRES="
cmd:cython3$secondaryArchSuffix
cmd:freetype_config$secondaryArchSuffix
cmd:gcc$secondaryArchSuffix
cmd:python3
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
# don't build without features
# to build against SDL2 remove -sdl1 from the next line
echo "y" | $portPackageLinksDir/cmd~python3/bin/python3 setup.py build -auto -sdl1 || exit 1
}
INSTALL()
{
# GENERIC: all python_setuptools-based installs need this
python=$portPackageLinksDir/cmd~python3/bin/python3
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
echo "y" | $portPackageLinksDir/cmd~python3/bin/python3 setup.py \
build install --prefix $prefix || exit 1
}

View File

@@ -1,73 +0,0 @@
SUMMARY="A popular game development module for python"
DESCRIPTION="PyGame - python bindings to sdl and other libs that facilitate \
game production."
HOMEPAGE="https://www.pygame.org/"
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="4"
SOURCE_URI="https://files.pythonhosted.org/packages/source/p/pygame/pygame-$portVersion.tar.gz"
CHECKSUM_SHA256="700d1781c999af25d11bfd1f3e158ebb660f72ebccb2040ecafe5069d0b2c0b6"
SOURCE_DIR="pygame-$portVersion"
PATCHES="pygame-$portVersion.patchset"
ARCHITECTURES="x86_gcc2 ?x86 x86_64"
PROVIDES="
pygame = $portVersion
"
REQUIRES="
cmd:python2
lib:libfreetype
lib:libjpeg
lib:libpng16
lib:libSDL_1.2
lib:libSDL_gfx
lib:libSDL_image_1.2
lib:libSDL_mixer_1.2
lib:libSDL_ttf_2.0
lib:libsmpeg_0.4
"
# portmidi
# portmap
BUILD_REQUIRES="
haiku_devel
setuptools_python
devel:libfreetype
devel:libjpeg
devel:libpng16
devel:libSDL_1.2
devel:libSDL_gfx
devel:libSDL_image_1.2
devel:libSDL_mixer_1.2
devel:libSDL_ttf_2.0
devel:libsmpeg_0.4
"
BUILD_PREREQUIRES="
cmd:freetype_config
cmd:gcc
cmd:python2
"
BUILD()
{
# don't build without features
echo "y" | $portPackageLinksDir/cmd~python2/bin/python2 setup.py build || exit 1
}
INSTALL()
{
# GENERIC: all python_setuptools-based installs need this
python=$portPackageLinksDir/cmd~python2/bin/python2
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c3)
installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
echo "y" | $portPackageLinksDir/cmd~python2/bin/python2 setup.py \
build install --prefix $prefix || exit 1
}