def test_resolve(self): config = os.path.join(test_data_dir, 'mopack-tarball.yml') self.assertPopen(['mopack', 'resolve', config, '-Pprefix=' + self.prefix]) self.assertExists('mopack/src/hello/hello-bfg/build.bfg') self.assertExists('mopack/build/hello/') self.assertExists('mopack/logs/hello.log') self.assertExists('mopack/mopack.json') self.assertPkgConfigUsage('hello') self.check_list_files([config]) output = json.loads(slurp('mopack/mopack.json')) self.assertEqual(output['metadata'], { 'options': cfg_options( common={'deploy_paths': {'prefix': self.prefix}}, bfg9000={} ), 'packages': [ cfg_tarball_pkg( 'hello', config, path={'base': 'cfgdir', 'path': 'hello-bfg.tar.gz'}, guessed_srcdir='hello-bfg', builder=cfg_bfg9000_builder('hello') ), ], }) self.assertPopen(['mopack', 'deploy']) include_prefix = '' if platform_name() == 'windows' else 'include/' lib_prefix = '' if platform_name() == 'windows' else 'lib/' with pushd(self.prefix): self.assertExists(include_prefix + 'hello.hpp') self.assertExists(lib_prefix + 'pkgconfig/hello.pc')
def test_resolve(self): config = os.path.join(test_data_dir, 'mopack-git.yml') self.assertPopen(['mopack', 'resolve', config, '-Pprefix=' + self.prefix]) self.assertExists('mopack/src/bencodehpp/build.bfg') self.assertExists('mopack/build/bencodehpp/') self.assertExists('mopack/logs/bencodehpp.log') self.assertExists('mopack/mopack.json') self.assertPkgConfigUsage('bencodehpp') self.check_list_files([config]) output = json.loads(slurp('mopack/mopack.json')) self.assertEqual(output['metadata'], { 'options': cfg_options( common={'deploy_paths': {'prefix': self.prefix}}, bfg9000={} ), 'packages': [ cfg_git_pkg( 'bencodehpp', config, repository='https://github.com/jimporter/bencode.hpp.git', rev=['tag', 'v0.2.1'], builder=cfg_bfg9000_builder('bencodehpp'), ), ], }) self.assertPopen(['mopack', 'deploy']) include_prefix = '' if platform_name() == 'windows' else 'include/' lib_prefix = '' if platform_name() == 'windows' else 'lib/' with pushd(self.prefix): self.assertExists(include_prefix + 'bencode.hpp') self.assertExists(lib_prefix + 'pkgconfig/bencodehpp.pc')
def test_resolve(self): config = os.path.join(test_data_dir, 'mopack-outer-cmake.yml') self.assertPopen(['mopack', 'resolve', config, '-Pprefix=' + self.prefix]) self.assertExists('mopack/build/greeter/') self.assertExists('mopack/logs/greeter.log') self.assertExists('mopack/build/hello/') self.assertExists('mopack/logs/hello.log') self.assertExists('mopack/mopack.json') include_path = [os.path.join(test_data_dir, 'greeter-cmake', 'include')] library_path = [os.path.join(self.pkgbuilddir, 'greeter')] self.assertPathUsage('greeter', include_path=include_path, library_path=library_path) self.assertPkgConfigUsage('hello') output = json.loads(slurp('mopack/mopack.json')) self.assertEqual(output['metadata'], { 'options': cfg_options( common={'deploy_paths': {'prefix': self.prefix}}, bfg9000={}, cmake={} ), 'packages': [ cfg_tarball_pkg( 'hello', os.path.join(test_data_dir, 'greeter-cmake', 'mopack.yml'), path={'base': 'cfgdir', 'path': os.path.join('..', 'hello-bfg.tar.gz')}, guessed_srcdir='hello-bfg', builder=cfg_bfg9000_builder('hello'), ), cfg_directory_pkg( 'greeter', config, path={'base': 'cfgdir', 'path': 'greeter-cmake'}, builder=cfg_cmake_builder( 'greeter', usage=cfg_path_usage( include_path=[{'base': 'srcdir', 'path': 'include'}], library_path=[{'base': 'builddir', 'path': ''}], libraries=[{'type': 'guess', 'name': 'greeter'}], ) ) ), ], }) self.assertPopen(['mopack', 'deploy']) include_prefix = '' if platform_name() == 'windows' else 'include/' lib_prefix = '' if platform_name() == 'windows' else 'lib/' with pushd(self.prefix): self.assertExists('include/greeter.hpp') self.assertExists(include_prefix + 'hello.hpp') self.assertExists(lib_prefix + 'pkgconfig/hello.pc')
def test_resolve(self): config = os.path.join(test_data_dir, 'mopack-custom-builder.yml') self.assertPopen( ['mopack', 'resolve', config, '-Pprefix=' + self.prefix]) self.assertExists('mopack/src/hello/hello-bfg/build.bfg') self.assertExists('mopack/build/hello/') self.assertExists('mopack/logs/hello.log') self.assertExists('mopack/mopack.json') self.assertPkgConfigUsage('hello') output = json.loads(slurp('mopack/mopack.json')) self.assertEqual( output['metadata'], { 'options': cfg_options(common={'deploy_paths': { 'prefix': self.prefix }}), 'packages': [ cfg_tarball_pkg( 'hello', config, path={ 'base': 'cfgdir', 'path': 'hello-bfg.tar.gz' }, guessed_srcdir='hello-bfg', builder=cfg_custom_builder( 'hello', build_commands=[ [ 'bfg9000', 'configure', { 'base': 'builddir', 'path': '' }, [ '--prefix=', { 'base': 'absolute', 'path': self.prefix } ] ], [ 'cd', [{ 'base': 'builddir', 'path': '' }, '/.'] ], ['ninja'], ], deploy_commands=[ ['ninja', 'install'], ], usage=cfg_pkg_config_usage(pcfile='hello'))), ], }) self.assertPopen(['mopack', '--debug', 'deploy']) include_prefix = '' if platform_name() == 'windows' else 'include/' lib_prefix = '' if platform_name() == 'windows' else 'lib/' with pushd(self.prefix): self.assertExists(include_prefix + 'hello.hpp') self.assertExists(lib_prefix + 'pkgconfig/hello.pc')