diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-09-13 11:50:08 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-09-13 11:50:51 +0200 |
commit | d70c808704da8b3d7571612c9b015b28a8c1f3c1 (patch) | |
tree | dd97226212e46eabd4c3ec51717b7cb8111ddef5 | |
parent | 5e5b2aa3b3a9606f2a54d9da38e671030fde73d2 (diff) | |
download | libmbim-d70c808704da8b3d7571612c9b015b28a8c1f3c1.tar.gz |
Revert "build: Use the install_mode option"
This reverts commit d783112c6a6e8f8c27b6c603c06ca3efb2089b33.
We shouldn't remove the 'meson_post_install.py' script because the
bash-completion setup still needs it, given that in the stable branch
we didn't rename the completion file.
-rw-r--r-- | meson.build | 6 | ||||
-rwxr-xr-x | meson_post_install.py | 20 | ||||
-rw-r--r-- | utils/meson.build | 1 |
3 files changed, 26 insertions, 1 deletions
diff --git a/meson.build b/meson.build index af6bf20..a20eedd 100644 --- a/meson.build +++ b/meson.build @@ -192,6 +192,12 @@ configure_file( configuration: config_h, ) +meson.add_install_script( + 'meson_post_install.py', + get_option('bindir'), + enable_bash_completion ? bash_completion_completionsdir : '', +) + summary({ 'compiler': cc.get_id(), 'cflags': cc_flags, diff --git a/meson_post_install.py b/meson_post_install.py new file mode 100755 index 0000000..630e16b --- /dev/null +++ b/meson_post_install.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2021 IƱigo Martinez <inigomartinez@gmail.com> + +import os +import subprocess +import sys + +prefix = os.environ['MESON_INSTALL_DESTDIR_PREFIX'] + +bindir = os.path.join(prefix, sys.argv[1]) +subprocess.check_call(['chmod', '755', os.path.join(bindir, 'mbim-network')]) + +bash_completion_completionsdir = sys.argv[2] +if bash_completion_completionsdir: + if not os.path.isabs(bash_completion_completionsdir): + bash_completion_completionsdir = os.path.join(prefix, bash_completion_completionsdir) + os.rename(os.path.join(bash_completion_completionsdir, 'mbimcli-completion'), + os.path.join(bash_completion_completionsdir, 'mbimcli')) diff --git a/utils/meson.build b/utils/meson.build index 280afab..24412a6 100644 --- a/utils/meson.build +++ b/utils/meson.build @@ -6,5 +6,4 @@ mbim_network = configure_file( output: '@BASENAME@', configuration: version_conf, install_dir: mbim_bindir, - install_mode: 'rwxr-xr-x', ) |