-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
pygame recipe #2019
Closed
Closed
pygame recipe #2019
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1538c89
pygame recipe
a10cd13
include more dependencies
7411f40
asset paths
4711199
Merge remote-tracking branch 'kivy/master' into develop
c14aa27
Asset paths in p4a command line tool
b693e80
fix openSSL download URL
a865876
handle absent command line parameter in build.py
fb1c49a
pin pygame to tagged version, flake8 complicance
3390b95
flake8 complicance
3980e5f
please don't tell me I just fixed a bug nobody else found for half a …
9686a98
command line option to add to the assets/ directory
975162e
allow custom destination paths
6a1fdcc
Merge branch 'adding-more-assets' into develop
bd68502
code review suggestions
bcee016
Merge remote-tracking branch 'kivy/develop' into adding-more-assets
85f7789
Merge branch 'adding-more-assets' into develop
223aa27
rename pygame2 to pygame again
e5aff0c
fix bugs sleepliy introduced in commit "code review suggestions"
ab1be3f
Merge branch 'adding-more-assets' into develop
e97872e
flake8 compliance
093bfac
Merge branch 'adding-more-assets' into develop
e408078
.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||
from pythonforandroid.recipe import CompiledComponentsPythonRecipe | ||||||
from os.path import join | ||||||
from pythonforandroid.toolchain import current_directory | ||||||
|
||||||
|
||||||
class Pygame2Recipe(CompiledComponentsPythonRecipe): | ||||||
|
||||||
version = '2.0.0-dev7' | ||||||
url = 'https://github.com/pygame/pygame/archive/android-2.0.0-dev7.tar.gz' | ||||||
|
||||||
site_packages_name = 'pygame' | ||||||
name = 'pygame' | ||||||
|
||||||
depends = ['sdl2', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'setuptools', 'jpeg', 'png'] | ||||||
call_hostpython_via_targetpython = False # Due to setuptools | ||||||
install_in_hostpython = False | ||||||
|
||||||
def prebuild_arch(self, arch): | ||||||
super().prebuild_arch(arch) | ||||||
with current_directory(self.get_build_dir(arch.arch)): | ||||||
setup_template = open(join("buildconfig", "Setup.Android.SDL2.in")).read() | ||||||
env = self.get_recipe_env(arch) | ||||||
env['ANDROID_ROOT'] = join(self.ctx.ndk_platform, 'usr') | ||||||
|
||||||
ndk_lib_dir = join(self.ctx.ndk_platform, 'usr', 'lib') | ||||||
|
||||||
png = self.get_recipe('png', self.ctx) | ||||||
png_lib_dir = join(png.get_build_dir(arch.arch), '.libs') | ||||||
png_inc_dir = png.get_build_dir(arch) | ||||||
|
||||||
jpeg = self.get_recipe('jpeg', self.ctx) | ||||||
jpeg_inc_dir = jpeg_lib_dir = jpeg.get_build_dir(arch.arch) | ||||||
|
||||||
setup_file = setup_template.format( | ||||||
sdl_includes=( | ||||||
" -I" + join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include') + | ||||||
" -L" + join(self.ctx.bootstrap.build_dir, "libs", str(arch)) + | ||||||
" -L" + png_lib_dir + " -L" + jpeg_lib_dir + " -L" + ndk_lib_dir), | ||||||
sdl_ttf_includes="-I"+join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf'), | ||||||
sdl_image_includes="-I"+join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_image'), | ||||||
sdl_mixer_includes="-I"+join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer'), | ||||||
jpeg_includes="-I"+jpeg_inc_dir, | ||||||
png_includes="-I"+png_inc_dir, | ||||||
freetype_includes="" | ||||||
) | ||||||
open("Setup", "w").write(setup_file) | ||||||
|
||||||
def get_recipe_env(self, arch): | ||||||
env = super(Pygame2Recipe, self).get_recipe_env(arch) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpicking
Suggested change
|
||||||
env['USE_SDL2'] = '1' | ||||||
env["PYGAME_CROSS_COMPILE"] = "TRUE" | ||||||
env["PYGAME_ANDROID"] = "TRUE" | ||||||
return env | ||||||
|
||||||
|
||||||
recipe = Pygame2Recipe() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually the version should be configurable