Merge pull request #296 from kiwix/release_build
Build in release mode.
This commit is contained in:
commit
f296f59a68
|
@ -288,9 +288,14 @@ class MakeBuilder(Builder):
|
||||||
configure_script = "configure"
|
configure_script = "configure"
|
||||||
configure_env = None
|
configure_env = None
|
||||||
make_target = ""
|
make_target = ""
|
||||||
make_install_target = "install"
|
|
||||||
flatpak_buildsystem = None
|
flatpak_buildsystem = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def make_install_target(self):
|
||||||
|
if self.buildEnv.platformInfo.build == 'iOS':
|
||||||
|
return 'install'
|
||||||
|
return 'install-strip'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def all_configure_option(self):
|
def all_configure_option(self):
|
||||||
option = self.configure_option_template.format(
|
option = self.configure_option_template.format(
|
||||||
|
@ -434,6 +439,14 @@ class MesonBuilder(Builder):
|
||||||
test_option = ""
|
test_option = ""
|
||||||
flatpak_buildsystem = 'meson'
|
flatpak_buildsystem = 'meson'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def build_type(self):
|
||||||
|
return 'release' if option('make_release') else 'debugoptimized'
|
||||||
|
|
||||||
|
@property
|
||||||
|
def strip_option(self):
|
||||||
|
return '--strip' if option('make_release') else ''
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def library_type(self):
|
def library_type(self):
|
||||||
return 'static' if self.buildEnv.platformInfo.static else 'shared'
|
return 'static' if self.buildEnv.platformInfo.static else 'shared'
|
||||||
|
@ -449,6 +462,7 @@ class MesonBuilder(Builder):
|
||||||
cross_option = "--cross-file {}".format(
|
cross_option = "--cross-file {}".format(
|
||||||
self.buildEnv.meson_crossfile)
|
self.buildEnv.meson_crossfile)
|
||||||
command = ("{command} . {build_path}"
|
command = ("{command} . {build_path}"
|
||||||
|
" --buildtype={build_type} {strip_option}"
|
||||||
" --default-library={library_type}"
|
" --default-library={library_type}"
|
||||||
" {configure_option}"
|
" {configure_option}"
|
||||||
" --prefix={buildEnv.install_dir}"
|
" --prefix={buildEnv.install_dir}"
|
||||||
|
@ -456,6 +470,8 @@ class MesonBuilder(Builder):
|
||||||
" {cross_option}")
|
" {cross_option}")
|
||||||
command = command.format(
|
command = command.format(
|
||||||
command=neutralEnv('meson_command'),
|
command=neutralEnv('meson_command'),
|
||||||
|
build_type=self.build_type,
|
||||||
|
strip_option=self.strip_option,
|
||||||
library_type=self.library_type,
|
library_type=self.library_type,
|
||||||
configure_option=configure_option,
|
configure_option=configure_option,
|
||||||
build_path=self.build_path,
|
build_path=self.build_path,
|
||||||
|
|
|
@ -23,6 +23,7 @@ class Icu(Dependency):
|
||||||
|
|
||||||
class Builder(MakeBuilder):
|
class Builder(MakeBuilder):
|
||||||
subsource_dir = "source"
|
subsource_dir = "source"
|
||||||
|
make_install_target = "install"
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_dependencies(cls, platformInfo, allDeps):
|
def get_dependencies(cls, platformInfo, allDeps):
|
||||||
|
|
|
@ -12,6 +12,8 @@ class KiwixDesktop(Dependency):
|
||||||
|
|
||||||
class Builder(QMakeBuilder):
|
class Builder(QMakeBuilder):
|
||||||
dependencies = ["qt", "qtwebengine", "kiwix-lib", "aria2"]
|
dependencies = ["qt", "qtwebengine", "kiwix-lib", "aria2"]
|
||||||
|
make_install_target = 'install'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def configure_option(self):
|
def configure_option(self):
|
||||||
if self.buildEnv.platformInfo.name == 'flatpak':
|
if self.buildEnv.platformInfo.name == 'flatpak':
|
||||||
|
|
|
@ -14,4 +14,6 @@ class Pugixml(Dependency):
|
||||||
patches = ["pugixml_meson.patch"]
|
patches = ["pugixml_meson.patch"]
|
||||||
flatpak_dest = "src"
|
flatpak_dest = "src"
|
||||||
|
|
||||||
Builder = MesonBuilder
|
class Builder(MesonBuilder):
|
||||||
|
build_type = 'release'
|
||||||
|
strip_option = ''
|
||||||
|
|
|
@ -24,6 +24,7 @@ class Xapian(Dependency):
|
||||||
configure_env = {'_format_LDFLAGS': "{env.LDFLAGS} -L{buildEnv.install_dir}/{buildEnv.libprefix}",
|
configure_env = {'_format_LDFLAGS': "{env.LDFLAGS} -L{buildEnv.install_dir}/{buildEnv.libprefix}",
|
||||||
'_format_CXXFLAGS': "{env.CXXFLAGS} -I{buildEnv.install_dir}/include"}
|
'_format_CXXFLAGS': "{env.CXXFLAGS} -I{buildEnv.install_dir}/include"}
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_dependencies(cls, platformInfo, allDeps):
|
def get_dependencies(cls, platformInfo, allDeps):
|
||||||
deps = ['zlib', 'lzma']
|
deps = ['zlib', 'lzma']
|
||||||
|
|
|
@ -20,6 +20,7 @@ class zlib(Dependency):
|
||||||
class Builder(MakeBuilder):
|
class Builder(MakeBuilder):
|
||||||
dynamic_configure_option = "--shared"
|
dynamic_configure_option = "--shared"
|
||||||
static_configure_option = "--static"
|
static_configure_option = "--static"
|
||||||
|
make_install_target = 'install'
|
||||||
configure_option_template = "{dep_options} {static_option} --prefix {install_dir} --libdir {libdir}"
|
configure_option_template = "{dep_options} {static_option} --prefix {install_dir} --libdir {libdir}"
|
||||||
|
|
||||||
def _pre_build_script(self, context):
|
def _pre_build_script(self, context):
|
||||||
|
|
|
@ -66,8 +66,8 @@ class AndroidPlatformInfo(PlatformInfo):
|
||||||
|
|
||||||
def set_compiler(self, env):
|
def set_compiler(self, env):
|
||||||
binaries = self.binaries(self.ndk_builder.install_path)
|
binaries = self.binaries(self.ndk_builder.install_path)
|
||||||
env['CC'] = binaries['CC']
|
for k,v in binaries.items():
|
||||||
env['CXX'] = binaries['CXX']
|
env[k] = v
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def configure_option(self):
|
def configure_option(self):
|
||||||
|
|
|
@ -69,8 +69,8 @@ class ArmhfPlatformInfo(PlatformInfo):
|
||||||
|
|
||||||
def set_env(self, env):
|
def set_env(self, env):
|
||||||
env['PKG_CONFIG_LIBDIR'] = pj(self.root_path, 'lib', 'pkgconfig')
|
env['PKG_CONFIG_LIBDIR'] = pj(self.root_path, 'lib', 'pkgconfig')
|
||||||
env['CFLAGS'] = " -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CFLAGS']
|
env['CFLAGS'] = " -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CFLAGS']
|
||||||
env['CXXFLAGS'] = " -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CXXFLAGS']
|
env['CXXFLAGS'] = " -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 "+env['CXXFLAGS']
|
||||||
env['QEMU_LD_PREFIX'] = pj(self.root_path, "arm-linux-gnueabihf", "libc")
|
env['QEMU_LD_PREFIX'] = pj(self.root_path, "arm-linux-gnueabihf", "libc")
|
||||||
env['QEMU_SET_ENV'] = "LD_LIBRARY_PATH={}".format(
|
env['QEMU_SET_ENV'] = "LD_LIBRARY_PATH={}".format(
|
||||||
':'.join([
|
':'.join([
|
||||||
|
@ -79,8 +79,8 @@ class ArmhfPlatformInfo(PlatformInfo):
|
||||||
]))
|
]))
|
||||||
|
|
||||||
def set_compiler(self, env):
|
def set_compiler(self, env):
|
||||||
env['CC'] = self.binaries['CC']
|
for k, v in self.binaries.items():
|
||||||
env['CXX'] = self.binaries['CXX']
|
env[k] = v
|
||||||
|
|
||||||
def finalize_setup(self):
|
def finalize_setup(self):
|
||||||
super().finalize_setup()
|
super().finalize_setup()
|
||||||
|
|
|
@ -71,8 +71,8 @@ class iOSPlatformInfo(PlatformInfo):
|
||||||
return '--host={}'.format(self.arch_full)
|
return '--host={}'.format(self.arch_full)
|
||||||
|
|
||||||
def set_compiler(self, env):
|
def set_compiler(self, env):
|
||||||
env['CC'] = self.binaries['CC']
|
for k,v in self.binaries.items():
|
||||||
env['CXX'] = self.binaries['CXX']
|
env[k] = v
|
||||||
|
|
||||||
|
|
||||||
class iOSArmv7(iOSPlatformInfo):
|
class iOSArmv7(iOSPlatformInfo):
|
||||||
|
|
|
@ -4,6 +4,7 @@ c = '{binaries[CC]}'
|
||||||
ar = '{binaries[AR]}'
|
ar = '{binaries[AR]}'
|
||||||
cpp = '{binaries[CXX]}'
|
cpp = '{binaries[CXX]}'
|
||||||
strip = '{binaries[STRIP]}'
|
strip = '{binaries[STRIP]}'
|
||||||
|
ranlib = '{binaries[RANLIB]}'
|
||||||
{exec_wrapper_def}
|
{exec_wrapper_def}
|
||||||
|
|
||||||
[properties]
|
[properties]
|
||||||
|
|
|
@ -35,7 +35,7 @@ release_versions = {
|
||||||
|
|
||||||
# This is the "version" of the whole base_deps_versions dict.
|
# This is the "version" of the whole base_deps_versions dict.
|
||||||
# Change this when you change base_deps_versions.
|
# Change this when you change base_deps_versions.
|
||||||
base_deps_meta_version = '16'
|
base_deps_meta_version = '17'
|
||||||
|
|
||||||
|
|
||||||
base_deps_versions = {
|
base_deps_versions = {
|
||||||
|
|
|
@ -196,6 +196,7 @@ def make_deps_archive(target, full=False):
|
||||||
TRAVIS_OS_NAME, PLATFORM, target)
|
TRAVIS_OS_NAME, PLATFORM, target)
|
||||||
print_message("Create archive {}.", archive_name)
|
print_message("Create archive {}.", archive_name)
|
||||||
files_to_archive = [INSTALL_DIR]
|
files_to_archive = [INSTALL_DIR]
|
||||||
|
files_to_archive += HOME.glob('BUILD_*/LOGS')
|
||||||
if PLATFORM == 'native_mixed':
|
if PLATFORM == 'native_mixed':
|
||||||
files_to_archive += [HOME/'BUILD_native_static'/'INSTALL']
|
files_to_archive += [HOME/'BUILD_native_static'/'INSTALL']
|
||||||
if PLATFORM.startswith('android'):
|
if PLATFORM.startswith('android'):
|
||||||
|
|
Loading…
Reference in New Issue