aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/scripts/meson_install.py15
-rw-r--r--test cases/common/52 custom install dirs/installed_files.txt6
-rw-r--r--test cases/common/52 custom install dirs/meson.build6
-rw-r--r--test cases/common/52 custom install dirs/subdir/datafile.dog1
4 files changed, 25 insertions, 3 deletions
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
index 1924b95..6a3adab 100644
--- a/mesonbuild/scripts/meson_install.py
+++ b/mesonbuild/scripts/meson_install.py
@@ -106,7 +106,10 @@ def install_data(d):
def install_man(d):
for m in d.man:
outfileroot = m[1]
- outfilename = os.path.join(d.fullprefix, outfileroot)
+ if os.path.isabs(m[1]):
+ outfilename = destdir_join(d.destdir, m[1])
+ else:
+ outfilename = os.path.join(d.fullprefix, m[1])
full_source_filename = m[0]
outdir = os.path.split(outfilename)[0]
os.makedirs(outdir, exist_ok=True)
@@ -121,7 +124,10 @@ def install_man(d):
def install_headers(d):
for t in d.headers:
fullfilename = t[0]
- outdir = os.path.join(d.fullprefix, t[1])
+ if os.path.isabs(t[1]):
+ outdir = destdir_join(d.destdir, t[1])
+ else:
+ outdir = os.path.join(d.fullprefix, t[1])
fname = os.path.split(fullfilename)[1]
outfilename = os.path.join(outdir, fname)
print('Installing %s to %s' % (fname, outdir))
@@ -194,7 +200,10 @@ def check_for_stampfile(fname):
def install_targets(d):
for t in d.targets:
fname = check_for_stampfile(t[0])
- outdir = os.path.join(d.fullprefix, t[1])
+ if os.path.isabs(t[1]):
+ outdir = destdir_join(d.destdir, t[1])
+ else:
+ outdir = os.path.join(d.fullprefix, t[1])
aliases = t[2]
outname = os.path.join(outdir, os.path.split(fname)[-1])
should_strip = t[3]
diff --git a/test cases/common/52 custom install dirs/installed_files.txt b/test cases/common/52 custom install dirs/installed_files.txt
index 1b8b561..0cc533a 100644
--- a/test cases/common/52 custom install dirs/installed_files.txt
+++ b/test cases/common/52 custom install dirs/installed_files.txt
@@ -1,4 +1,10 @@
usr/dib/dab/dub/prog?exe
+usr/dib/dab/dub2/prog2?exe
usr/some/dir/sample.h
+usr/some/dir2/sample.h
usr/woman/prog.1.gz
+usr/woman2/prog.1.gz
usr/meow/datafile.cat
+usr/meow2/datafile.cat
+usr/woof/subdir/datafile.dog
+usr/woof2/subdir/datafile.dog
diff --git a/test cases/common/52 custom install dirs/meson.build b/test cases/common/52 custom install dirs/meson.build
index 622ecad..494ff0e 100644
--- a/test cases/common/52 custom install dirs/meson.build
+++ b/test cases/common/52 custom install dirs/meson.build
@@ -1,5 +1,11 @@
project('custom install dirs', 'c')
executable('prog', 'prog.c', install : true, install_dir : 'dib/dab/dub')
+executable('prog2', 'prog.c', install : true, install_dir : get_option('prefix') + '/dib/dab/dub2')
install_headers('sample.h', install_dir : 'some/dir')
+install_headers('sample.h', install_dir : get_option('prefix') + '/some/dir2')
install_man('prog.1', install_dir : 'woman')
+install_man('prog.1', install_dir : get_option('prefix') + '/woman2')
install_data('datafile.cat', install_dir : 'meow')
+install_data('datafile.cat', install_dir : get_option('prefix') + '/meow2')
+install_subdir('subdir', install_dir : 'woof')
+install_subdir('subdir', install_dir : get_option('prefix') + '/woof2')
diff --git a/test cases/common/52 custom install dirs/subdir/datafile.dog b/test cases/common/52 custom install dirs/subdir/datafile.dog
new file mode 100644
index 0000000..7a5bcb7
--- /dev/null
+++ b/test cases/common/52 custom install dirs/subdir/datafile.dog
@@ -0,0 +1 @@
+Installed dog is installed.