diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-13 19:25:54 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-01-13 19:25:54 +0200 |
commit | 57015296328a4fe5c8bad5410a3b4ba67637fbb6 (patch) | |
tree | 91bf8d1091715884259f2a945bdb22a0eab21760 /shellgenerator.py | |
parent | 0783c7ff97da9fbb7b9883a5b392d6f2348f8119 (diff) | |
download | meson-57015296328a4fe5c8bad5410a3b4ba67637fbb6.zip meson-57015296328a4fe5c8bad5410a3b4ba67637fbb6.tar.gz meson-57015296328a4fe5c8bad5410a3b4ba67637fbb6.tar.bz2 |
Can install data files.
Diffstat (limited to 'shellgenerator.py')
-rwxr-xr-x | shellgenerator.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/shellgenerator.py b/shellgenerator.py index 963d914..73574b4 100755 --- a/shellgenerator.py +++ b/shellgenerator.py @@ -74,6 +74,7 @@ echo Run compile.sh before this or bad things will happen. self.generate_target_install(outfile) self.generate_header_install(outfile) self.generate_man_install(outfile) + self.generate_data_install(outfile) outfile.close() def make_subdir(self, outfile, dir): @@ -84,7 +85,24 @@ echo Run compile.sh before this or bad things will happen. cpcommand = ['cp', filename, outdir] cpcommand = ' '.join(shell_quote(cpcommand)) + ' || exit\n' outfile.write(cpcommand) - + + def generate_data_install(self, outfile): + prefix = self.environment.get_prefix() + dataroot = os.path.join(prefix, self.environment.get_datadir()) + data = self.build.get_data() + if len(data) != 0: + outfile.write('\necho Installing data files.\n') + else: + outfile.write('\necho This project has no data files to install.\n') + for d in data: + subdir = os.path.join(self.environment.get_datadir(), d.get_subdir()) + absdir = os.path.join(self.environment.get_prefix(), subdir) + for f in d.get_sources(): + self.make_subdir(outfile, absdir) + srcabs = os.path.join(self.environment.get_source_dir(), f) + dstabs = os.path.join(absdir, f) + self.copy_file(outfile, srcabs, dstabs) + def generate_man_install(self, outfile): prefix = self.environment.get_prefix() manroot = os.path.join(prefix, self.environment.get_mandir()) @@ -126,6 +144,10 @@ echo Run compile.sh before this or bad things will happen. bindir = os.path.join(prefix, self.environment.get_bindir()) self.make_subdir(outfile, libdir) self.make_subdir(outfile, bindir) + if len(self.build.get_targets()) != 0: + outfile.write('\necho Installing targets.\n') + else: + outfile.write('\necho This project has no targets to install.\n') for tmp in self.build.get_targets().items(): (name, t) = tmp if t.should_install(): |