Skip to content

Commit 7b640e5

Browse files
authored
Make sdl-config/sdl2-config into simple shell scripts (#24907)
This removes the python dependency and the need to .bat and shell launchers. These script have always be shell scripts upstream and there should be no expectation that they can be run on windows. See libsdl-org/SDL#3516 In addition fix `sdl-config.py` so that it explicitly includes `-sUSE_SDL`. This has been required since #18443.
1 parent 83b1301 commit 7b640e5

File tree

9 files changed

+25
-262
lines changed

9 files changed

+25
-262
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ See docs/process.md for more on how version tagging works.
2020

2121
4.0.13 (in development)
2222
-----------------------
23+
- `sdl-config` and `sdl2-config` scripts were simplified to avoid using python
24+
and the `.bat` file versions were removed, matching upstream SDL. (#24907)
2325
- The `addRunDependency`/`removeRunDependency` now assert in debug builds if
2426
they are not passed an `id` parameter. We have been issuing warnings in
2527
this case since 2012 (f67ad60), so it seems highly unlikely anyone is not

system/bin/sdl-config

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,15 @@
11
#!/bin/sh
2-
# Copyright 2020 The Emscripten Authors. All rights reserved.
3-
# Emscripten is available under two separate licenses, the MIT license and the
4-
# University of Illinois/NCSA Open Source License. Both these licenses can be
5-
# found in the LICENSE file.
6-
#
7-
# Entry point for running python scripts on UNIX systems.
8-
#
9-
# Automatically generated by `create_entry_points.py`; DO NOT EDIT.
10-
#
11-
# To make modifications to this file, edit `tools/run_python.sh` and then run
12-
# `tools/maint/create_entry_points.py`
132

14-
# $PYTHON -E will not ignore _PYTHON_SYSCONFIGDATA_NAME an internal
15-
# of cpython used in cross compilation via setup.py.
16-
unset _PYTHON_SYSCONFIGDATA_NAME
3+
echo "emscripten sdl-config called with $*" >&2
174

18-
if [ -z "$PYTHON" ]; then
19-
PYTHON=$EMSDK_PYTHON
20-
fi
5+
for arg in "$@"; do
6+
case "$arg" in
7+
--cflags|--libs)
8+
echo "-sUSE_SDL"
9+
;;
10+
--version)
11+
echo "1.3.0"
12+
;;
13+
esac
14+
done
2115

22-
if [ -z "$PYTHON" ]; then
23-
PYTHON=$(command -v python3 2> /dev/null)
24-
fi
25-
26-
if [ -z "$PYTHON" ]; then
27-
PYTHON=$(command -v python 2> /dev/null)
28-
fi
29-
30-
if [ -z "$PYTHON" ]; then
31-
echo 'unable to find python in $PATH'
32-
exit 1
33-
fi
34-
35-
exec "$PYTHON" -E "$0.py" "$@"

system/bin/sdl-config.bat

Lines changed: 0 additions & 86 deletions
This file was deleted.

system/bin/sdl-config.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

system/bin/sdl2-config

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,15 @@
11
#!/bin/sh
2-
# Copyright 2020 The Emscripten Authors. All rights reserved.
3-
# Emscripten is available under two separate licenses, the MIT license and the
4-
# University of Illinois/NCSA Open Source License. Both these licenses can be
5-
# found in the LICENSE file.
6-
#
7-
# Entry point for running python scripts on UNIX systems.
8-
#
9-
# Automatically generated by `create_entry_points.py`; DO NOT EDIT.
10-
#
11-
# To make modifications to this file, edit `tools/run_python.sh` and then run
12-
# `tools/maint/create_entry_points.py`
132

14-
# $PYTHON -E will not ignore _PYTHON_SYSCONFIGDATA_NAME an internal
15-
# of cpython used in cross compilation via setup.py.
16-
unset _PYTHON_SYSCONFIGDATA_NAME
3+
echo "emscripten sdl2-config called with $*" >&2
174

18-
if [ -z "$PYTHON" ]; then
19-
PYTHON=$EMSDK_PYTHON
20-
fi
5+
for arg in "$@"; do
6+
case "$arg" in
7+
--cflags|--libs)
8+
echo "-sUSE_SDL=2"
9+
;;
10+
--version)
11+
echo "2.0.10"
12+
;;
13+
esac
14+
done
2115

22-
if [ -z "$PYTHON" ]; then
23-
PYTHON=$(command -v python3 2> /dev/null)
24-
fi
25-
26-
if [ -z "$PYTHON" ]; then
27-
PYTHON=$(command -v python 2> /dev/null)
28-
fi
29-
30-
if [ -z "$PYTHON" ]; then
31-
echo 'unable to find python in $PATH'
32-
exit 1
33-
fi
34-
35-
exec "$PYTHON" -E "$0.py" "$@"

system/bin/sdl2-config.bat

Lines changed: 0 additions & 86 deletions
This file was deleted.

system/bin/sdl2-config.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/test_other.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7355,6 +7355,7 @@ def test_emmake_python(self):
73557355
self.run_process([emmake, PYTHON, test_file('emmake/make.py')])
73567356

73577357
@crossplatform
7358+
@no_windows('sdl2-config is a shell script and cannot run on windows')
73587359
def test_sdl2_config(self):
73597360
for args, expected in [
73607361
[['--version'], '2.0.10'],

tools/maint/create_entry_points.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
emstrip
4444
emsymbolizer
4545
emscan-deps
46-
system/bin/sdl-config
47-
system/bin/sdl2-config
4846
tools/file_packager
4947
tools/webidl_binder
5048
test/runner

0 commit comments

Comments
 (0)