예제 #1
0
    def ineo_install_triggers(self):
        triggers_file = join(
            self.path, 'impex', 'ineo-triggers', 'triggers.sql')
        if not os.path.isfile(triggers_file + '.in'):
            raise Exception('Can\'t find triggers file at %r' % triggers_file)

        utils.maybe_remove(triggers_file)
        self._replace_dot_in_files()
        assert os.path.isfile(triggers_file)

        self.config.ineo_db.shell(open(triggers_file, 'rb').read())
예제 #2
0
파일: build.py 프로젝트: yvc74/synthese
    def _generate_build_system(self):
        if self.config.clear_cmake_cache:
            utils.maybe_remove(join(self.env.env_path, 'CMakeCache.txt'))

        args = [self.get_cmake_tool_path('cmake'), self.env.source_path]

        # Use ccache on Linux if available
        if self.env.platform == 'lin' and utils.find_executable('ccache'):
            os.environ['CXX'] = 'ccache g++'
            os.environ['CC'] = 'ccache gcc'

        if self.env.platform == 'win':
            # TODO: This shouldn't be hardcoded.
            args.extend(['-G', 'Visual Studio 9 2008' + (' Win64' if self.env.c.x64 else '')])

        if self.with_mysql:
            args.append('-DWITH_MYSQL=1')
            if self.mysql_dir:
                os.environ['MYSQL_DIR'] = self.mysql_dir

        args.append('-DCMAKE_BUILD_TYPE=' + self.env.build_type)

        # TODO: maybe change optimization flags in debug mode:
        # -DCMAKE_CXX_FLAGS=-O0

        # Add a suffix to the install dir to allow
        # different SYNTHESE to run on the same server
        if self.env.config.prefix_with_svnrelease:
            git_info = utils.GITInfo(self.env.source_path, None)
            revision_path = '-r{0}'.format(git_info.version)
            self.config.prefix += revision_path

        if self.config.prefix:
            args.append('-DCMAKE_INSTALL_PREFIX=' + self.config.prefix)
        if self.config.mysql_params:
            args.append('-DSYNTHESE_MYSQL_PARAMS=' + self.config.mysql_params)

        args.append('-DBOOST_VERSION=' + BOOST_VER)

        env = os.environ.copy()
        if self.boost_dir:
            env['BOOST_ROOT'] = self.boost_dir
        if self.boost_lib_dir:
            env['BOOST_LIBRARYDIR'] = self.boost_lib_dir

        # Enable subdirs
        args.append('-DWITH_TEST:BOOL=ON')
        if self.config.do_not_build_python:
            args.append('-DWITH_PACKAGES:BOOL=OFF')
            args.append('-DWITH_PROJECTS:BOOL=OFF')
            args.append('-DWITH_TOOLS:BOOL=OFF')
            args.append('-DWITH_UTILS:BOOL=OFF')
        else:
            args.append('-DWITH_PACKAGES:BOOL=ON')
            args.append('-DWITH_PROJECTS:BOOL=ON')
            args.append('-DWITH_TOOLS:BOOL=ON')
            args.append('-DWITH_UTILS:BOOL=ON')

        # TODO: check that Python Cygwin is not in the path?

        if not os.path.isdir(self.env.env_path):
            os.makedirs(self.env.env_path)
        utils.call(args, cwd=self.env.env_path, env=env)

        # Hack to disable incremental build on XP (it fails with:
        # LINK : fatal error LNK1210: exceeded internal ILK size limit; link with /INCREMENTAL:NO)
        # I didn't find a way to to this in CMakeLists.txt
        # (http://www.cmake.org/pipermail/cmake/2010-February/035174.html didn't work)
        if self.env.platform == 'win' and platform.release() == 'XP':
            cmake_cache = join(self.env.env_path, 'CMakeCache.txt')
            cache_content = open(cmake_cache).read()
            cache_content = cache_content.replace(
                'INCREMENTAL:YES', 'INCREMENTAL:NO')
            open(cmake_cache, 'wb').write(cache_content)
예제 #3
0
파일: build.py 프로젝트: Tisseo/synthese
    def _generate_build_system(self):
        if self.config.clear_cmake_cache:
            utils.maybe_remove(join(self.env.env_path, "CMakeCache.txt"))

        args = [self.get_cmake_tool_path("cmake"), self.env.source_path]

        # Use ccache on Linux if available
        if self.env.platform == "lin" and utils.find_executable("ccache"):
            os.environ["CXX"] = "ccache g++"
            os.environ["CC"] = "ccache gcc"

        if self.env.platform == "win":
            # TODO: This shouldn't be hardcoded.
            args.extend(["-G", "Visual Studio 9 2008" + (" Win64" if self.env.c.x64 else "")])

        if self.with_mysql:
            args.append("-DWITH_MYSQL=1")
            if self.mysql_dir:
                os.environ["MYSQL_DIR"] = self.mysql_dir

        args.append("-DCMAKE_BUILD_TYPE=" + self.env.build_type)

        # TODO: maybe change optimization flags in debug mode:
        # -DCMAKE_CXX_FLAGS=-O0

        # Add a suffix to the install dir to allow
        # different SYNTHESE to run on the same server
        if self.env.config.prefix_with_svnrelease:
            svn_info = utils.SVNInfo(self.env.source_path)
            revision_path = "-r{0}".format(svn_info.version)
            self.config.prefix += revision_path

        if self.config.prefix:
            args.append("-DCMAKE_INSTALL_PREFIX=" + self.config.prefix)
        if self.config.mysql_params:
            args.append("-DSYNTHESE_MYSQL_PARAMS=" + self.config.mysql_params)

        args.append("-DBOOST_VERSION=" + BOOST_VER)

        env = os.environ.copy()
        if self.boost_dir:
            env["BOOST_ROOT"] = self.boost_dir
        if self.boost_lib_dir:
            env["BOOST_LIBRARYDIR"] = self.boost_lib_dir

        # Enable subdirs
        args.append("-DWITH_TEST:BOOL=ON")
        if self.config.do_not_build_python:
            args.append("-DWITH_PACKAGES:BOOL=OFF")
            args.append("-DWITH_PROJECTS:BOOL=OFF")
            args.append("-DWITH_TOOLS:BOOL=OFF")
            args.append("-DWITH_UTILS:BOOL=OFF")
        else:
            args.append("-DWITH_PACKAGES:BOOL=ON")
            args.append("-DWITH_PROJECTS:BOOL=ON")
            args.append("-DWITH_TOOLS:BOOL=ON")
            args.append("-DWITH_UTILS:BOOL=ON")

        # TODO: check that Python Cygwin is not in the path?

        if not os.path.isdir(self.env.env_path):
            os.makedirs(self.env.env_path)
        utils.call(args, cwd=self.env.env_path, env=env)

        # Hack to disable incremental build on XP (it fails with:
        # LINK : fatal error LNK1210: exceeded internal ILK size limit; link with /INCREMENTAL:NO)
        # I didn't find a way to to this in CMakeLists.txt
        # (http://www.cmake.org/pipermail/cmake/2010-February/035174.html didn't work)
        if self.env.platform == "win" and platform.release() == "XP":
            cmake_cache = join(self.env.env_path, "CMakeCache.txt")
            cache_content = open(cmake_cache).read()
            cache_content = cache_content.replace("INCREMENTAL:YES", "INCREMENTAL:NO")
            open(cmake_cache, "wb").write(cache_content)