Skip to content

Commit

Permalink
meson: Invoke scripts explicitly
Browse files Browse the repository at this point in the history
To avoid issues with environments where python3 doesn't exist.

Also drop exec bit and shebang from scripts.
  • Loading branch information
oleavr committed Apr 23, 2024
1 parent b05a32d commit dff6506
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 0 additions & 2 deletions bindings/gumjs/generate-bindings.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

from __future__ import unicode_literals, print_function
import codecs
import os
Expand Down
2 changes: 0 additions & 2 deletions bindings/gumjs/generate-runtime.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

from base64 import b64decode
import json
import os
Expand Down
6 changes: 4 additions & 2 deletions bindings/gumjs/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ gumjs_generated_bindings = custom_target('gumjs-generated-bindings',
input: gumjs_generated_inputs,
output: gumjs_generated_outputs,
command: [
find_program('generate-bindings.py'),
python,
files('generate-bindings.py'),
meson.current_build_dir(),
meson.project_source_root() / 'gum',
],
Expand Down Expand Up @@ -236,7 +237,8 @@ gumjs_runtime = custom_target('gumjs-runtime',
input: gumjs_runtime_sources,
output: gumjs_runtime_outputs,
command: [
find_program('generate-runtime.py'),
python,
files('generate-runtime.py'),
meson.current_build_dir(),
'@PRIVATE_DIR@',
meson.current_source_dir(),
Expand Down
6 changes: 4 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ project('frida-gum', 'c', 'cpp',
],
)

python = import('python').find_installation()

releng = meson.global_source_root() / 'releng'
if not import('fs').exists(releng)
releng = meson.project_source_root() / 'releng'
endif

frida_version = get_option('frida_version')
if frida_version == ''
frida_version = run_command(releng / 'frida_version.py', meson.project_source_root(), check: true).stdout().strip()
frida_version = run_command(python, files(releng / 'frida_version.py'), meson.project_source_root(), check: true).stdout().strip()
endif

api_version = '1.0'
Expand Down Expand Up @@ -441,7 +443,7 @@ if get_option('devkits').length() != 0
if not static
error('Devkits can only be generated from static libraries')
endif
mkdevkit = find_program(releng / 'mkdevkit.py')
mkdevkit = [python, files(releng / 'mkdevkit.py')]
uninstalled_dir = meson.global_build_root() / 'meson-uninstalled'
devkit_options = [
'--cc', '>>>', cc.cmd_array(), '<<<',
Expand Down
4 changes: 2 additions & 2 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ else
runner = raw_runner
endif

test('gum', find_program('./run.py'),
args: runner.full_path(),
test('gum', python,
args: [files('run.py'), runner.full_path()],
timeout: 120,
)
2 changes: 0 additions & 2 deletions tests/run.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python3

import os
from pathlib import Path
import platform
Expand Down

0 comments on commit dff6506

Please sign in to comment.