Skip to content

Commit

Permalink
rpi: WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
superdump committed Dec 4, 2015
1 parent ec545d4 commit 3acb710
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cerbero/bootstrap/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def start(self):

class DebianBootstrapper (UnixBootstrapper):

tool = 'sudo apt-get install %s'
tool = 'sudo apt-get install -y %s'
packages = ['autotools-dev', 'automake', 'autoconf', 'libtool', 'g++',
'autopoint', 'make', 'cmake', 'bison', 'flex', 'yasm',
'pkg-config', 'gtk-doc-tools', 'libxv-dev', 'libx11-dev',
Expand Down
3 changes: 2 additions & 1 deletion cerbero/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ class Architecture:
UNIVERSAL = 'universal'
ARM = 'arm'
ARMv7 = 'armv7'
ARMv7L = 'armv7l'
ARMv7S = 'armv7s'
ARM64 = 'arm64'

@staticmethod
def is_arm(arch):
return arch in [Architecture.ARM, Architecture.ARMv7,
Architecture.ARMv7S]
Architecture.ARMv7L,Architecture.ARMv7S]


class Distro:
Expand Down
9 changes: 7 additions & 2 deletions cerbero/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def system_info():
arch = Architecture.X86_64
elif arch.endswith('86'):
arch = Architecture.X86
elif arch == 'armv7l':
arch = Architecture.ARMv7L
else:
raise FatalError(_("Architecture %s not supported") % arch)

Expand Down Expand Up @@ -320,8 +322,11 @@ def add_system_libs(config, new_env):

search_paths = [os.environ['PKG_CONFIG_LIBDIR'],
os.path.join(sysroot, 'usr', libdir, 'pkgconfig'),
os.path.join(sysroot, 'usr/share/pkgconfig'),
os.path.join(sysroot, 'usr/lib/%s-linux-gnu/pkgconfig' % arch)]
os.path.join(sysroot, 'usr/share/pkgconfig')]
if arch == Architecture.ARMv7L:
search_paths += [os.path.join(sysroot, 'usr/lib/arm-linux-gnueabihf/pkgconfig')]
else:
search_paths += [os.path.join(sysroot, 'usr/lib/%s-linux-gnu/pkgconfig' % arch)]
new_env['PKG_CONFIG_PATH'] = ':'.join(search_paths)

search_paths = [os.environ.get('ACLOCAL_PATH', ''),
Expand Down
4 changes: 2 additions & 2 deletions config/linux.cbc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ packager = 'OpenWebRTC <packages@openwebrtc.org>'
prefix = "/opt/openwebrtc-0.3"

# Uncomment to allow parallel builds
# allow_parallel_build = True
allow_parallel_build = True

# Uncomment this to allow cross-building for another architecture
# target_arch = Architecture.X86_64
target_arch = Architecture.ARMv7L
13 changes: 9 additions & 4 deletions config/linux.config
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ if target_arch == Architecture.X86:
elif target_arch == Architecture.X86_64:
arch_flags += ' -m64 '
_host = 'x86_64-linux-gnu'
if target_arch in [Architecture.ARM, Architecture.ARMv7]:
if target_arch == Architecture.ARMv7:
if target_arch in [Architecture.ARM, Architecture.ARMv7, Architecture.ARMv7L]:
if target_arch == Architecture.ARMv7 or target_arch == Architecture.ARMv7L:
arch_flags += ' -march=armv7-a '
_host = 'arm-linux-gnueabi'
if target_arch == Architecture.ARMv7L:
# arch_flags += ' -mfpu=neon-vfpv4 -mfloat-abi=hard '
arch_flags += ' -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard '
_host = 'arm-linux-gnueabihf'
else:
_host = 'arm-linux-gnueabi'
os.environ['glib_cv_stack_grows'] = 'no'
os.environ['glib_cv_uscore'] = 'no'
os.environ['ac_cv_func_posix_getgrgid_r'] = 'yes'
Expand Down Expand Up @@ -73,7 +78,7 @@ if sysroot is not None:
os.environ['LDFLAGS'] += ' --sysroot=%s' % (sysroot)

# Some cross compilers have a bug in the search for indirect dependencies
# during linking.
# during linking.
# http://stackoverflow.com/questions/16593519/finding-shared-library-dependencies-when-linking-executable
workaround_cflags = ''
if target_arch != arch:
Expand Down
2 changes: 2 additions & 0 deletions recipes/gnustl.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Recipe(recipe.Recipe):
stl_libdir = os.path.join(stl_prefix, 'libs', 'x86')
elif self.config.target_arch == Architecture.X86_64:
stl_libdir = os.path.join(stl_prefix, 'libs', 'x86_64')
elif self.config.target_arch == Architecture.ARMv7L:
stl_libdir = os.path.join(stl_prefix, 'libs', 'armeabi-v7a')
elif self.config.target_arch == Architecture.ARMv7:
stl_libdir = os.path.join(stl_prefix, 'libs', 'armeabi-v7a')
elif self.config.target_arch == Architecture.ARM64:
Expand Down
7 changes: 7 additions & 0 deletions recipes/gst-plugins-good-1.0-static.recipe
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

from cerbero.build.build import modify_environment

class Recipe(custom.GStreamerStatic):
name = 'gst-plugins-good-1.0-static'
Expand Down Expand Up @@ -74,3 +75,9 @@ class Recipe(custom.GStreamerStatic):
self.append_env['CFLAGS'] += ' -DGST_LEVEL_MAX=GST_LEVEL_FIXME'

custom.GStreamerStatic.prepare(self)

@modify_environment
def configure(self):
for key in os.environ:
print "%s=%s" % (key, os.environ[key])
super(recipe.Recipe, self).configure()
7 changes: 7 additions & 0 deletions recipes/gst-plugins-good-1.0.recipe
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

from cerbero.build.build import modify_environment

class Recipe(recipe.Recipe):
name = 'gst-plugins-good-1.0'
Expand Down Expand Up @@ -75,3 +76,9 @@ class Recipe(recipe.Recipe):

if self.config.variants.nodebug:
self.append_env['CFLAGS'] += ' -DGST_LEVEL_MAX=GST_LEVEL_FIXME'

@modify_environment
def configure(self):
for key in os.environ:
print "%s=%s" % (key, os.environ[key])
super(recipe.Recipe, self).configure()
17 changes: 17 additions & 0 deletions recipes/gst-rpicamsrc.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python

class Recipe(recipe.Recipe):
name = 'gst-rpicamsrc'
version = ''
stype = SourceType.GIT
remotes = { 'origin': 'https://github.com/thaytan/gst-rpicamsrc' }
commit = 'origin/master'
licenses = [License.LGPLv2_1Plus]
config_sh = 'sh ./autogen.sh --noconfigure && ./configure'
configure_options = '--enable-static --enable-shared --disable-introspection --disable-gtk-doc'
deps = ['gstreamer-1.0', 'gst-plugins-base-1.0']
use_system_libs = True

files_capture = [
'lib/gstreamer-1.0/libgstrpicamsrc%(mext)s',
]
6 changes: 4 additions & 2 deletions recipes/javascriptcoregtk.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class Recipe(recipe.Recipe):
' ' + gnustl_includes
self.append_env['LDFLAGS'] = ' ' + gnustl_libs + ' ' + \
pthread_libs_path
if self.config.target_platform == Platform.LINUX and self.config.target_arch == Architecture.ARMv7L:
self.allow_parallel_build = False

def configure(self):
# Fix gcc version check. The old check fails with gcc-5.0 to 5.6
Expand All @@ -108,7 +110,7 @@ class Recipe(recipe.Recipe):
shell.replace(os.path.join(self.build_dir, 'Source', 'WTF', 'wtf',
'StdLibExtras.h'),
{'(COMPILER(GCC) && !COMPILER(CLANG) && !GCC_VERSION_AT_LEAST(4, 8, 1))': '0',})
# XXX: This is a hack. -pthread looks for libpthread.so, but on
# XXX: This is a hack. -pthread looks for libpthread.so, but on
# Android all that is in libc.so
os.symlink(os.path.join(self.config.toolchain_prefix, 'platforms',
'android-9', 'arch-arm', 'usr', 'lib',
Expand All @@ -130,7 +132,7 @@ class Recipe(recipe.Recipe):
'PANGO_LIBS', 'SQLITE3_CFLAGS', 'SQLITE3_LIBS',
'ac_cv_lib_jpeg_jpeg_destroy_decompress',
'ac_cv_header_png_h', 'ac_cv_lib_png_png_read_info',
'ac_cv_lib_png_png_read_info',
'ac_cv_lib_png_png_read_info',
'ac_cv_header_webp_decode_h'):
self.new_env[each] = "yes"
self.new_env['AR_FLAGS'] = 'cru'
Expand Down
2 changes: 1 addition & 1 deletion recipes/libvpx.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Recipe(recipe.Recipe):
arch = 'x86'
elif self.config.target_arch == Architecture.ARM:
arch = 'arm'
elif self.config.target_arch == Architecture.ARMv7:
elif self.config.target_arch == Architecture.ARMv7 or self.config.target_arch == Architecture.ARMv7L:
arch = 'armv7'
elif self.config.target_arch == Architecture.ARMv7S:
arch = 'armv7s'
Expand Down
4 changes: 4 additions & 0 deletions recipes/openssl.recipe
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ class Recipe(recipe.Recipe):
self.openssl_platform = 'darwin-i386-cc'
elif self.config.target_arch == Architecture.X86_64:
self.openssl_platform = 'darwin64-x86_64-cc'
elif self.config.target_arch == Architecture.ARMv7L:
self.openssl_platform = ''
else:
raise NotImplementedError
elif self.config.target_platform == Platform.LINUX:
if self.config.target_arch == Architecture.X86:
self.openssl_platform = 'linux-elf'
elif self.config.target_arch == Architecture.X86_64:
self.openssl_platform = 'linux-x86_64'
elif self.config.target_arch == Architecture.ARMv7L:
self.openssl_platform = 'linux-armv4'
else:
raise NotImplementedError
elif self.config.target_platform == Platform.WINDOWS:
Expand Down

0 comments on commit 3acb710

Please sign in to comment.