@@ -15,7 +15,7 @@ class OpenCVRecipe(NDKRecipe):
15
15
build of most of the libraries of the opencv's package, so we can
16
16
process images, videos, objects, photos...
17
17
'''
18
- version = '4.5.1 '
18
+ version = '4.12.0 '
19
19
url = 'https://github.com/opencv/opencv/archive/{version}.zip'
20
20
depends = ['numpy' ]
21
21
patches = ['patches/p4a_build.patch' ]
@@ -68,8 +68,9 @@ def build_arch(self, arch):
68
68
python_link_version = self .ctx .python_recipe .link_version
69
69
python_library = join (python_link_root ,
70
70
'libpython{}.so' .format (python_link_version ))
71
- python_include_numpy = join (python_site_packages ,
72
- 'numpy' , 'core' , 'include' )
71
+ python_include_numpy = join (
72
+ self .ctx .get_python_install_dir (arch .arch ), "numpy/_core/include" ,
73
+ )
73
74
74
75
shprint (sh .cmake ,
75
76
'-DP4A=ON' ,
@@ -136,7 +137,19 @@ def build_arch(self, arch):
136
137
137
138
self .get_build_dir (arch .arch ),
138
139
_env = env )
139
- shprint (sh .make , '-j' + str (cpu_count ()), 'opencv_python' + python_major )
140
+
141
+ try :
142
+ shprint (sh .make , '-j' + str (cpu_count ()), 'VERBOSE=1' , 'opencv_python' + python_major )
143
+ except Exception :
144
+ # Patch link.txt and retry
145
+ link_txt = 'modules/python3/CMakeFiles/opencv_python3.dir/link.txt'
146
+ with open (link_txt , 'r+' ) as f :
147
+ content = f .read ().replace ('-version' , '--version' )
148
+ f .seek (0 )
149
+ f .write (content )
150
+ f .truncate ()
151
+ shprint (sh .make , '-j' + str (cpu_count ()), 'opencv_python' + python_major )
152
+
140
153
# Install python bindings (cv2.so)
141
154
shprint (sh .cmake , '-DCOMPONENT=python' , '-P' , './cmake_install.cmake' )
142
155
# Copy third party shared libs that we need in our final apk
0 commit comments