From ecc6927de8566b7c05593b2bb23b2d6b713819e5 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 5 Sep 2018 19:38:39 +0200 Subject: [PATCH] Use git archive to create dist source archive. qmake seems to generate wrong "dist" rules for "make". It try to copy the translation files as if it was in current directory instead of looking the source dir. dist archive is usefull with autotools where we want to run autogen before. Or with meson when meson run tests before making the archive. With qmake, it seems useless, let's simply archive what is git. --- kiwixbuild/dependencies/base.py | 9 +++++++++ travis/compile_all.py | 9 ++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index e35c59f..940b3b3 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -402,6 +402,15 @@ class QMakeBuilder(MakeBuilder): ) run_command(command, self.build_path, context, buildEnv=self.buildEnv) + def _make_dist(self, context): + command = "git archive -o {build_dir}/{name}.tar.gz --prefix={name}/ HEAD" + command = command.format( + build_dir = self.build_path, + name = self.target.full_name() + ) + run_command(command, self.source_path, context, buildEnv=self.buildEnv) + + class MesonBuilder(Builder): configure_option = "" diff --git a/travis/compile_all.py b/travis/compile_all.py index b26aeb4..2a8d212 100755 --- a/travis/compile_all.py +++ b/travis/compile_all.py @@ -353,15 +353,18 @@ if make_release and PLATFORM == 'native_dyn': else: out_dir = DIST_ZIM_ARCHIVES_DIR - if target in ('kiwix-lib', 'kiwix-tools', 'libzim', 'zim-tools', 'zimwriterfs'): + if target in ('kiwix-lib', 'kiwix-tools', 'libzim', 'zim-tools', 'zimwriterfs', 'kiwix-desktop'): try: (out_dir/target).mkdir(parents=True) except FileExistsError: pass full_target_name = "{}-{}".format(target, main_project_versions[target]) - in_file = BASE_DIR/full_target_name/'meson-dist'/'{}.tar.xz'.format( - full_target_name) + if target != 'kiwix-desktop': + in_file = BASE_DIR/full_target_name/'meson-dist'/'{}.tar.xz'.format( + full_target_name) + else: + in_file = BASE_DIR/full_target_name/'{}.tar.gz'.format(full_target_name) if in_file.exists(): shutil.copy(str(in_file), str(out_dir/target)) elif PLATFORM == 'native_static':