mirror of
https://github.com/markqvist/Sideband.git
synced 2025-08-02 03:26:25 -04:00
Updated recipe
This commit is contained in:
parent
43944b74cd
commit
eed3efe66a
2 changed files with 79 additions and 10 deletions
|
@ -1,3 +1,4 @@
|
|||
from os.path import join
|
||||
from pythonforandroid.recipe import Recipe
|
||||
from pythonforandroid.toolchain import current_directory, shprint
|
||||
import sh
|
||||
|
@ -7,12 +8,27 @@ import sh
|
|||
|
||||
class Codec2Recipe(Recipe):
|
||||
url = "https://github.com/markqvist/codec2/archive/00e01c9d72d3b1607e165c71c4c9c942d277dfac.tar.gz"
|
||||
built_libraries = {'libcodec2.so': 'build_linux/src'}
|
||||
built_libraries = {'libcodec2.so': 'build_android/src'}
|
||||
|
||||
def include_flags(self, arch):
|
||||
'''Returns a string with the include folders'''
|
||||
codec2_includes = join(self.get_build_dir(arch.arch), 'build_android')
|
||||
return (' -I' + codec2_includes)
|
||||
|
||||
def link_dirs_flags(self, arch):
|
||||
'''Returns a string with the appropriate `-L<lib directory>` to link
|
||||
with the libs. This string is usually added to the environment
|
||||
variable `LDFLAGS`'''
|
||||
return ' -L' + self.get_build_dir(arch.arch)
|
||||
|
||||
# def link_libs_flags(self):
|
||||
# '''Returns a string with the appropriate `-l<lib>` flags to link with
|
||||
# the libs. This string is usually added to the environment
|
||||
# variable `LIBS`'''
|
||||
# return ' -lcodec2{version} -lssl{version}'.format(version=self.version)
|
||||
|
||||
def build_arch(self, arch):
|
||||
with current_directory(self.get_build_dir(arch.arch)):
|
||||
from rich.pretty import pprint
|
||||
import time
|
||||
env = self.get_recipe_env(arch)
|
||||
flags = [
|
||||
"..",
|
||||
|
@ -20,17 +36,14 @@ class Codec2Recipe(Recipe):
|
|||
"--fresh",
|
||||
"-DCMAKE_BUILD_TYPE=Release",
|
||||
]
|
||||
mkdir = sh.mkdir("-p", "build_linux")
|
||||
cd = sh.cd("build_linux")
|
||||
cmake = sh.Command('cmake')
|
||||
|
||||
pprint(arch.command_prefix)
|
||||
pprint(env)
|
||||
pprint(flags)
|
||||
time.sleep(6)
|
||||
mkdir = sh.mkdir("-p", "build_android")
|
||||
cd = sh.cd("build_android")
|
||||
cmake = sh.Command('cmake')
|
||||
|
||||
shprint(cmake, *flags, _env=env)
|
||||
shprint(sh.make, _env=env)
|
||||
sh.cp("../src/codec2.h", "./codec2/")
|
||||
|
||||
|
||||
recipe = Codec2Recipe()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue