Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL1 buildconfig removal #2824

Merged
merged 3 commits into from Nov 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
72 changes: 0 additions & 72 deletions buildconfig/Setup.SDL1.in

This file was deleted.

14 changes: 1 addition & 13 deletions buildconfig/appveyor.yml
Expand Up @@ -26,78 +26,66 @@ environment:
PYTHONPATH: "C:\\Python36"
PYTHON_VERSION: "3.6.0"
PYTHON_ARCH: "32"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python37\\python"
PYTHONPATH: "C:\\Python37"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "32"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python38\\python"
PYTHONPATH: "C:\\Python38"
PYTHON_VERSION: "3.8.0"
PYTHON_ARCH: "32"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python39\\python"
PYTHONPATH: "C:\\Python39"
PYTHON_VERSION: "3.9.0"
PYTHON_ARCH: "32"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python310\\python"
PYTHONPATH: "C:\\Python310"
PYTHON_VERSION: "3.10.0"
PYTHON_ARCH: "32"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python36-x64\\python"
PYTHONPATH: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.0"
PYTHON_ARCH: "64"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python37-x64\\python"
PYTHONPATH: "C:\\Python37-x64"
PYTHON_VERSION: "3.7.0"
PYTHON_ARCH: "64"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python38-x64\\python"
PYTHONPATH: "C:\\Python38-x64"
PYTHON_VERSION: "3.8.0"
PYTHON_ARCH: "64"
USE_SDL2: "-sdl2"
USE_ANALYZE: "-enable-msvc-analyze"

- PYTHON: "C:\\Python39-x64\\python"
PYTHONPATH: "C:\\Python39-x64"
PYTHON_VERSION: "3.9.0"
PYTHON_ARCH: "64"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

- PYTHON: "C:\\Python310-x64\\python"
PYTHONPATH: "C:\\Python310-x64"
PYTHON_VERSION: "3.10.0"
PYTHON_ARCH: "64"
USE_SDL2: "-sdl2"
USE_ANALYZE: ""

init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"

install:
# install.ps1 only needed for SDL1 stuff.
# - "powershell buildconfig\\ci\\appveyor\\install.ps1"

# https://github.com/appveyor/build-images/blob/master/scripts/Windows/install_python.ps1#L88-L108
- ps: |
Expand Down Expand Up @@ -134,7 +122,7 @@ install:
- "set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%\\%PYPY_VERSION%"
- "%PYTHON% -m ensurepip"
- "%PYTHON% -m pip install -U wheel pip twine requests"
- "%WITH_COMPILER% %PYTHON% -m buildconfig %USE_SDL2%"
- "%WITH_COMPILER% %PYTHON% -m buildconfig"
- "%WITH_COMPILER% %PYTHON% setup.py build -j4 %USE_ANALYZE%"
- "%WITH_COMPILER% %PYTHON% setup.py -setuptools %DISTRIBUTIONS%"
- ps: "ls dist"
Expand Down
46 changes: 0 additions & 46 deletions buildconfig/ci/appveyor/install.ps1

This file was deleted.

17 changes: 5 additions & 12 deletions buildconfig/config.py
Expand Up @@ -97,15 +97,11 @@ def prepdep(dep, basepath):
else:
dep.line = dep.name+' =' + ''.join(incs) + ''.join(lids) + ' ' + dep.cflags + libs

def writesetupfile(deps, basepath, additional_lines, sdl2=False):
def writesetupfile(deps, basepath, additional_lines):
"""create a modified copy of Setup.SDLx.in"""
if sdl2:
sdl_setup_filename = os.path.join(BASE_PATH, 'buildconfig',
sdl_setup_filename = os.path.join(BASE_PATH, 'buildconfig',
'Setup.SDL2.in')
else:
sdl_setup_filename = os.path.join(BASE_PATH, 'buildconfig',
'Setup.SDL1.in')


with open(sdl_setup_filename, 'r') as origsetup, \
open(os.path.join(BASE_PATH, 'Setup'), 'w') as newsetup:
line = ''
Expand Down Expand Up @@ -163,18 +159,15 @@ def writesetupfile(deps, basepath, additional_lines, sdl2=False):

def main(auto=False):
additional_platform_setup = []
sdl1 = "-sdl1" in sys.argv
sdl2 = not sdl1
conan = "-conan" in sys.argv

if '-sdl2' in sys.argv:
sys.argv.remove('-sdl2')
if '-sdl1' in sys.argv:
sys.argv.remove('-sdl1')
raise SystemExit("""Building PyGame with SDL1.2 is no longer supported.
Only SDL2 is supported now.""")

kwds = {}
if sdl2:
kwds['sdl2'] = True
if conan:
print_('Using CONAN configuration...\n')
try:
Expand Down
32 changes: 8 additions & 24 deletions buildconfig/config_darwin.py
Expand Up @@ -126,27 +126,14 @@ def find_freetype():



def main(sdl2=False):

if sdl2:
DEPS = [
[DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl'])],
[Dependency('FONT', ['SDL_ttf.h', 'SDL2/SDL_ttf.h'], 'libSDL2_ttf', ['SDL2_ttf'])],
[Dependency('IMAGE', ['SDL_image.h', 'SDL2/SDL_image.h'], 'libSDL2_image', ['SDL2_image'])],
[Dependency('MIXER', ['SDL_mixer.h', 'SDL2/SDL_mixer.h'], 'libSDL2_mixer', ['SDL2_mixer'])],
]
else:
DEPS = [
[DependencyProg('SDL', 'SDL_CONFIG', 'sdl-config', '1.2', ['sdl']),
FrameworkDependency('SDL', 'SDL.h', 'libSDL', 'SDL')],
[Dependency('FONT', ['SDL_ttf.h', 'SDL/SDL_ttf.h'], 'libSDL_ttf', ['SDL_ttf']),
FrameworkDependency('FONT', 'SDL_ttf.h', 'libSDL_ttf', 'SDL_ttf')],
[Dependency('IMAGE', ['SDL_image.h', 'SDL/SDL_image.h'], 'libSDL_image', ['SDL_image']),
FrameworkDependency('IMAGE', 'SDL_image.h', 'libSDL_image', 'SDL_image')],
[Dependency('MIXER', ['SDL_mixer.h', 'SDL/SDL_mixer.h'], 'libSDL_mixer', ['SDL_mixer']),
FrameworkDependency('MIXER', 'SDL_mixer.h', 'libSDL_mixer', 'SDL_mixer')],
]
def main():

DEPS = [
[DependencyProg('SDL', 'SDL_CONFIG', 'sdl2-config', '2.0', ['sdl'])],
[Dependency('FONT', ['SDL_ttf.h', 'SDL2/SDL_ttf.h'], 'libSDL2_ttf', ['SDL2_ttf'])],
[Dependency('IMAGE', ['SDL_image.h', 'SDL2/SDL_image.h'], 'libSDL2_image', ['SDL2_image'])],
[Dependency('MIXER', ['SDL_mixer.h', 'SDL2/SDL_mixer.h'], 'libSDL2_mixer', ['SDL2_mixer'])],
]

DEPS.extend([
Dependency('PNG', 'png.h', 'libpng', ['png']),
Expand All @@ -160,10 +147,7 @@ def main(sdl2=False):

print ('Hunting dependencies...')
incdirs = ['/usr/local/include', '/opt/homebrew/include']
if sdl2:
incdirs.extend(['/usr/local/include/SDL2', '/opt/homebrew/include/SDL2', '/opt/local/include/SDL2'])
else:
incdirs.extend(['/usr/local/include/SDL', '/opt/homebrew/include/SDL', '/opt/local/include/SDL'])
incdirs.extend(['/usr/local/include/SDL2', '/opt/homebrew/include/SDL2', '/opt/local/include/SDL2'])

incdirs.extend([
#'/usr/X11/include',
Expand Down
5 changes: 1 addition & 4 deletions buildconfig/config_msys2.py
Expand Up @@ -467,10 +467,7 @@ def setup_prebuilt_sdl2(prebuilt_dir):
return list(DEPS)


def main(sdl2=True):
if not sdl2:
raise Exception("Building SDL1.x on MSYS2 is not supported")

def main():
machine_type = get_machine_type()

# config MSYS2 always requires prebuilt dependencies, in the
Expand Down
40 changes: 13 additions & 27 deletions buildconfig/config_unix.py
Expand Up @@ -130,20 +130,15 @@ def configure(self, incdirs, libdirs):

sdl_lib_name = 'SDL'

def main(sdl2=False):
def main():
global origincdirs, origlibdirs

#these get prefixes with '/usr' and '/usr/local' or the $LOCALBASE
if sdl2:
origincdirs = ['/include', '/include/SDL2']
origlibdirs = ['/lib', '/lib64', '/X11R6/lib',
'/lib/i386-linux-gnu', '/lib/x86_64-linux-gnu',
'/lib/arm-linux-gnueabihf/', '/lib/aarch64-linux-gnu/']

else:
origincdirs = ['/include', '/include/SDL', '/include/SDL']
origlibdirs = ['/lib', '/lib64', '/X11R6/lib', '/lib/arm-linux-gnueabihf/',
'/lib/aarch64-linux-gnu/']
origincdirs = ['/include', '/include/SDL2']
origlibdirs = ['/lib', '/lib64', '/X11R6/lib',
'/lib/i386-linux-gnu', '/lib/x86_64-linux-gnu',
'/lib/arm-linux-gnueabihf/', '/lib/aarch64-linux-gnu/']

if 'ORIGLIBDIRS' in os.environ and os.environ['ORIGLIBDIRS'] != "":
origlibdirs = os.environ['ORIGLIBDIRS'].split(":")

Expand Down Expand Up @@ -189,22 +184,13 @@ def find_freetype():
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 = [
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']),
]
DEPS.extend([
Dependency('PNG', 'png.h', 'libpng', ['png']),
Dependency('JPEG', 'jpeglib.h', 'libjpeg', ['jpeg']),
Expand Down