Andrew Geissler | 89770b0 | 2020-06-13 10:40:47 -0500 | [diff] [blame^] | 1 | From 76c23503ed1002d3aad0118795006fe2128006ae Mon Sep 17 00:00:00 2001 |
| 2 | From: Ting-Wei Lan <lantw@src.gnome.org> |
| 3 | Date: Sat, 21 Mar 2020 22:13:57 +0800 |
| 4 | Subject: [PATCH] generate-version-script: Don't hard-code the path of python3 |
| 5 | |
| 6 | Python can be installed in different directories on different operating |
| 7 | systems, so we can't hard-code the path of it. Instead, use meson to |
| 8 | find it to avoid 'no such file or directory' error on the bad path. |
| 9 | |
| 10 | Upstream-Status: Backport [https://github.com/hughsie/libgusb/pull/36] |
| 11 | Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> |
| 12 | --- |
| 13 | contrib/generate-version-script.py | 1 - |
| 14 | gusb/meson.build | 4 ++++ |
| 15 | 2 files changed, 4 insertions(+), 1 deletion(-) |
| 16 | mode change 100755 => 100644 contrib/generate-version-script.py |
| 17 | |
| 18 | diff --git a/contrib/generate-version-script.py b/contrib/generate-version-script.py |
| 19 | old mode 100755 |
| 20 | new mode 100644 |
| 21 | index c4ee238ab0ab..0fe2b24e47e3 |
| 22 | --- a/contrib/generate-version-script.py |
| 23 | +++ b/contrib/generate-version-script.py |
| 24 | @@ -1,4 +1,3 @@ |
| 25 | -#!/usr/bin/python3 |
| 26 | # pylint: disable=invalid-name,missing-docstring |
| 27 | # |
| 28 | # Copyright (C) 2017 Richard Hughes <richard@hughsie.com> |
| 29 | diff --git a/gusb/meson.build b/gusb/meson.build |
| 30 | index 10a6f537a642..28ca3c63e595 100644 |
| 31 | --- a/gusb/meson.build |
| 32 | +++ b/gusb/meson.build |
| 33 | @@ -142,6 +142,9 @@ libgusb_girtarget = gnome.generate_gir(gusb, |
| 34 | libgusb_gir = libgusb_girtarget[0] |
| 35 | libgusb_typelib = libgusb_girtarget[1] |
| 36 | |
| 37 | +pymod = import('python') |
| 38 | +py_installation = pymod.find_installation('python3') |
| 39 | + |
| 40 | # Verify the map file is correct -- note we can't actually use the generated |
| 41 | # file for two reasons: |
| 42 | # |
| 43 | @@ -154,6 +157,7 @@ mapfile_target = custom_target('gusb_mapfile', |
| 44 | input: libgusb_girtarget[0], |
| 45 | output: 'libgusb.ver', |
| 46 | command: [ |
| 47 | + py_installation, |
| 48 | join_paths(meson.source_root(), 'contrib', 'generate-version-script.py'), |
| 49 | 'LIBGUSB', |
| 50 | '@INPUT@', |
| 51 | -- |
| 52 | 2.17.1 |
| 53 | |