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.
This commit is contained in:
Matthieu Gautier 2018-09-05 19:38:39 +02:00
parent df0b684869
commit ecc6927de8
2 changed files with 15 additions and 3 deletions

View File

@ -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 = ""

View File

@ -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':