Skip to content

Instantly share code, notes, and snippets.

@AbigailBuccaneer
Last active January 25, 2016 14:38
Show Gist options
  • Save AbigailBuccaneer/54fe0d2d2ea11bc60162 to your computer and use it in GitHub Desktop.
Save AbigailBuccaneer/54fe0d2d2ea11bc60162 to your computer and use it in GitHub Desktop.

Revisions

  1. AbigailBuccaneer revised this gist Jan 25, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion SConscript
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ def build_protoc(root_dir):
    'libprotobuf.so.6.0.0',
    'libprotoc.so.6',
    'libprotoc.so.6.0.0']
    targets = [env['protoc']] + [File(x) for x in PathsIn(os.path.join(root_dir, 'usr', 'lib'), lib_targets)]
    targets = [env['protoc']] + [File(os.path.join('usr', 'lib', x)) for x in lib_targets]
    env['protoc_depends'] = targets

    env.Command(targets,
  2. AbigailBuccaneer created this gist Jan 25, 2016.
    30 changes: 30 additions & 0 deletions SConscript
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    def glob_recursive(path, pattern, exclude=None):
    import SCons.Node.FS
    globbed = Dir(path).glob(pattern, exclude=exclude)
    sources = []
    for source in globbed:
    if isinstance(source, SCons.Node.FS.Dir):
    childpath = os.path.join(path, os.path.basename(source.path))
    sources += glob_recursive(childpath, pattern, exclude=exclude)
    else:
    sources += [source]
    return sources


    def build_protoc(root_dir):
    import os
    sources = glob_recursive(root_dir, '*', exclude=['*.cache', 'usr', '*.o', '*.lo'])
    env['protoc'] = File(os.path.join(root_dir, 'usr', 'bin', 'protoc'))
    lib_targets = [
    'libprotobuf.so.6',
    'libprotobuf.so.6.0.0',
    'libprotoc.so.6',
    'libprotoc.so.6.0.0']
    targets = [env['protoc']] + [File(x) for x in PathsIn(os.path.join(root_dir, 'usr', 'lib'), lib_targets)]
    env['protoc_depends'] = targets

    env.Command(targets,
    sources,
    "./autogen.sh && ./configure --prefix='%s' && make && make install" %
    Dir(os.path.join(root_dir, 'usr')).abspath,
    chdir=Dir(root_dir).abspath)