Package: pycsdl2
pycsdl2is a low-overhead, compiledSDL2binding for CPython. It aims to
provide the familiar C API of SDL2, while offering severalPythonicfeatures
such as automatic memory management, bounds checking and exceptions.DocumentationDocumentation is hosted online athttps://pycsdl2.readthedocs.org/.The Python API is documented withSphinxin thedocs/directory. If you
haveGNU Makeand Sphinx installed, run the following in thedocs/directory to generate the HTML documentation indocs/_build/html/:make htmlOn Windows,make.batcan be used instead of GNU Make. Run the following in
thedocs/directory to generate the HTML documentation indocs/_build/html/:.\make.bat htmlThe documentation can be generated in other formats as well. See the output ofmake helpor.\make.bat helpfor more details.BuildingBuilding the source code requires the CPython header files to be installed.
This may require the installation of a development package such aspython3-devin Debian. The headers are installed by default in theofficial Python distributionsfor Windows and Mac OS X.On Windows and Mac OS X, pycsdl2 will be statically linked against the
bundled SDL2 source code. As such,on Windows, theWindows 7 SDKand theStandalone DirectX SDKmust be
installed.on Mac OS X,XCodemust be installed.On other platforms such as Linux, the system must have a C compiler installed
and the SDL2 library and header files installed. This may require the
installation of a development package such aslibsdl2-devon Debian.
Furthermore, a working installation ofsdl2-configorpkg-configmust
be present in the executable search paths. pycsdl2 will be dynamically linked
to the SDL2 library on these platforms.Once your system satisfies the above requirements, run the following in the
root of the source directory:python3 setup.py buildIf the build is successful, pycsdl2 can be installed with:python3 setup.py installThe above build behavior can be controlled with the environment variablePYCSDL2_LIB:setting it toautowill use the default behavior.setup.pywill build
and link against the bundled SDL2 source code on Windows and Mac OS X, and
link against the system SDL2 library on other platforms.setting it tobundledwill forcesetup.pyto build and link
against the bundled SDL2 source code.setting it tosystemwill forcesetup.pyto link against the system’s
SDL2 library.sdl2-configwill be used to retrieve the required compile
and link flags, and if it fails,pkg-configwill be used instead.setting it tosdl2-configorpkg-configwill forcesetup.pyto
link against the system’s SDL2 library, and to only usesdl2-configorpkg-configrespectively to retrieve the required compile and link flags.Unit testsUnit tests are implemented using theunitteststandard library module. Once
the pycsdl2 has been built withpython3 setup.py build, you can run all
tests by running the following in the root of the source directory:python3 -mtestYou can also run an individual test suite by running the corresponding file in
thetest/directory:python3 test/testfoo.pyUnderstanding the source codeThe source code is documented withDoxygen. If you have a working
installation, simply run the following in the root of the source directory:doxygenThe HTML documentation will be written to theapidocs/htmldirectory.LicenseUnless otherwise stated,pycsdl2source code is licensed under thezliblicense.pycsdl2source code contains an unmodified copy of theSimple DirectMedia Layer(SDL) version 2.0.0 source code. The source code is
licensed under thezliblicense.