# Path: kiwixbuild/dependencies/base.py
# class Dependency(metaclass=_MetaDependency):
#     all_deps = {}
#     force_build = False
#     force_native_build = False
#     dont_skip = False
# 
#     @classmethod
#     def version(cls):
#         if cls.name in base_deps_versions:
#             return base_deps_versions[cls.name]
#         elif option('make_release'):
#             return main_project_versions.get(cls.name, None)
#         return None
# 
#     @classmethod
#     def full_name(cls):
#         if cls.version():
#             return "{}-{}".format(cls.name, cls.version())
#         return cls.name
# 
# class ReleaseDownload(Source):
#     archive_top_dir = None
# 
#     @property
#     def extract_path(self):
#         return pj(neutralEnv('source_dir'), self.source_dir)
# 
#     def _download(self, context):
#         context.try_skip(neutralEnv('archive_dir'), self.full_name)
#         neutralEnv('download')(self.archive)
# 
#     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)
# 
#     def prepare(self):
#         self.command('download', self._download)
#         self.command('extract', self._extract)
#         if hasattr(self, 'patches'):
#             self.command('patch', self._patch)
#         if hasattr(self, '_post_prepare_script'):
#             self.command('post_prepare_script', self._post_prepare_script)
# 
# class MakeBuilder(Builder):
#     configure_option_template = "{dep_options} {static_option} {env_option} --prefix {install_dir} --libdir {libdir}"
#     configure_option = ""
#     dynamic_configure_option = "--enable-shared --disable-static"
#     static_configure_option = "--enable-static --disable-shared"
#     make_option = ""
#     install_option = ""
#     configure_script = "configure"
#     configure_env = {
#         '_format_CFLAGS' : '{env[CFLAGS]} -O3',
#         '_format_CXXFLAGS': '{env[CXXFLAGS]} -O3'
#     }
#     make_target = ""
#     flatpak_buildsystem = None
# 
#     @property
#     def make_install_target(self):
#         if self.buildEnv.platformInfo.build == 'iOS':
#             return 'install'
#         return 'install-strip'
# 
#     @property
#     def all_configure_option(self):
#         option = self.configure_option_template.format(
#             dep_options=self.configure_option,
#             static_option=self.static_configure_option if self.buildEnv.platformInfo.static else self.dynamic_configure_option,
#             env_option=self.buildEnv.platformInfo.configure_option if not self.target.force_native_build else "",
#             install_dir=self.buildEnv.install_dir,
#             libdir=pj(self.buildEnv.install_dir, self.buildEnv.libprefix)
#             )
#         return option
# 
#     def set_configure_env(self, env):
#         dep_conf_env = self.configure_env
#         if not dep_conf_env:
#             return
#         for k, v in dep_conf_env.items():
#             if k.startswith('_format_'):
#                 v = v.format(buildEnv=self.buildEnv, env=env)
#                 env[k[8:]] = v
#             else:
#                 env[k] = v
# 
# 
#     def _configure(self, context):
#         context.try_skip(self.build_path)
#         command = "{configure_script} {configure_option}"
#         command = command.format(
#             configure_script=pj(self.source_path, self.configure_script),
#             configure_option=self.all_configure_option
#         )
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         self.set_configure_env(env)
#         run_command(command, self.build_path, context, env=env)
# 
#     def _compile(self, context):
#         context.try_skip(self.build_path)
#         command = "make -j4 {make_target} {make_option}".format(
#             make_target=self.make_target,
#             make_option=self.make_option
#         )
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         run_command(command, self.build_path, context, env=env)
# 
#     def _install(self, context):
#         context.try_skip(self.build_path)
#         command = "make {make_install_target} {make_option}".format(
#             make_install_target=self.make_install_target,
#             make_option=self.make_option
#         )
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         run_command(command, self.build_path, context, env=env)
# 
#     def _make_dist(self, context):
#         context.try_skip(self.build_path)
#         command = "make dist"
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         run_command(command, self.build_path, context, env=env)
# 
# Path: kiwixbuild/utils.py
# class Remotefile(namedtuple('Remotefile', ('name', 'sha256', 'url'))):
#     def __new__(cls, name, sha256, url=None):
#         if url is None:
#             url = REMOTE_PREFIX + name
#         return super().__new__(cls, name, sha256, url)


from .base import (
    Dependency,
    ReleaseDownload,
    MakeBuilder)
from kiwixbuild.utils import Remotefile


class lzma(Dependency):
    name = 'lzma'

    class Source(ReleaseDownload):

# Path: kiwixbuild/dependencies/base.py
# class Dependency(metaclass=_MetaDependency):
#     all_deps = {}
#     force_build = False
#     force_native_build = False
#     dont_skip = False
# 
#     @classmethod
#     def version(cls):
#         if cls.name in base_deps_versions:
#             return base_deps_versions[cls.name]
#         elif option('make_release'):
#             return main_project_versions.get(cls.name, None)
#         return None
# 
#     @classmethod
#     def full_name(cls):
#         if cls.version():
#             return "{}-{}".format(cls.name, cls.version())
#         return cls.name
# 
# class ReleaseDownload(Source):
#     archive_top_dir = None
# 
#     @property
#     def extract_path(self):
#         return pj(neutralEnv('source_dir'), self.source_dir)
# 
#     def _download(self, context):
#         context.try_skip(neutralEnv('archive_dir'), self.full_name)
#         neutralEnv('download')(self.archive)
# 
#     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)
# 
#     def prepare(self):
#         self.command('download', self._download)
#         self.command('extract', self._extract)
#         if hasattr(self, 'patches'):
#             self.command('patch', self._patch)
#         if hasattr(self, '_post_prepare_script'):
#             self.command('post_prepare_script', self._post_prepare_script)
# 
# class MakeBuilder(Builder):
#     configure_option_template = "{dep_options} {static_option} {env_option} --prefix {install_dir} --libdir {libdir}"
#     configure_option = ""
#     dynamic_configure_option = "--enable-shared --disable-static"
#     static_configure_option = "--enable-static --disable-shared"
#     make_option = ""
#     install_option = ""
#     configure_script = "configure"
#     configure_env = {
#         '_format_CFLAGS' : '{env[CFLAGS]} -O3',
#         '_format_CXXFLAGS': '{env[CXXFLAGS]} -O3'
#     }
#     make_target = ""
#     flatpak_buildsystem = None
# 
#     @property
#     def make_install_target(self):
#         if self.buildEnv.platformInfo.build == 'iOS':
#             return 'install'
#         return 'install-strip'
# 
#     @property
#     def all_configure_option(self):
#         option = self.configure_option_template.format(
#             dep_options=self.configure_option,
#             static_option=self.static_configure_option if self.buildEnv.platformInfo.static else self.dynamic_configure_option,
#             env_option=self.buildEnv.platformInfo.configure_option if not self.target.force_native_build else "",
#             install_dir=self.buildEnv.install_dir,
#             libdir=pj(self.buildEnv.install_dir, self.buildEnv.libprefix)
#             )
#         return option
# 
#     def set_configure_env(self, env):
#         dep_conf_env = self.configure_env
#         if not dep_conf_env:
#             return
#         for k, v in dep_conf_env.items():
#             if k.startswith('_format_'):
#                 v = v.format(buildEnv=self.buildEnv, env=env)
#                 env[k[8:]] = v
#             else:
#                 env[k] = v
# 
# 
#     def _configure(self, context):
#         context.try_skip(self.build_path)
#         command = "{configure_script} {configure_option}"
#         command = command.format(
#             configure_script=pj(self.source_path, self.configure_script),
#             configure_option=self.all_configure_option
#         )
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         self.set_configure_env(env)
#         run_command(command, self.build_path, context, env=env)
# 
#     def _compile(self, context):
#         context.try_skip(self.build_path)
#         command = "make -j4 {make_target} {make_option}".format(
#             make_target=self.make_target,
#             make_option=self.make_option
#         )
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         run_command(command, self.build_path, context, env=env)
# 
#     def _install(self, context):
#         context.try_skip(self.build_path)
#         command = "make {make_install_target} {make_option}".format(
#             make_install_target=self.make_install_target,
#             make_option=self.make_option
#         )
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         run_command(command, self.build_path, context, env=env)
# 
#     def _make_dist(self, context):
#         context.try_skip(self.build_path)
#         command = "make dist"
#         env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True)
#         run_command(command, self.build_path, context, env=env)
# 
# Path: kiwixbuild/utils.py
# class Remotefile(namedtuple('Remotefile', ('name', 'sha256', 'url'))):
#     def __new__(cls, name, sha256, url=None):
#         if url is None:
#             url = REMOTE_PREFIX + name
#         return super().__new__(cls, name, sha256, url)


# Path: kiwixbuild/dependencies/lzma.py
from .base import (
    Dependency,
    ReleaseDownload,
    MakeBuilder)
from kiwixbuild.utils import Remotefile



class lzma(Dependency):
    name = 'lzma'

    class Source(ReleaseDownload):

        archive = Remotefile('xz-5.2.4.tar.gz',