Skip to content

Commit a184a16

Browse files
committed
Add patches
1 parent bf10a90 commit a184a16

4 files changed

Lines changed: 52 additions & 1 deletion

File tree

pythonforandroid/recipes/av/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class PyAVRecipe(PyProjectRecipe):
77
name = "av"
88
version = "17.0.0"
99
url = "https://github.com/PyAV-Org/PyAV/archive/v{version}.zip"
10+
patches = ["libs.patch"]
1011
depends = ["python3", "ffmpeg", "av_codecs", "openssl"]
1112
hostpython_prerequisites = ["cython>=3.1.0"]
1213

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff '--color=auto' -uNr PyAV-17.0.0/setup.py PyAV-17.0.0.mod/setup.py
2+
--- PyAV-17.0.0/setup.py 2026-03-14 19:42:41.000000000 +0530
3+
+++ PyAV-17.0.0.mod/setup.py 2026-05-22 08:21:47.438004827 +0530
4+
@@ -79,20 +79,21 @@
5+
"""
6+
Get distutils-compatible extension arguments using pkg-config.
7+
"""
8+
- pkg_config = os.environ.get("PKG_CONFIG", "pkg-config")
9+
- try:
10+
- raw_cflags = subprocess.check_output(
11+
- [pkg_config, "--cflags", "--libs"]
12+
- + ["lib" + name for name in FFMPEG_LIBRARIES]
13+
- )
14+
- except FileNotFoundError:
15+
- print(f"{pkg_config} is required for building PyAV")
16+
- exit(1)
17+
- except subprocess.CalledProcessError:
18+
- print(f"{pkg_config} could not find libraries {FFMPEG_LIBRARIES}")
19+
- exit(1)
20+
+ # pkg_config = os.environ.get("PKG_CONFIG", "pkg-config")
21+
+ # try:
22+
+ # raw_cflags = subprocess.check_output(
23+
+ # [pkg_config, "--cflags", "--libs"]
24+
+ # + ["lib" + name for name in FFMPEG_LIBRARIES]
25+
+ # )
26+
+ # except FileNotFoundError:
27+
+ # print(f"{pkg_config} is required for building PyAV")
28+
+ # exit(1)
29+
+ # except subprocess.CalledProcessError:
30+
+ # print(f"{pkg_config} could not find libraries {FFMPEG_LIBRARIES}")
31+
+ # exit(1)
32+
33+
- known, unknown = parse_cflags(raw_cflags.decode("utf-8"))
34+
+ raw_cflags = "-lavdevice -lavfilter -lavformat -lavcodec -lswscale -lswresample -lavutil"
35+
+ known, unknown = parse_cflags(raw_cflags)
36+
if unknown:
37+
print("pkg-config returned flags we don't understand: {}".format(unknown))
38+
if "-pthread" in unknown:

pythonforandroid/recipes/libshine/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class LibShineRecipe(Recipe):
1010
version = 'c72aba9031bde18a0995e7c01c9b53f2e08a0e46'
1111
url = 'https://github.com/toots/shine/archive/{version}.zip'
12-
12+
patches = ["fixbuild.patch"]
1313
built_libraries = {'libshine.so': 'lib'}
1414

1515
def get_recipe_env(self, arch=None, with_flags_in_cc=True):
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff '--color=auto' -uNr shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46/src/lib/l3mdct.h shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46.mod/src/lib/l3mdct.h
2+
--- shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46/src/lib/l3mdct.h 2017-08-01 19:14:17.000000000 +0530
3+
+++ shine-c72aba9031bde18a0995e7c01c9b53f2e08a0e46.mod/src/lib/l3mdct.h 2026-05-22 08:30:59.625697302 +0530
4+
@@ -1,7 +1,7 @@
5+
#ifndef shine_MDCT_H
6+
#define shine_MDCT_H
7+
8+
-void shine_mdct_initialise();
9+
+void shine_mdct_initialise(shine_global_config *config);
10+
void shine_mdct_sub(shine_global_config *config, int stride);
11+
12+
#endif

0 commit comments

Comments
 (0)