Пример #1
0
 def _extract(self, context):
     context.try_skip(self.extract_path)
     if os.path.exists(self.extract_path):
         shutil.rmtree(self.extract_path)
     extract_archive(pj(neutralEnv('archive_dir'), self.archive.name),
                     neutralEnv('source_dir'),
                     topdir=self.archive_top_dir,
                     name=self.source_dir)
Пример #2
0
 def _git_init(self, context):
     if option('fast_clone') and self.force_full_clone == False:
         command = "git clone --depth=1 --branch {} {} {}".format(
             self.git_ref, self.git_remote, self.source_dir)
         run_command(command, neutralEnv('source_dir'), context)
     else:
         command = "git clone {} {}".format(self.git_remote,
                                            self.source_dir)
         run_command(command, neutralEnv('source_dir'), context)
         command = "git checkout {}".format(self.git_ref)
         run_command(command, self.git_path, context)
Пример #3
0
 def _configure(self, context):
     context.try_skip(self.build_path)
     if os.path.exists(self.build_path):
         shutil.rmtree(self.build_path)
     os.makedirs(self.build_path)
     configure_option = self.configure_option.format(buildEnv=self.buildEnv)
     cross_option = ""
     if not self.target.force_native_build and self.buildEnv.meson_crossfile:
         cross_option = "--cross-file {}".format(
             self.buildEnv.meson_crossfile)
     command = ("{command} . {build_path}"
                " --buildtype={build_type} {strip_option}"
                " --default-library={library_type}"
                " {configure_option}"
                " --prefix={buildEnv.install_dir}"
                " --libdir={buildEnv.libprefix}"
                " {cross_option}")
     command = command.format(command=neutralEnv('meson_command'),
                              build_type=self.build_type,
                              strip_option=self.strip_option,
                              library_type=self.library_type,
                              configure_option=configure_option,
                              build_path=self.build_path,
                              buildEnv=self.buildEnv,
                              cross_option=cross_option)
     run_command(command,
                 self.source_path,
                 context,
                 buildEnv=self.buildEnv,
                 cross_env_only=True)
Пример #4
0
 def _install(self, context):
     context.try_skip(self.build_path)
     command = "{} -v install".format(neutralEnv('ninja_command'))
     env = self.buildEnv.get_env(cross_comp_flags=False,
                                 cross_compilers=False,
                                 cross_path=True)
     run_command(command, self.build_path, context, env=env)
Пример #5
0
 def _test(self, context):
     if (self.buildEnv.platformInfo.build == 'android'
             or (self.buildEnv.platformInfo.build != 'native'
                 and not self.buildEnv.platformInfo.static)):
         raise SkipCommand()
     command = "{} --verbose {}".format(neutralEnv('mesontest_command'),
                                        self.test_option)
     run_command(command, self.build_path, context, buildEnv=self.buildEnv)
Пример #6
0
 def get_dependencies(cls, platformInfo, allDeps):
     base_dependencies = [
         "pugixml", "libzim", "zlib", "lzma", "libaria2", "icu4c"
     ]
     if (platformInfo.build != 'android'
             and neutralEnv('distname') != 'Darwin'):
         base_dependencies += ['ctpp2c', 'ctpp2']
     return base_dependencies
Пример #7
0
 def _test(self, context):
     context.try_skip(self.build_path)
     if (self.buildEnv.platformInfo.build == 'android'
             or (self.buildEnv.platformInfo.build != 'native'
                 and not self.buildEnv.platformInfo.static)):
         raise SkipCommand()
     command = "{} --verbose {}".format(neutralEnv('mesontest_command'),
                                        self.test_option)
     env = self.buildEnv.get_env(cross_comp_flags=False,
                                 cross_compilers=False,
                                 cross_path=True)
     run_command(command, self.build_path, context, env=env)
Пример #8
0
        def get_dependencies(cls, platformInfo, allDeps):
            base_deps = [
                'zlib', 'lzma', 'xapian-core', 'pugixml', 'libaria2', 'icu4c'
            ]
            # zimwriterfs
            if platformInfo.build not in ('android', 'win32'):
                base_deps += ['libmagic', 'gumbo']
            # kiwix-tools
            if (platformInfo.build != 'android'
                    and neutralEnv('distname') != 'Darwin'):
                base_deps += ['libmicrohttpd', 'ctpp2c', 'ctpp2']

            return base_deps
Пример #9
0
 def _svn_export(self, context):
     if os.path.exists(self.svn_path):
         raise SkipCommand()
     command = "svn export {} {}".format(self.svn_remote, self.svn_dir)
     run_command(command, neutralEnv('source_dir'), context)
Пример #10
0
 def _git_clone(self, context):
     if os.path.exists(self.git_path):
         raise SkipCommand()
     command = "git clone --depth=1 --branch {} {} {}".format(
         self.git_ref, self.git_remote, self.source_dir)
     run_command(command, neutralEnv('source_dir'), context)
Пример #11
0
 def source_path(self):
     return pj(neutralEnv('source_dir'), self.source_dir)
Пример #12
0
 def get_env(self):
     env = super().get_env()
     if neutralEnv('distname') == 'fedora':
         env['QT_SELECT'] = "5-64"
     return env
Пример #13
0
 def root_path(self):
     root_paths = {
         'fedora': '/usr/i686-w64-mingw32/sys-root/mingw',
         'debian': '/usr/i686-w64-mingw32'
     }
     return root_paths[neutralEnv('distname')]
Пример #14
0
 def _make_dist(self, context):
     command = "{} -v dist".format(neutralEnv('ninja_command'))
     env = self.buildEnv.get_env(cross_comp_flags=False,
                                 cross_compilers=False,
                                 cross_path=True)
     run_command(command, self.build_path, context, env=env)
Пример #15
0
 def _install(self, context):
     command = "{} -v install".format(neutralEnv('ninja_command'))
     run_command(command, self.build_path, context, buildEnv=self.buildEnv)
Пример #16
0
 def _make_dist(self, context):
     command = "{} -v dist".format(neutralEnv('ninja_command'))
     run_command(command, self.build_path, context, buildEnv=self.buildEnv)
Пример #17
0
 def get_dependencies(cls, platformInfo, allDeps):
     deps = ['zlib', 'lzma']
     if (platformInfo.build == 'win32'
             or neutralEnv('distname') == 'Darwin'):
         return deps
     return deps + ['uuid']
Пример #18
0
 def _log_dir(self):
     return neutralEnv('log_dir')
Пример #19
0
 def _download(self, context):
     context.try_skip(neutralEnv('archive_dir'), self.name)
     neutralEnv('download')(self.archive)