Can install man files from a subdir.

pull/18/head
Jussi Pakkanen 10 years ago
parent 8313c4ed00
commit d767bcf86d
  1. 8
      interpreter.py
  2. 2
      ninjabackend.py
  3. 1
      test cases/common/10 man install/installed_files.txt
  4. 3
      test cases/common/10 man install/meson.build
  5. 1
      test cases/common/10 man install/vanishing/meson.build
  6. 1
      test cases/common/10 man install/vanishing/vanishing.1

@ -324,8 +324,9 @@ class Data(InterpreterObject):
class Man(InterpreterObject):
def __init__(self, sources, kwargs):
def __init__(self, source_subdir, sources, kwargs):
InterpreterObject.__init__(self)
self.source_subdir = source_subdir
self.sources = sources
self.validate_sources()
if len(kwargs) > 1:
@ -346,6 +347,9 @@ class Man(InterpreterObject):
def get_sources(self):
return self.sources
def get_source_subdir(self):
return self.source_subdir
class GeneratedObjectsHolder(InterpreterObject):
def __init__(self, held_object):
super().__init__()
@ -1162,7 +1166,7 @@ class Interpreter():
for a in args:
if not isinstance(a, str):
raise InvalidArguments('Argument %s is not a string.' % str(a))
m = Man(args, kwargs)
m = Man(self.subdir, args, kwargs)
self.build.man.append(m)
return m

@ -448,7 +448,7 @@ class NinjaBackend(backends.Backend):
subdir = m.get_custom_install_dir()
if subdir is None:
subdir = os.path.join(manroot, 'man' + num)
srcabs = os.path.join(self.environment.get_source_dir(), f)
srcabs = os.path.join(self.environment.get_source_dir(), m.get_source_subdir(), f)
dstabs = os.path.join(subdir, f + '.gz')
i = [srcabs, dstabs]
d.man.append(i)

@ -1,2 +1,3 @@
share/man/man1/foo.1.gz
share/man/man2/bar.2.gz
share/man/man1/vanishing.1.gz

@ -1,3 +1,4 @@
project('man install', 'c')
m1 = install_man('foo.1')
m2 = install_man('bar.2')
m2 = install_man('bar.2')
subdir('vanishing')

@ -0,0 +1 @@
This is a man page of the vanishing subdirectory.
Loading…
Cancel
Save