diff --git a/contrib/reformat-code.py b/contrib/reformat-code.py index 65a4ac4..ff6014d 100755 --- a/contrib/reformat-code.py +++ b/contrib/reformat-code.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Copyright (C) 2017 Dell Inc. # diff --git a/efi/generate_binary.py b/efi/generate_binary.py index 443472a..a4611bb 100755 --- a/efi/generate_binary.py +++ b/efi/generate_binary.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Copyright (C) 2021 Javier Martinez Canillas # Copyright (C) 2021 Richard Hughes diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py index 6c904e5..b9b80ac 100755 --- a/efi/generate_sbat.py +++ b/efi/generate_sbat.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # # Copyright (C) 2021 Javier Martinez Canillas # Copyright (C) 2021 Richard Hughes diff --git a/efi/meson.build b/efi/meson.build index 75ade7a..008ba3d 100644 --- a/efi/meson.build +++ b/efi/meson.build @@ -1,5 +1,5 @@ -generate_sbat = find_program('generate_sbat.py', native: true) -generate_binary = find_program('generate_binary.py', native: true) +generate_sbat = [python3, files('generate_sbat.py')] +generate_binary = [python3, files('generate_binary.py')] # get source version, falling back git = find_program('git', required : false) diff --git a/meson.build b/meson.build index a5612a6..5836213 100644 --- a/meson.build +++ b/meson.build @@ -19,6 +19,13 @@ libexecdir = join_paths(prefix, get_option('libexecdir')) genpeimg = find_program ('genpeimg', required: get_option('genpeimg')) +python3path = get_option('python') +if python3path == '' + python3 = import('python').find_installation('python3') +else + python3 = find_program(python3path) +endif + efi_app_location = join_paths(libexecdir, 'fwupd', 'efi') host_cpu = host_machine.cpu_family() if host_cpu == 'x86' diff --git a/meson_options.txt b/meson_options.txt index 588ae29..5f6f521 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,3 +8,4 @@ option('efi_sbat_distro_pkgname', type : 'string', value : '', description : 'SB option('efi_sbat_distro_version', type : 'string', value : '', description : 'SBAT distribution version, e.g. fwupd-1.5.6.fc33') option('efi_sbat_distro_url', type : 'string', value : '', description : 'SBAT distribution URL, e.g. https://src.fedoraproject.org/rpms/fwupd') option('genpeimg', type : 'feature', description : 'Use genpeimg to add NX support to binaries') +option('python', type : 'string', description : 'the absolute path of the python3 binary')