Skip to content

Commit

Permalink
Deleted pygame build components
Browse files Browse the repository at this point in the history
Removed pygame references from doc

Removed some more pygame references

Removed some more pygame references

Removed more references to pygame

Fixed unicode strings in android module recipe, broken in rebase

Deleted pygame recipe

Removed references to sdl from audiostream and genericndkbuild

Deleted argparse file in pygame bootstrap

Removed sdl reference from pyjnius recipe
  • Loading branch information
inclement committed May 26, 2019
1 parent 49e616c commit 47a9159
Show file tree
Hide file tree
Showing 133 changed files with 47 additions and 22,612 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ recursive-include pythonforandroid/recipes *.py *.patch *.c *.pyx Setup *.h
recursive-include pythonforandroid/bootstraps *.properties *.xml *.java *.tmpl *.txt *.png *.aidl *.py *.sh *.c *.h *.html *.patch

prune .git
prune pythonforandroid/bootstraps/pygame/build/libs
37 changes: 17 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,23 @@ Please refer to the LICENSE file.
## History

In 2015 these tools were rewritten to provide a new, easier to use and
extend interface. If you are looking for the old toolchain with
distribute.sh and build.py, it is still available at
https://github.com/kivy/python-for-android/tree/old_toolchain, and
issues and PRs relating to this branch are still accepted. However, the
new toolchain contains all the same functionality via the built in
pygame bootstrap.

In the last quarter of 2018 the python recipes has been changed, the new recipe
for python3 (3.7.1) has a new build system which has been applied to the ancient
python recipe, allowing us to bump the python2 version number to 2.7.15. This
change, unifies the build process for both python recipes, and probably solve
some issues detected over the years, but unfortunately, this change breaks the
pygame bootstrap (in a near future we will fix it or remove it). Also should be
mentioned that the old python recipe is still usable, and has been renamed to
`python2legacy`. This `python2legacy` recipe allow us to build with a minimum
api lower than 21, which is not the case for the new python recipes which are
limited to a minimum api of 21. All this work has been done using android ndk
version r17c, and your build should success with that version...but be aware
that the project is in constant development so...the ndk version will change
at some time.
extend interface. If you'd like to browse the old toolchain, its
status is recorded for posterity at at
https://github.com/kivy/python-for-android/tree/old_toolchain.

In the last quarter of 2018 the python recipes has been changed, the
new recipe for python3 (3.7.1) has a new build system which has been
applied to the ancient python recipe, allowing us to bump the python2
version number to 2.7.15. This change, unifies the build process for
both python recipes, and probably solve some issues detected over the
years. Also should be mentioned that the old python recipe is still
usable, and has been renamed to `python2legacy`. This `python2legacy`
recipe allow us to build with a minimum api lower than 21, which is
not the case for the new python recipes which are limited to a minimum
api of 21. All this work has been done using android ndk version r17c,
and your build should success with that version...but be aware that
the project is in constant development so...the ndk version will
change at some time.

Those mentioned changes has been done this way to make easier the transition
between python3 and python2. We will slowly phase out python2 support
Expand Down
1 change: 0 additions & 1 deletion ci/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class TargetPython(Enum):
'omemo',
# requires `libpq-dev` system dependency e.g. for `pg_config` binary
'psycopg2',
'pygame',
# most likely some setup in the Docker container, because it works in host
'pyjnius', 'pyopenal',
'pyproj',
Expand Down
11 changes: 4 additions & 7 deletions doc/source/apis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Advanced Android API use
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

As mentioned above, the ``android`` Python module provides a simple
wrapper around many native Android APIS, and it is *included per default*
wrapper around many native Android APIS, and it is *included by default*
unless you blacklist it.

The available functionality of this module is not separately documented.
Expand Down Expand Up @@ -159,9 +159,6 @@ a Java class. For instance, here is the code to vibrate your device::
# application, this reference is stored automatically by
# Kivy's PythonActivity bootstrap

# This one works with Pygame
# PythonActivity = autoclass('org.renpy.android.PythonActivity')
# This one works with SDL2
PythonActivity = autoclass('org.kivy.android.PythonActivity')

Expand All @@ -176,9 +173,9 @@ Things to note here are:

- The class that must be wrapped depends on the bootstrap. This is
because Pyjnius is using the bootstrap's java source code to get a
reference to the current activity, which both the Pygame and SDL2
bootstraps store in the ``mActivity`` static variable. This
difference isn't always important, but it's important to know about.
reference to the current activity, which the bootstraps store in the
``mActivity`` static variable. This difference isn't always
important, but it's important to know about.
- The code closely follows the Java API - this is exactly the same set
of function calls that you'd use to achieve the same thing from Java
code.
Expand Down
2 changes: 1 addition & 1 deletion doc/source/bootstraps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Bootstraps
==========

This page is about creating new bootstrap backends. For build options
of existing bootstraps (i.e. with SDL2, Pygame, Webview etc.), see
of existing bootstraps (i.e. with SDL2, Webview, etc.), see
:ref:`build options <bootstrap_build_options>`.

python-for-android (p4a) supports multiple *bootstraps*. These fulfill a
Expand Down
16 changes: 1 addition & 15 deletions doc/source/buildoptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,24 +188,10 @@ ready.
access. Defaults to 5000.


pygame
~~~~~~

You can use this with ``--bootstrap=pygame``, or simply include the
``pygame`` recipe in your ``--requirements``.

The pygame bootstrap is the original backend used by Kivy, and still
works fine for use with Kivy apps. It may also work for pure pygame
apps, but hasn't been developed with this in mind.

This bootstrap will eventually be deprecated in favour of sdl2, but
not before the sdl2 bootstrap includes all the features that would be
lost.

Build options
%%%%%%%%%%%%%

The pygame bootstrap supports the following additional command line
The sdl2 bootstrap supports the following additional command line
options (this list may not be exhaustive):

- ``--private``: The directory containing your project files.
Expand Down
3 changes: 1 addition & 2 deletions doc/source/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ supply those that you need.
The Java bootstrap to use for your application. You mostly don't
need to worry about this or set it manually, as an appropriate
bootstrap will be chosen from your ``--requirements``. Current
choices are ``sdl2`` or ``pygame``; ``sdl2`` is experimental but
preferable where possible.
choices are ``sdl2`` (used with Kivy and most other apps) or ``webview``.


.. note:: These options are preliminary. Others will include toggles
Expand Down
6 changes: 1 addition & 5 deletions doc/source/launcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ grab an old (cached) package instead of a fresh one.
--name="App name" \
--version=x.y.z \
--android_api XY \
--bootstrap=pygame or sdl2 \
--bootstrap=sdl2 \
--launcher \
--minsdk 13

Expand Down Expand Up @@ -91,12 +91,8 @@ it changes quickly and needs testing.
Source code
-----------

.. |renpy| replace:: pygame org.renpy.android
.. |kivy| replace:: sdl2 org.kivy.android

.. _renpy:
https://github.com/kivy/python-for-android/tree/master/\
pythonforandroid/bootstraps/pygame/build/src/org/renpy/android
.. _sdl2:
https://github.com/kivy/python-for-android/tree/master/\
pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android
Expand Down
2 changes: 1 addition & 1 deletion doc/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Concepts
different sets of requirements.

- bootstrap: A bootstrap is the app backend that will start your
application. Your application could use SDL2 as a base, or Pygame,
application. Your application could use SDL2 as a base,
or a web backend like Flask with a WebView bootstrap. Different
bootstraps can have different build options.

Expand Down
12 changes: 6 additions & 6 deletions doc/source/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The basic declaration of a recipe is as follows::
patches = ['some_fix.patch'] # Paths relative to the recipe dir

depends = ['kivy', 'sdl2'] # These are just examples
conflicts = ['pygame']
conflicts = ['python2']
recipe = YourRecipe()

Expand Down Expand Up @@ -306,14 +306,14 @@ the cython components and to install the Python module just like a
normal PythonRecipe.

For instance, the following is all that's necessary to make a recipe
for Kivy (in this case, depending on Pygame rather than SDL2)::
for Kivy::

class KivyRecipe(CythonRecipe):
version = 'stable'
url = 'https://github.com/kivy/kivy/archive/{version}.zip'
name = 'kivy'
version = 'stable'
url = 'https://github.com/kivy/kivy/archive/{version}.zip'
name = 'kivy'

depends = ['pygame', 'pyjnius', 'android']
depends = ['sdl2', 'pyjnius']

recipe = KivyRecipe()
Expand Down
12 changes: 4 additions & 8 deletions doc/source/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,16 @@ There are two ways to have services included in your APK.
Service folder
~~~~~~~~~~~~~~

This basic method works with both the new SDL2 and old Pygame
bootstraps. It is recommended to use the second method (below) where
possible.
This is the older method of handling services. It is
recommended to use the second method (below) where possible.

Create a folder named ``service`` in your app directory, and add a
file ``service/main.py``. This file should contain the Python code
that you want the service to run.

To start the service, use the :code:`start_service` function from the
:code:`android` module (included automatically with the Pygame
bootstrap, you must add it to the requirements manually with SDL2 if
you wish to use this method)::
:code:`android` module (you may need to add ``android`` to your app
requirements)::

import android
android.start_service(title='service name',
Expand All @@ -49,8 +47,6 @@ you wish to use this method)::
Arbitrary service scripts
~~~~~~~~~~~~~~~~~~~~~~~~~

.. note:: This service method is *not supported* by the Pygame bootstrap.

This method is recommended for non-trivial use of services as it is
more flexible, supporting multiple services and a wider range of
options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,11 @@
#include <errno.h>

#include "bootstrap_name.h"

#ifndef BOOTSTRAP_USES_NO_SDL_HEADERS
#include "SDL.h"
#ifndef BOOTSTRAP_NAME_PYGAME
#include "SDL_opengles2.h"
#endif
#endif
#ifdef BOOTSTRAP_NAME_PYGAME
#include "jniwrapperstuff.h"
#endif
#include "android/log.h"

#define ENTRYPOINT_MAXLEN 128
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/**
* This class takes care of managing resources for us. In our code, we
* can't use R, since the name of the package containing R will
* change. (This same code is used in both org.renpy.android and
* org.renpy.pygame.) So this is the next best thing.
* change. So this is the next best thing.
*/

package org.renpy.android;
Expand Down
74 changes: 0 additions & 74 deletions pythonforandroid/bootstraps/pygame/__init__.py

This file was deleted.

Loading

0 comments on commit 47a9159

Please sign in to comment.