Skip to content

Commit 09f3b2d

Browse files
obfuskgermn
authored andcommitted
add recipe for libpcre (kivy#2276)
* add recipe for libpcre * fix flake8 errors
1 parent 476a18a commit 09f3b2d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from pythonforandroid.recipe import Recipe
2+
from pythonforandroid.util import current_directory
3+
from pythonforandroid.logger import shprint
4+
import sh
5+
from multiprocessing import cpu_count
6+
from os.path import join
7+
8+
9+
class LibpcreRecipe(Recipe):
10+
version = '8.44'
11+
url = 'https://ftp.pcre.org/pub/pcre/pcre-{version}.tar.bz2'
12+
13+
built_libraries = {'libpcre.so': '.libs'}
14+
15+
def build_arch(self, arch):
16+
env = self.get_recipe_env(arch)
17+
18+
with current_directory(self.get_build_dir(arch.arch)):
19+
shprint(
20+
sh.Command('./configure'),
21+
*'''--host=arm-linux-androideabi
22+
--disable-cpp --enable-jit --enable-utf8
23+
--enable-unicode-properties'''.split(),
24+
_env=env)
25+
shprint(sh.make, '-j', str(cpu_count()), _env=env)
26+
27+
def get_lib_dir(self, arch):
28+
return join(self.get_build_dir(arch), '.libs')
29+
30+
31+
recipe = LibpcreRecipe()

0 commit comments

Comments
 (0)