Permalink
Browse files

Merge pull request #2 from steinwurf/use-new-waf

Use new waf
  • Loading branch information...
petya2164 committed Apr 7, 2017
2 parents 208ca22 + d8d6d45 commit b6aeaa97b1f225d8151baca2dd1b0ad8ece4264f
Showing with 68 additions and 87 deletions.
  1. +7 −3 .gitignore
  2. +4 −0 NEWS.rst
  3. +4 −4 buildbot.py
  4. +5 −20 config.py
  5. +31 −0 resolve.json
  6. +4 −2 src/petro_python/petro.cpp
  7. +10 −10 waf
  8. +3 −48 wscript
View
@@ -17,13 +17,15 @@
# Compiled Doxygen documentation
/doxygen/html
# For projects that use Waf for building: http://code.google.com/p/waf/
# Waf files
waf-*
waf3-*
.waf-*
.waf3-*
.lock-*
build
bundle_dependencies
resolve_symlinks
resolved_dependencies
# Gnu Global tag files
GPATH
@@ -38,10 +40,11 @@ GTAGS
#Eclipse ignore
.cproject
.project
*.project
.metadata
local.properties
.classpath
.settings/
# Visual Studio ignore
*.bat
@@ -52,4 +55,5 @@ local.properties
*.sdf
*.opensdf
*.log
*.vcxproj*
VSProjects
View
@@ -7,6 +7,10 @@ every change, see the Git log.
Latest
------
* tbd
* Major: Upgrade to waf-tools 4
* Major: Upgrade to boost 3
* Major: Upgrade to petro 7
* Minor: Upgrade to gtest 4
1.0.0
-----
View
@@ -33,13 +33,13 @@ def configure(properties):
if properties.get('build_distclean'):
command += ['distclean']
command += ['configure', '--git-protocol=git@']
command += ['configure', '--git_protocol=git@']
if 'waf_bundle_path' in properties:
command += ['--bundle-path=' + properties['waf_bundle_path']]
if 'waf_resolve_path' in properties:
command += ['--resolve_path=' + properties['waf_resolve_path']]
if 'dependency_project' in properties:
command += ['--{0}-use-checkout={1}'.format(
command += ['--{0}_checkout={1}'.format(
properties['dependency_project'],
properties['dependency_checkout'])]
View
@@ -13,31 +13,16 @@
project_dependencies = \
[
'waf-tools',
'boost',
'gtest',
'petro',
]
# Importing a dynamically generated module
# Python recipe from http://code.activestate.com/recipes/82234
def importCode(code, name, add_to_sys_modules=0):
"""
Import dynamically generated code as a module. code is the
object containing the code (a string, a file handle or an
actual compiled code object, same types as accepted by an
exec statement). The name is the name to give to the module,
and the final argument says wheter to add it to sys.modules
or not. If it is added, a subsequent import statement using
name will return this module. If it is not added to sys.modules
import will try to load it in the normal fashion.
import foo
is equivalent to
foofile = open("/path/to/foo.py")
foo = importCode(foofile,"foo",1)
Returns a newly generated module.
Import dynamically generated code as a module.
Python recipe from http://code.activestate.com/recipes/82234
"""
import imp
@@ -71,7 +56,7 @@ def importCode(code, name, add_to_sys_modules=0):
# Import the code string as a module
mod = importCode(code, "config_helper")
# Run the actual config tool from the dynamic module
mod.config_tool(project_dependencies)
mod.config_tool(project_dependencies, project_name)
except:
print("Unexpected error:")
print(traceback.format_exc())
View
@@ -0,0 +1,31 @@
[
{
"name": "waf-tools",
"resolver": "git",
"method": "semver",
"major": 4,
"sources": ["github.com/steinwurf/waf-tools.git"]
},
{
"name": "boost",
"resolver": "git",
"method": "semver",
"major": 3,
"sources": ["github.com/steinwurf/boost.git"]
},
{
"name": "petro",
"resolver": "git",
"method": "semver",
"major": 7,
"sources": ["github.com/steinwurf/petro.git"]
},
{
"name": "gtest",
"internal": true,
"resolver": "git",
"method": "semver",
"major": 4,
"sources": ["github.com/steinwurf/gtest.git"]
}
]
@@ -4,8 +4,10 @@
// Distributed under the "BSD License". See the accompanying LICENSE.rst file.
#include <boost/python.hpp>
#include <boost/python/docstring_options.hpp>
#include <boost/python/args.hpp>
#include <cstdint>
#include <string>
#include <vector>
#include <petro/extractor/aac_sample_extractor.hpp>
#include <petro/extractor/avc_sample_extractor.hpp>
View
20 waf

Large diffs are not rendered by default.

Oops, something went wrong.
View
51 wscript
@@ -2,63 +2,23 @@
# encoding: utf-8
import os
import waflib.extras.wurf_options
from waflib.TaskGen import feature, after_method
APPNAME = 'petro-python'
VERSION = '1.0.0'
def options(opt):
opt.load('wurf_common_tools')
opt.load('python')
def resolve(ctx):
import waflib.extras.wurf_dependency_resolve as resolve
ctx.load('wurf_common_tools')
ctx.add_dependency(resolve.ResolveVersion(
name='waf-tools',
git_repository='github.com/steinwurf/waf-tools.git',
major=3))
ctx.add_dependency(resolve.ResolveVersion(
name='boost',
git_repository='github.com/steinwurf/boost.git',
major=2))
ctx.add_dependency(resolve.ResolveVersion(
name='petro',
git_repository='github.com/steinwurf/petro.git',
major=6))
# Internal dependencies
if ctx.is_toplevel():
ctx.add_dependency(resolve.ResolveVersion(
name='gtest',
git_repository='github.com/steinwurf/gtest.git',
major=3))
def configure(conf):
conf.load("wurf_common_tools")
def build(bld):
# Ensure that Python was configured properly in the configure step of
# the boost wscript (boost-python needs to be configured in the boost repo)
if not bld.env['BUILD_PYTHON']:
bld.fatal('Python was not configured properly')
bld.load("wurf_common_tools")
bld.env.append_unique(
'DEFINES_STEINWURF_VERSION',
'STEINWURF_PETRO_PYTHON_VERSION="{}"'.format(
@@ -81,14 +41,9 @@ def build(bld):
bld.recurse('src/petro_python')
@feature('pyext')
@after_method('apply_link')
def test_kodo_python(self):
# Only execute the tests within the current project
if self.path.is_child_of(self.bld.srcnode):
if self.bld.has_tool_option('run_tests'):
self.bld.add_post_fun(exec_test_python)
if bld.is_toplevel():
if bld.has_tool_option('run_tests'):
bld.add_post_fun(exec_test_python)
def exec_test_python(bld):

0 comments on commit b6aeaa9

Please sign in to comment.