SFML 2.6.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sfml-2.6.2.0/.github/scripts/FindOpenAL.cmake +143 -0
- sfml-2.6.2.0/.github/scripts/build-sfml-unix.sh +117 -0
- sfml-2.6.2.0/.github/scripts/build-sfml-windows.ps1 +77 -0
- sfml-2.6.2.0/.github/scripts/run-wheel-tests.py +42 -0
- sfml-2.6.2.0/.github/scripts/test-installed-package.py +92 -0
- sfml-2.6.2.0/.github/scripts/validate-dist.py +87 -0
- sfml-2.6.2.0/.github/workflows/ci.yml +305 -0
- sfml-2.6.2.0/.github/workflows/release.yml +256 -0
- sfml-2.6.2.0/.github/workflows/testpypi-validation.yml +90 -0
- sfml-2.6.2.0/.gitignore +41 -0
- sfml-2.6.2.0/LICENSE.txt +20 -0
- sfml-2.6.2.0/MANIFEST.in +4 -0
- sfml-2.6.2.0/PKG-INFO +167 -0
- sfml-2.6.2.0/README.md +133 -0
- sfml-2.6.2.0/docs/compatibility.md +48 -0
- sfml-2.6.2.0/docs/getting-started.md +143 -0
- sfml-2.6.2.0/docs/modules.md +176 -0
- sfml-2.6.2.0/docs/recipes.md +139 -0
- sfml-2.6.2.0/examples/README.md +41 -0
- sfml-2.6.2.0/examples/ftp/ftp.py +102 -0
- sfml-2.6.2.0/examples/opengl/opengl.py +161 -0
- sfml-2.6.2.0/examples/opengl/resources/background.jpg +0 -0
- sfml-2.6.2.0/examples/opengl/resources/sansation.ttf +0 -0
- sfml-2.6.2.0/examples/opengl/resources/texture.jpg +0 -0
- sfml-2.6.2.0/examples/pong/data/ball.wav +0 -0
- sfml-2.6.2.0/examples/pong/data/sansation.ttf +0 -0
- sfml-2.6.2.0/examples/pong/pong.py +167 -0
- sfml-2.6.2.0/examples/shader/data/background.jpg +0 -0
- sfml-2.6.2.0/examples/shader/data/blink.frag +9 -0
- sfml-2.6.2.0/examples/shader/data/blur.frag +20 -0
- sfml-2.6.2.0/examples/shader/data/devices.png +0 -0
- sfml-2.6.2.0/examples/shader/data/edge.frag +32 -0
- sfml-2.6.2.0/examples/shader/data/pixelate.frag +9 -0
- sfml-2.6.2.0/examples/shader/data/sansation.ttf +0 -0
- sfml-2.6.2.0/examples/shader/data/sfml.png +0 -0
- sfml-2.6.2.0/examples/shader/data/storm.vert +19 -0
- sfml-2.6.2.0/examples/shader/data/text-background.png +0 -0
- sfml-2.6.2.0/examples/shader/data/text.txt +18 -0
- sfml-2.6.2.0/examples/shader/data/wave.vert +15 -0
- sfml-2.6.2.0/examples/shader/shader.py +242 -0
- sfml-2.6.2.0/examples/sockets/sockets.py +122 -0
- sfml-2.6.2.0/examples/sound/data/canary.wav +0 -0
- sfml-2.6.2.0/examples/sound/data/orchestral.ogg +0 -0
- sfml-2.6.2.0/examples/sound/sound.py +39 -0
- sfml-2.6.2.0/examples/sound_capture/sound_capture.py +41 -0
- sfml-2.6.2.0/examples/voip/client.py +59 -0
- sfml-2.6.2.0/examples/voip/server.py +111 -0
- sfml-2.6.2.0/examples/voip/voip.py +19 -0
- sfml-2.6.2.0/include/Includes/pysfml/__init__.py +1 -0
- sfml-2.6.2.0/include/Includes/pysfml/audio.pxd +23 -0
- sfml-2.6.2.0/include/Includes/pysfml/graphics.pxd +66 -0
- sfml-2.6.2.0/include/Includes/pysfml/network.pxd +9 -0
- sfml-2.6.2.0/include/Includes/pysfml/system.pxd +50 -0
- sfml-2.6.2.0/include/Includes/pysfml/window.pxd +29 -0
- sfml-2.6.2.0/include/Includes/sfml/__init__.py +0 -0
- sfml-2.6.2.0/include/Includes/sfml/blendmode.pxd +22 -0
- sfml-2.6.2.0/include/Includes/sfml/contextsettings.pxd +10 -0
- sfml-2.6.2.0/include/Includes/sfml/event.pxd +31 -0
- sfml-2.6.2.0/include/Includes/sfml/font.pxd +11 -0
- sfml-2.6.2.0/include/Includes/sfml/ftp/__init__.py +0 -0
- sfml-2.6.2.0/include/Includes/sfml/ftp/response.pxd +50 -0
- sfml-2.6.2.0/include/Includes/sfml/ftp.pxd +31 -0
- sfml-2.6.2.0/include/Includes/sfml/http/__init__.py +0 -0
- sfml-2.6.2.0/include/Includes/sfml/http/request.pxd +10 -0
- sfml-2.6.2.0/include/Includes/sfml/http/response.pxd +30 -0
- sfml-2.6.2.0/include/Includes/sfml/http.pxd +27 -0
- sfml-2.6.2.0/include/Includes/sfml/ipaddress.pxd +23 -0
- sfml-2.6.2.0/include/Includes/sfml/joystick.pxd +42 -0
- sfml-2.6.2.0/include/Includes/sfml/keyboard.pxd +113 -0
- sfml-2.6.2.0/include/Includes/sfml/listener.pxd +23 -0
- sfml-2.6.2.0/include/Includes/sfml/mouse.pxd +32 -0
- sfml-2.6.2.0/include/Includes/sfml/primitivetype.pxd +14 -0
- sfml-2.6.2.0/include/Includes/sfml/renderstates.pxd +11 -0
- sfml-2.6.2.0/include/Includes/sfml/sensor.pxd +24 -0
- sfml-2.6.2.0/include/Includes/sfml/sfml.pxd +859 -0
- sfml-2.6.2.0/include/Includes/sfml/shader.pxd +21 -0
- sfml-2.6.2.0/include/Includes/sfml/socket.pxd +14 -0
- sfml-2.6.2.0/include/Includes/sfml/soundrecorder.pxd +12 -0
- sfml-2.6.2.0/include/Includes/sfml/soundsource.pxd +10 -0
- sfml-2.6.2.0/include/Includes/sfml/soundstream.pxd +12 -0
- sfml-2.6.2.0/include/Includes/sfml/style.pxd +13 -0
- sfml-2.6.2.0/include/Includes/sfml/text.pxd +12 -0
- sfml-2.6.2.0/include/Includes/sfml/texture.pxd +19 -0
- sfml-2.6.2.0/include/Includes/sfml/time.pxd +9 -0
- sfml-2.6.2.0/include/Includes/sfml/touch.pxd +18 -0
- sfml-2.6.2.0/include/Includes/sfml/transform.pxd +11 -0
- sfml-2.6.2.0/include/Includes/sfml/udpsocket.pxd +8 -0
- sfml-2.6.2.0/include/Includes/sfml/videomode.pxd +14 -0
- sfml-2.6.2.0/include/Includes/sfml.pxd +1 -0
- sfml-2.6.2.0/pyproject.toml +73 -0
- sfml-2.6.2.0/setup.cfg +4 -0
- sfml-2.6.2.0/setup.py +166 -0
- sfml-2.6.2.0/src/SFML.egg-info/PKG-INFO +167 -0
- sfml-2.6.2.0/src/SFML.egg-info/SOURCES.txt +143 -0
- sfml-2.6.2.0/src/SFML.egg-info/dependency_links.txt +1 -0
- sfml-2.6.2.0/src/SFML.egg-info/requires.txt +3 -0
- sfml-2.6.2.0/src/SFML.egg-info/top_level.txt +1 -0
- sfml-2.6.2.0/src/sfml/__init__.py +46 -0
- sfml-2.6.2.0/src/sfml/__init__.pyi +7 -0
- sfml-2.6.2.0/src/sfml/audio/DerivableSoundRecorder.cpp +63 -0
- sfml-2.6.2.0/src/sfml/audio/DerivableSoundRecorder.hpp +29 -0
- sfml-2.6.2.0/src/sfml/audio/DerivableSoundStream.cpp +69 -0
- sfml-2.6.2.0/src/sfml/audio/DerivableSoundStream.hpp +31 -0
- sfml-2.6.2.0/src/sfml/audio/audio.cpp +26713 -0
- sfml-2.6.2.0/src/sfml/audio/audio.pyx +539 -0
- sfml-2.6.2.0/src/sfml/audio.pyi +175 -0
- sfml-2.6.2.0/src/sfml/graphics/DerivableDrawable.cpp +40 -0
- sfml-2.6.2.0/src/sfml/graphics/DerivableDrawable.hpp +28 -0
- sfml-2.6.2.0/src/sfml/graphics/DerivableRenderWindow.cpp +41 -0
- sfml-2.6.2.0/src/sfml/graphics/DerivableRenderWindow.hpp +30 -0
- sfml-2.6.2.0/src/sfml/graphics/NumericObject.cpp +167 -0
- sfml-2.6.2.0/src/sfml/graphics/NumericObject.hpp +56 -0
- sfml-2.6.2.0/src/sfml/graphics/graphics.cpp +71447 -0
- sfml-2.6.2.0/src/sfml/graphics/graphics.pyx +2114 -0
- sfml-2.6.2.0/src/sfml/graphics.pyi +580 -0
- sfml-2.6.2.0/src/sfml/network/network.cpp +32653 -0
- sfml-2.6.2.0/src/sfml/network/network.pyx +788 -0
- sfml-2.6.2.0/src/sfml/network.pyi +257 -0
- sfml-2.6.2.0/src/sfml/py.typed +1 -0
- sfml-2.6.2.0/src/sfml/sf.py +14 -0
- sfml-2.6.2.0/src/sfml/sf.pyi +5 -0
- sfml-2.6.2.0/src/sfml/system/NumericObject.cpp +167 -0
- sfml-2.6.2.0/src/sfml/system/NumericObject.hpp +56 -0
- sfml-2.6.2.0/src/sfml/system/error.cpp +35 -0
- sfml-2.6.2.0/src/sfml/system/error.hpp +16 -0
- sfml-2.6.2.0/src/sfml/system/hacks.cpp +33 -0
- sfml-2.6.2.0/src/sfml/system/hacks.hpp +25 -0
- sfml-2.6.2.0/src/sfml/system/system.cpp +22795 -0
- sfml-2.6.2.0/src/sfml/system/system.pyx +612 -0
- sfml-2.6.2.0/src/sfml/system.pyi +116 -0
- sfml-2.6.2.0/src/sfml/window/DerivableWindow.cpp +31 -0
- sfml-2.6.2.0/src/sfml/window/DerivableWindow.hpp +27 -0
- sfml-2.6.2.0/src/sfml/window/window.cpp +52700 -0
- sfml-2.6.2.0/src/sfml/window/window.pyx +1355 -0
- sfml-2.6.2.0/src/sfml/window.pyi +282 -0
- sfml-2.6.2.0/tests/test_audio_module.py +213 -0
- sfml-2.6.2.0/tests/test_graphics_module.py +145 -0
- sfml-2.6.2.0/tests/test_graphics_xvfb.py +53 -0
- sfml-2.6.2.0/tests/test_network_module.py +163 -0
- sfml-2.6.2.0/tests/test_smoke_imports.py +33 -0
- sfml-2.6.2.0/tests/test_system_module.py +128 -0
- sfml-2.6.2.0/tests/test_typing_artifacts.py +22 -0
- sfml-2.6.2.0/tests/test_window_module.py +90 -0
- sfml-2.6.2.0/tests/test_window_xvfb.py +79 -0
- sfml-2.6.2.0/tests/typing/public_api_usage.py +48 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
2
|
+
# file Copyright.txt or https://cmake.org/licensing for details.
|
|
3
|
+
|
|
4
|
+
#[=======================================================================[.rst:
|
|
5
|
+
FindOpenAL
|
|
6
|
+
----------
|
|
7
|
+
|
|
8
|
+
Finds Open Audio Library (OpenAL).
|
|
9
|
+
|
|
10
|
+
Projects using this module should use ``#include "al.h"`` to include the OpenAL
|
|
11
|
+
header file, **not** ``#include <AL/al.h>``. The reason for this is that the
|
|
12
|
+
latter is not entirely portable. Windows/Creative Labs does not by default put
|
|
13
|
+
their headers in ``AL/`` and macOS uses the convention ``<OpenAL/al.h>``.
|
|
14
|
+
|
|
15
|
+
Hints
|
|
16
|
+
^^^^^
|
|
17
|
+
|
|
18
|
+
Environment variable ``$OPENALDIR`` can be used to set the prefix of OpenAL
|
|
19
|
+
installation to be found.
|
|
20
|
+
|
|
21
|
+
By default on macOS, system framework is search first. In other words,
|
|
22
|
+
OpenAL is searched in the following order:
|
|
23
|
+
|
|
24
|
+
1. System framework: ``/System/Library/Frameworks``, whose priority can be
|
|
25
|
+
changed via setting the :variable:`CMAKE_FIND_FRAMEWORK` variable.
|
|
26
|
+
2. Environment variable ``$OPENALDIR``.
|
|
27
|
+
3. System paths.
|
|
28
|
+
4. User-compiled framework: ``~/Library/Frameworks``.
|
|
29
|
+
5. Manually compiled framework: ``/Library/Frameworks``.
|
|
30
|
+
6. Add-on package: ``/opt``.
|
|
31
|
+
|
|
32
|
+
IMPORTED Targets
|
|
33
|
+
^^^^^^^^^^^^^^^^
|
|
34
|
+
|
|
35
|
+
.. versionadded:: 3.25
|
|
36
|
+
|
|
37
|
+
This module defines the :prop_tgt:`IMPORTED` target:
|
|
38
|
+
|
|
39
|
+
``OpenAL::OpenAL``
|
|
40
|
+
The OpenAL library, if found.
|
|
41
|
+
|
|
42
|
+
Result Variables
|
|
43
|
+
^^^^^^^^^^^^^^^^
|
|
44
|
+
|
|
45
|
+
This module defines the following variables:
|
|
46
|
+
|
|
47
|
+
``OPENAL_FOUND``
|
|
48
|
+
If false, do not try to link to OpenAL
|
|
49
|
+
``OPENAL_INCLUDE_DIR``
|
|
50
|
+
OpenAL include directory
|
|
51
|
+
``OPENAL_LIBRARY``
|
|
52
|
+
Path to the OpenAL library
|
|
53
|
+
``OPENAL_VERSION_STRING``
|
|
54
|
+
Human-readable string containing the version of OpenAL
|
|
55
|
+
#]=======================================================================]
|
|
56
|
+
|
|
57
|
+
# For Windows, Creative Labs seems to have added a registry key for their
|
|
58
|
+
# OpenAL 1.1 installer. I have added that key to the list of search paths,
|
|
59
|
+
# however, the key looks like it could be a little fragile depending on
|
|
60
|
+
# if they decide to change the 1.00.0000 number for bug fix releases.
|
|
61
|
+
# Also, they seem to have laid down groundwork for multiple library platforms
|
|
62
|
+
# which puts the library in an extra subdirectory. Currently there is only
|
|
63
|
+
# Win32 and I have hardcoded that here. This may need to be adjusted as
|
|
64
|
+
# platforms are introduced.
|
|
65
|
+
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use.
|
|
66
|
+
# I do not know if the Nvidia OpenAL SDK has a registry key.
|
|
67
|
+
|
|
68
|
+
find_path(OPENAL_INCLUDE_DIR al.h
|
|
69
|
+
HINTS
|
|
70
|
+
ENV OPENALDIR
|
|
71
|
+
PATHS
|
|
72
|
+
~/Library/Frameworks
|
|
73
|
+
/Library/Frameworks
|
|
74
|
+
/opt
|
|
75
|
+
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
|
|
76
|
+
PATH_SUFFIXES include/AL include/OpenAL include AL OpenAL
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
find_library(OPENAL_LIBRARY
|
|
80
|
+
NAMES OpenAL al openal OpenAL32 openal32
|
|
81
|
+
HINTS
|
|
82
|
+
ENV OPENALDIR
|
|
83
|
+
PATHS
|
|
84
|
+
~/Library/Frameworks
|
|
85
|
+
/Library/Frameworks
|
|
86
|
+
/opt
|
|
87
|
+
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir]
|
|
88
|
+
PATH_SUFFIXES libx32 lib64 lib libs64 libs
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
include(FindPackageHandleStandardArgs)
|
|
92
|
+
find_package_handle_standard_args(
|
|
93
|
+
OpenAL
|
|
94
|
+
REQUIRED_VARS OPENAL_LIBRARY OPENAL_INCLUDE_DIR
|
|
95
|
+
VERSION_VAR OPENAL_VERSION_STRING
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
|
|
99
|
+
|
|
100
|
+
if(OPENAL_INCLUDE_DIR AND OPENAL_LIBRARY)
|
|
101
|
+
if(NOT TARGET OpenAL::OpenAL)
|
|
102
|
+
if(EXISTS "${OPENAL_LIBRARY}")
|
|
103
|
+
if(WIN32)
|
|
104
|
+
get_filename_component(OPENAL_PATH ${OPENAL_LIBRARY} DIRECTORY)
|
|
105
|
+
add_library(OpenAL::OpenAL SHARED IMPORTED)
|
|
106
|
+
if (ARCH_x86)
|
|
107
|
+
set(DLL_PATH "${OPENAL_PATH}/../../bin/x86/openal32.dll")
|
|
108
|
+
elseif(ARCH_X64)
|
|
109
|
+
set(DLL_PATH "${OPENAL_PATH}/../../bin/x64/openal32.dll")
|
|
110
|
+
else()
|
|
111
|
+
set(DLL_PATH "${OPENAL_PATH}/../../bin/ARM64/openal32.dll")
|
|
112
|
+
endif()
|
|
113
|
+
set_target_properties(OpenAL::OpenAL PROPERTIES
|
|
114
|
+
IMPORTED_LOCATION "${DLL_PATH}"
|
|
115
|
+
IMPORTED_IMPLIB "${OPENAL_LIBRARY}")
|
|
116
|
+
elseif(APPLE)
|
|
117
|
+
if(IS_DIRECTORY "${OPENAL_LIBRARY}")
|
|
118
|
+
# Framework bundle directory: search for the binary inside it.
|
|
119
|
+
find_file(OPENAL_FULL_PATH OpenAL OpenAL.tbd PATHS "${OPENAL_LIBRARY}" REQUIRED)
|
|
120
|
+
add_library(OpenAL::OpenAL SHARED IMPORTED)
|
|
121
|
+
set_target_properties(OpenAL::OpenAL PROPERTIES
|
|
122
|
+
IMPORTED_LOCATION "${OPENAL_FULL_PATH}")
|
|
123
|
+
else()
|
|
124
|
+
# Plain dylib (e.g. Homebrew openal-soft on macOS 15 where
|
|
125
|
+
# OpenAL.framework is no longer present in the system).
|
|
126
|
+
add_library(OpenAL::OpenAL SHARED IMPORTED)
|
|
127
|
+
set_target_properties(OpenAL::OpenAL PROPERTIES
|
|
128
|
+
IMPORTED_LOCATION "${OPENAL_LIBRARY}")
|
|
129
|
+
endif()
|
|
130
|
+
else()
|
|
131
|
+
add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
|
|
132
|
+
set_target_properties(OpenAL::OpenAL PROPERTIES
|
|
133
|
+
IMPORTED_LOCATION "${OPENAL_LIBRARY}")
|
|
134
|
+
endif()
|
|
135
|
+
else()
|
|
136
|
+
add_library(OpenAL::OpenAL INTERFACE IMPORTED)
|
|
137
|
+
set_target_properties(OpenAL::OpenAL PROPERTIES
|
|
138
|
+
IMPORTED_LIBNAME "${OPENAL_LIBRARY}")
|
|
139
|
+
endif()
|
|
140
|
+
set_target_properties(OpenAL::OpenAL PROPERTIES
|
|
141
|
+
INTERFACE_INCLUDE_DIRECTORIES "${OPENAL_INCLUDE_DIR}")
|
|
142
|
+
endif()
|
|
143
|
+
endif()
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
version="${1:?SFML version is required}"
|
|
6
|
+
prefix="${2:?install prefix is required}"
|
|
7
|
+
install_deps="${3:-0}"
|
|
8
|
+
openal_prefix=""
|
|
9
|
+
|
|
10
|
+
cmake_args=(
|
|
11
|
+
-G Ninja
|
|
12
|
+
-DBUILD_SHARED_LIBS=ON
|
|
13
|
+
-DCMAKE_BUILD_TYPE=Release
|
|
14
|
+
"-DCMAKE_INSTALL_PREFIX=${prefix}"
|
|
15
|
+
-DCMAKE_INSTALL_LIBDIR=lib
|
|
16
|
+
-DSFML_BUILD_DOC=OFF
|
|
17
|
+
-DSFML_BUILD_EXAMPLES=OFF
|
|
18
|
+
-DSFML_BUILD_TEST_SUITE=OFF
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
if [[ -f "${prefix}/include/SFML/Config.hpp" ]]; then
|
|
22
|
+
exit 0
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
if [[ "${install_deps}" == "1" ]]; then
|
|
26
|
+
if command -v apt-get >/dev/null 2>&1; then
|
|
27
|
+
export DEBIAN_FRONTEND=noninteractive
|
|
28
|
+
apt-get update
|
|
29
|
+
apt-get install -y \
|
|
30
|
+
build-essential \
|
|
31
|
+
cmake \
|
|
32
|
+
git \
|
|
33
|
+
libflac-dev \
|
|
34
|
+
libfreetype6-dev \
|
|
35
|
+
libgl1-mesa-dev \
|
|
36
|
+
libjpeg-dev \
|
|
37
|
+
libopenal-dev \
|
|
38
|
+
libudev-dev \
|
|
39
|
+
libvorbis-dev \
|
|
40
|
+
libx11-dev \
|
|
41
|
+
libxcursor-dev \
|
|
42
|
+
libxi-dev \
|
|
43
|
+
libxinerama-dev \
|
|
44
|
+
libxrandr-dev \
|
|
45
|
+
ninja-build \
|
|
46
|
+
pkg-config
|
|
47
|
+
elif command -v dnf >/dev/null 2>&1; then
|
|
48
|
+
dnf install -y \
|
|
49
|
+
cmake \
|
|
50
|
+
freetype-devel \
|
|
51
|
+
gcc-c++ \
|
|
52
|
+
git \
|
|
53
|
+
libX11-devel \
|
|
54
|
+
libXcursor-devel \
|
|
55
|
+
libXext-devel \
|
|
56
|
+
libXi-devel \
|
|
57
|
+
libXinerama-devel \
|
|
58
|
+
libXrandr-devel \
|
|
59
|
+
libjpeg-turbo-devel \
|
|
60
|
+
libudev-devel \
|
|
61
|
+
mesa-libGL-devel \
|
|
62
|
+
ninja-build \
|
|
63
|
+
openal-soft-devel \
|
|
64
|
+
pkgconf-pkg-config \
|
|
65
|
+
flac-devel \
|
|
66
|
+
libvorbis-devel
|
|
67
|
+
elif command -v yum >/dev/null 2>&1; then
|
|
68
|
+
yum install -y \
|
|
69
|
+
cmake \
|
|
70
|
+
freetype-devel \
|
|
71
|
+
gcc-c++ \
|
|
72
|
+
git \
|
|
73
|
+
libX11-devel \
|
|
74
|
+
libXcursor-devel \
|
|
75
|
+
libXext-devel \
|
|
76
|
+
libXi-devel \
|
|
77
|
+
libXinerama-devel \
|
|
78
|
+
libXrandr-devel \
|
|
79
|
+
libjpeg-turbo-devel \
|
|
80
|
+
libudev-devel \
|
|
81
|
+
mesa-libGL-devel \
|
|
82
|
+
ninja-build \
|
|
83
|
+
openal-soft-devel \
|
|
84
|
+
pkgconfig \
|
|
85
|
+
flac-devel \
|
|
86
|
+
libvorbis-devel
|
|
87
|
+
elif command -v brew >/dev/null 2>&1; then
|
|
88
|
+
brew update
|
|
89
|
+
brew install cmake ninja pkg-config freetype libogg libvorbis flac jpeg-turbo openal-soft
|
|
90
|
+
|
|
91
|
+
brew_prefix="$(brew --prefix)"
|
|
92
|
+
openal_prefix="$(brew --prefix openal-soft)"
|
|
93
|
+
macos_rpath="${prefix}/lib;${brew_prefix}/lib;/System/Library/Frameworks;/Library/Frameworks"
|
|
94
|
+
cmake_args+=(
|
|
95
|
+
-DCMAKE_FIND_FRAMEWORK=LAST
|
|
96
|
+
"-DCMAKE_PREFIX_PATH=${brew_prefix}"
|
|
97
|
+
"-DOPENAL_LIBRARY=${openal_prefix}/lib/libopenal.dylib"
|
|
98
|
+
"-DOPENAL_INCLUDE_DIR=${openal_prefix}/include/AL"
|
|
99
|
+
"-DCMAKE_INSTALL_RPATH=${macos_rpath}"
|
|
100
|
+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON
|
|
101
|
+
)
|
|
102
|
+
fi
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
src_dir="$(mktemp -d)"
|
|
106
|
+
build_dir="$(mktemp -d)"
|
|
107
|
+
trap 'rm -rf "${src_dir}" "${build_dir}"' EXIT
|
|
108
|
+
|
|
109
|
+
git clone --branch "${version}" --depth 1 https://github.com/SFML/SFML "${src_dir}"
|
|
110
|
+
|
|
111
|
+
if [[ -n "${openal_prefix:-}" ]]; then
|
|
112
|
+
cp "$(dirname "$0")/FindOpenAL.cmake" "${src_dir}/cmake/Modules/FindOpenAL.cmake"
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
cmake -S "${src_dir}" -B "${build_dir}" "${cmake_args[@]}"
|
|
116
|
+
cmake --build "${build_dir}"
|
|
117
|
+
cmake --install "${build_dir}"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
param(
|
|
2
|
+
[Parameter(Mandatory = $true)]
|
|
3
|
+
[string]$Version,
|
|
4
|
+
[Parameter(Mandatory = $true)]
|
|
5
|
+
[string]$Prefix,
|
|
6
|
+
[string]$Architecture = "x64"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
$ErrorActionPreference = "Stop"
|
|
10
|
+
|
|
11
|
+
$cmakeExe = if ($env:CMAKE_EXE) { $env:CMAKE_EXE } else { "cmake" }
|
|
12
|
+
if (Test-Path $cmakeExe -PathType Container) {
|
|
13
|
+
$cmakeExe = Join-Path $cmakeExe "cmake.exe"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (-not ($cmakeExe -like "*.exe") -and $cmakeExe -ne "cmake") {
|
|
17
|
+
$candidateExe = Join-Path $cmakeExe "cmake.exe"
|
|
18
|
+
if (Test-Path $candidateExe -PathType Leaf) {
|
|
19
|
+
$cmakeExe = $candidateExe
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if ($cmakeExe -ne "cmake" -and -not (Test-Path $cmakeExe -PathType Leaf)) {
|
|
24
|
+
throw "Configured CMake executable was not found: $cmakeExe"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
$Prefix = [System.IO.Path]::GetFullPath($Prefix)
|
|
28
|
+
$configHeader = Join-Path $Prefix "include\SFML\Config.hpp"
|
|
29
|
+
|
|
30
|
+
if (Test-Path $configHeader) {
|
|
31
|
+
exit 0
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
New-Item -ItemType Directory -Force -Path $Prefix | Out-Null
|
|
35
|
+
|
|
36
|
+
$cmakeInstallPrefix = $Prefix -replace '\\', '/'
|
|
37
|
+
|
|
38
|
+
$generatorArch = if ($Architecture -eq "x86") { "Win32" } else { "x64" }
|
|
39
|
+
$srcDir = Join-Path $env:RUNNER_TEMP "sfml-src"
|
|
40
|
+
$buildDir = Join-Path $env:RUNNER_TEMP "sfml-build"
|
|
41
|
+
$archivePath = Join-Path $env:RUNNER_TEMP "sfml-src.zip"
|
|
42
|
+
|
|
43
|
+
if (Test-Path $srcDir) {
|
|
44
|
+
Remove-Item $srcDir -Recurse -Force
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (Test-Path $buildDir) {
|
|
48
|
+
Remove-Item $buildDir -Recurse -Force
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (Test-Path $archivePath) {
|
|
52
|
+
Remove-Item $archivePath -Force
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
$archiveUrl = "https://github.com/SFML/SFML/archive/refs/tags/$Version.zip"
|
|
56
|
+
Invoke-WebRequest -Uri $archiveUrl -OutFile $archivePath
|
|
57
|
+
Expand-Archive -Path $archivePath -DestinationPath $env:RUNNER_TEMP -Force
|
|
58
|
+
|
|
59
|
+
$extractedDir = Join-Path $env:RUNNER_TEMP "SFML-$Version"
|
|
60
|
+
if (-not (Test-Path $extractedDir)) {
|
|
61
|
+
throw "Downloaded SFML source archive did not extract to expected directory: $extractedDir"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
Move-Item -Path $extractedDir -Destination $srcDir
|
|
65
|
+
& $cmakeExe -S $srcDir -B $buildDir -G "Visual Studio 17 2022" -A $generatorArch `
|
|
66
|
+
-DBUILD_SHARED_LIBS=ON `
|
|
67
|
+
-DCMAKE_BUILD_TYPE=Release `
|
|
68
|
+
"-DCMAKE_INSTALL_PREFIX=$cmakeInstallPrefix" `
|
|
69
|
+
-DSFML_BUILD_DOC=OFF `
|
|
70
|
+
-DSFML_BUILD_EXAMPLES=OFF `
|
|
71
|
+
-DSFML_BUILD_TEST_SUITE=OFF
|
|
72
|
+
& $cmakeExe --build $buildDir --config Release
|
|
73
|
+
& $cmakeExe --install $buildDir --config Release
|
|
74
|
+
|
|
75
|
+
if (-not (Test-Path $configHeader)) {
|
|
76
|
+
throw "SFML install did not produce expected header: $configHeader"
|
|
77
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
TEST_FILES = [
|
|
12
|
+
"tests/test_smoke_imports.py",
|
|
13
|
+
"tests/test_typing_artifacts.py",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def sanitized_env() -> dict[str, str]:
|
|
18
|
+
env = os.environ.copy()
|
|
19
|
+
|
|
20
|
+
for name in ("SFML_HEADERS", "SFML_LIBRARIES", "PKG_CONFIG_PATH", "LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"):
|
|
21
|
+
env.pop(name, None)
|
|
22
|
+
|
|
23
|
+
if os.name == "nt":
|
|
24
|
+
blocked = ("c:/cibw-sfml-2.6.2/bin", "c:\\cibw-sfml-2.6.2\\bin")
|
|
25
|
+
path_parts = env.get("PATH", "").split(os.pathsep)
|
|
26
|
+
env["PATH"] = os.pathsep.join(
|
|
27
|
+
part
|
|
28
|
+
for part in path_parts
|
|
29
|
+
if part and all(token not in part.lower() for token in blocked)
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return env
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def main() -> int:
|
|
36
|
+
project_dir = Path(sys.argv[1]).resolve() if len(sys.argv) > 1 else Path.cwd()
|
|
37
|
+
command = [sys.executable, "-m", "pytest", "-q", *[str(project_dir / test_file) for test_file in TEST_FILES]]
|
|
38
|
+
return subprocess.run(command, cwd=project_dir, env=sanitized_env(), check=False).returncode
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from importlib import import_module, resources
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
MODULES = [
|
|
11
|
+
"sfml",
|
|
12
|
+
"sfml.system",
|
|
13
|
+
"sfml.window",
|
|
14
|
+
"sfml.graphics",
|
|
15
|
+
"sfml.audio",
|
|
16
|
+
"sfml.network",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def configure_runtime_environment() -> None:
|
|
21
|
+
if os.name != "nt":
|
|
22
|
+
os.environ.setdefault("ALSOFT_DRIVERS", "null")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def main() -> int:
|
|
26
|
+
configure_runtime_environment()
|
|
27
|
+
|
|
28
|
+
loaded_modules = {name: import_module(name) for name in MODULES}
|
|
29
|
+
sfml = loaded_modules["sfml"]
|
|
30
|
+
system = loaded_modules["sfml.system"]
|
|
31
|
+
window = loaded_modules["sfml.window"]
|
|
32
|
+
graphics = loaded_modules["sfml.graphics"]
|
|
33
|
+
audio = loaded_modules["sfml.audio"]
|
|
34
|
+
network = loaded_modules["sfml.network"]
|
|
35
|
+
|
|
36
|
+
package_root = Path(sfml.__file__).resolve().parent
|
|
37
|
+
|
|
38
|
+
print(f"sfml package root: {package_root}")
|
|
39
|
+
print(f"configured ALSOFT_DRIVERS: {os.environ.get('ALSOFT_DRIVERS')!r}")
|
|
40
|
+
|
|
41
|
+
assert hasattr(system, "Time")
|
|
42
|
+
assert hasattr(window, "VideoMode")
|
|
43
|
+
assert hasattr(graphics, "Color")
|
|
44
|
+
assert hasattr(audio, "Listener")
|
|
45
|
+
assert hasattr(network, "IpAddress")
|
|
46
|
+
|
|
47
|
+
clock = system.Clock()
|
|
48
|
+
elapsed = clock.elapsed_time
|
|
49
|
+
print(f"clock elapsed seconds: {elapsed.seconds}")
|
|
50
|
+
|
|
51
|
+
video_mode = window.VideoMode(640, 480, 32)
|
|
52
|
+
print(f"video mode: {video_mode.width}x{video_mode.height}x{video_mode.bits_per_pixel}")
|
|
53
|
+
|
|
54
|
+
context_settings = window.ContextSettings(depth=24, stencil=8, antialiasing=0, major=3, minor=0)
|
|
55
|
+
print(f"context depth bits: {context_settings.depth_bits}")
|
|
56
|
+
|
|
57
|
+
color = graphics.Color(10, 20, 30, 255)
|
|
58
|
+
rect = graphics.Rect((0, 0), (10, 20))
|
|
59
|
+
print(f"graphics objects: color={tuple(color)} rect={tuple(rect)}")
|
|
60
|
+
|
|
61
|
+
chunk = audio.Chunk(b"\x00\x00\x01\x00")
|
|
62
|
+
chunk[0] = 0
|
|
63
|
+
print(f"audio chunk samples: {len(chunk)}")
|
|
64
|
+
|
|
65
|
+
ip_address = network.IpAddress.from_string("127.0.0.1")
|
|
66
|
+
print(f"network address bytes: {ip_address.string!r}")
|
|
67
|
+
|
|
68
|
+
sfml_package = resources.files("sfml")
|
|
69
|
+
typing_artifacts = [
|
|
70
|
+
"py.typed",
|
|
71
|
+
"__init__.pyi",
|
|
72
|
+
"audio.pyi",
|
|
73
|
+
"graphics.pyi",
|
|
74
|
+
"network.pyi",
|
|
75
|
+
"sf.pyi",
|
|
76
|
+
"system.pyi",
|
|
77
|
+
"window.pyi",
|
|
78
|
+
]
|
|
79
|
+
missing = [path for path in typing_artifacts if not sfml_package.joinpath(path).is_file()]
|
|
80
|
+
if missing:
|
|
81
|
+
raise RuntimeError(f"missing typing artifacts: {', '.join(missing)}")
|
|
82
|
+
|
|
83
|
+
signature_line = next(iter((system.seconds.__doc__ or "").splitlines()), "")
|
|
84
|
+
if not signature_line.startswith("seconds("):
|
|
85
|
+
raise RuntimeError(f"unexpected system.seconds signature doc: {signature_line!r}")
|
|
86
|
+
|
|
87
|
+
print("installed-package validation passed")
|
|
88
|
+
return 0
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
if __name__ == "__main__":
|
|
92
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import sys
|
|
7
|
+
import tarfile
|
|
8
|
+
import zipfile
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
REQUIRED_TYPING_ARTIFACTS = {
|
|
13
|
+
"sfml/py.typed",
|
|
14
|
+
"sfml/__init__.pyi",
|
|
15
|
+
"sfml/audio.pyi",
|
|
16
|
+
"sfml/graphics.pyi",
|
|
17
|
+
"sfml/network.pyi",
|
|
18
|
+
"sfml/sf.pyi",
|
|
19
|
+
"sfml/system.pyi",
|
|
20
|
+
"sfml/window.pyi",
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
SDIST_TYPING_ARTIFACTS = {f"src/{path}" for path in REQUIRED_TYPING_ARTIFACTS}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def wheel_members(path: Path) -> set[str]:
|
|
27
|
+
with zipfile.ZipFile(path) as archive:
|
|
28
|
+
return set(archive.namelist())
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def sdist_members(path: Path) -> set[str]:
|
|
32
|
+
with tarfile.open(path, "r:gz") as archive:
|
|
33
|
+
members = set()
|
|
34
|
+
for member in archive.getnames():
|
|
35
|
+
parts = member.split("/", 1)
|
|
36
|
+
if len(parts) == 2:
|
|
37
|
+
members.add(parts[1])
|
|
38
|
+
return members
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def validate_members(path: Path, members: set[str]) -> list[str]:
|
|
42
|
+
required_paths = SDIST_TYPING_ARTIFACTS if path.suffixes[-2:] == [".tar", ".gz"] else REQUIRED_TYPING_ARTIFACTS
|
|
43
|
+
missing = sorted(required for required in required_paths if required not in members)
|
|
44
|
+
errors: list[str] = []
|
|
45
|
+
|
|
46
|
+
if missing:
|
|
47
|
+
errors.append(f"missing typing artifacts: {', '.join(missing)}")
|
|
48
|
+
|
|
49
|
+
if path.suffix == ".whl" and not any(name.startswith("sfml/") and (name.endswith(".so") or name.endswith(".pyd")) for name in members):
|
|
50
|
+
errors.append("wheel does not contain a compiled extension module under sfml/")
|
|
51
|
+
|
|
52
|
+
return errors
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def validate_artifact(path: Path) -> int:
|
|
56
|
+
if path.suffix == ".whl":
|
|
57
|
+
members = wheel_members(path)
|
|
58
|
+
elif path.suffixes[-2:] == [".tar", ".gz"]:
|
|
59
|
+
members = sdist_members(path)
|
|
60
|
+
else:
|
|
61
|
+
print(f"unsupported artifact type: {path}", file=sys.stderr)
|
|
62
|
+
return 1
|
|
63
|
+
|
|
64
|
+
errors = validate_members(path, members)
|
|
65
|
+
if errors:
|
|
66
|
+
print(f"artifact validation failed for {path}:", file=sys.stderr)
|
|
67
|
+
for error in errors:
|
|
68
|
+
print(f"- {error}", file=sys.stderr)
|
|
69
|
+
return 1
|
|
70
|
+
|
|
71
|
+
print(f"validated {path}")
|
|
72
|
+
return 0
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def main() -> int:
|
|
76
|
+
parser = argparse.ArgumentParser(description="Validate PySFML wheel and sdist contents")
|
|
77
|
+
parser.add_argument("artifacts", nargs="+", help="wheel and/or sdist paths")
|
|
78
|
+
args = parser.parse_args()
|
|
79
|
+
|
|
80
|
+
exit_code = 0
|
|
81
|
+
for artifact in args.artifacts:
|
|
82
|
+
exit_code |= validate_artifact(Path(artifact))
|
|
83
|
+
return exit_code
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
if __name__ == "__main__":
|
|
87
|
+
raise SystemExit(main())
|