-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix matplotlib
and update to v3.1.3
#2076
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5552fdc
[recipes] Fix `matplotlib` and update to `v3.1.3`
opacam 489b7e9
[recipes] Fix misspelled word
opacam fef4a03
[recipes] Remove unneeded changes from the patch
opacam d47c04d
[recipes] Fix typo
opacam 484181f
[CI] Remove `matplotlib` from broken recipes
opacam 32e6ccb
[recipes] Set library version dynamically for `*.pc.template`
opacam 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 hidden or 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
10 changes: 10 additions & 0 deletions
10
pythonforandroid/recipes/matplotlib/libfreetype.pc.template
This file contains hidden or 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,10 @@ | ||
prefix=path_to_built | ||
exec_prefix=${prefix} | ||
includedir=${prefix}/include | ||
libdir=${exec_prefix}/objs/.libs | ||
|
||
Name: freetype2 | ||
Description: The freetype2 library | ||
Version: 2.5.5 | ||
Cflags: -I${includedir} | ||
Libs: -L${libdir} -lfreetype |
This file contains hidden or 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,10 @@ | ||
prefix=path_to_built | ||
exec_prefix=${prefix} | ||
includedir=${prefix} | ||
libdir=${exec_prefix}/.libs | ||
|
||
Name: libpng | ||
Description: The png library | ||
Version: 1.6.37 | ||
Cflags: -I${includedir} | ||
Libs: -L${libdir} -lpng16 |
71 changes: 53 additions & 18 deletions
71
pythonforandroid/recipes/matplotlib/mpl_android_fixes.patch
This file contains hidden or 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 |
---|---|---|
@@ -1,29 +1,64 @@ | ||
diff --git a/setupext.py b/setupext.py | ||
index fc82d5d..2067db0 100644 | ||
--- a/setupext.py | ||
+++ b/setupext.py | ||
@@ -1004,10 +1004,10 @@ class Numpy(SetupPackage): | ||
ext.define_macros.append(('__STDC_FORMAT_MACROS', 1)) | ||
|
||
--- matplotlib-3.1.1/setupext.py.orig 2019-12-31 01:25:00.000000000 +0100 | ||
+++ matplotlib-3.1.1/setupext.py 2020-01-04 15:30:50.453260814 +0100 | ||
@@ -604,8 +604,7 @@ class Numpy(SetupPackage): | ||
name = "numpy" | ||
|
||
def add_flags(self, ext): | ||
- import numpy as np | ||
- ext.include_dirs.append(np.get_include()) | ||
+ ext.include_dirs.append(os.environ['NUMPY_INCLUDES']) | ||
ext.define_macros.extend([ | ||
# Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each | ||
# extension. | ||
@@ -617,10 +616,10 @@ class Numpy(SetupPackage): | ||
]) | ||
|
||
def get_setup_requires(self): | ||
- return ['numpy>=1.10.0'] | ||
+ return ['numpy==1.16.4'] # to match p4a's target version | ||
|
||
- return ['numpy>=1.11'] | ||
+ return [] # don't need it for p4a, due to above changes | ||
def get_install_requires(self): | ||
- return ['numpy>=1.10.0'] | ||
- return ['numpy>=1.11'] | ||
+ return ['numpy==1.16.4'] # to match p4a's target version | ||
|
||
|
||
class LibAgg(SetupPackage): | ||
@@ -1443,9 +1443,10 @@ class BackendAgg(OptionalBackendPackage): | ||
|
||
@@ -674,7 +673,7 @@ class FreeType(SetupPackage): | ||
if sys.platform == 'win32': | ||
libfreetype = 'libfreetype.lib' | ||
else: | ||
- libfreetype = 'libfreetype.a' | ||
+ libfreetype = 'libfreetype.so' | ||
ext.extra_objects.insert( | ||
0, os.path.join(src_path, 'objs', '.libs', libfreetype)) | ||
ext.define_macros.append(('FREETYPE_BUILD_TYPE', 'local')) | ||
@@ -701,7 +700,7 @@ class FreeType(SetupPackage): | ||
if sys.platform == 'win32': | ||
libfreetype = 'libfreetype.lib' | ||
else: | ||
- libfreetype = 'libfreetype.a' | ||
+ libfreetype = 'libfreetype.so' | ||
|
||
# bailing because it is already built | ||
if os.path.isfile(os.path.join( | ||
@@ -830,7 +829,7 @@ class Png(SetupPackage): | ||
ext, 'libpng', | ||
atleast_version='1.2', | ||
alt_exec=['libpng-config', '--ldflags'], | ||
- default_libraries=['png', 'z']) | ||
+ default_libraries=['png16', 'z']) # adapted to p4a's png library | ||
Numpy().add_flags(ext) | ||
return ext | ||
|
||
@@ -957,9 +956,10 @@ class BackendAgg(OptionalBackendPackage) | ||
|
||
class BackendTkAgg(OptionalBackendPackage): | ||
name = "tkagg" | ||
- force = True | ||
+ force = False | ||
|
||
def check(self): | ||
+ raise CheckFailed("Disabled by patching during Android build") # tk doesn't work on Android but causes build problems | ||
return "installing; run-time loading from Python Tcl / Tk" | ||
|
||
return "installing; run-time loading from Python Tcl/Tk" | ||
def get_extension(self): |
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.
I have some doubts with this line. Does it really have to be hard pinned to the current default p4a numpy version?
And if it does, should we at some point try to pick this up dynamically?
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.
I'm not sure, I'm doing a local test...we will see
I think so, but it will add more complexity to the recipe...
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.
Yes I was also thinking about the complexity. I think we can address that later if needed.
You have my ✔️ feel free to merge if it builds 💚