meson: Simplify script execution

- Let Meson's find_program() do the heavy lifting.
- Make scripts executable.
- Add shebang to scripts.
This commit is contained in:
Ole André Vadla Ravnås committed 2024-04-22 23:36:08 +02:00
1 parent 1aff21e8cc
commit 64a4daece7
7 files changed
+11 -9

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
from pathlib import Path
import shutil
+1 -2
View File
@@ -38,8 +38,7 @@ custom_target('js',
input: sources,
output: outputs,
command: [
python,
files('build.py'),
find_program('build.py'),
'@OUTDIR@',
'@PRIVATE_DIR@',
npm,
+3 -6
View File
@@ -4,10 +4,8 @@ project('frida-node', 'cpp',
node = find_program('node')
npm = find_program('npm')
python = import('python').find_installation()
version = run_command(python, files('scripts' / 'detect-version.py'),
files('package.json'),
version = run_command(find_program('scripts' / 'detect-version.py'), files('package.json'),
capture: true,
check: true,
).stdout().strip()
@@ -51,7 +49,7 @@ else
endif
message('Fetching ABI bits')
metadata = run_command(python, files('scripts' / 'fetch-abi-bits.py'),
metadata = run_command(find_program('scripts' / 'fetch-abi-bits.py'),
runtime, target, gyp_os, gyp_arch,
node, npm, meson.current_build_dir(),
capture: true,
@@ -135,8 +133,7 @@ custom_target('prebuild',
input: [binding],
output: [f'frida-v@version@-@runtime@-v@abi@-@node_platform@-@[email protected]'],
command: [
python,
files('scripts' / 'package.py'),
find_program('scripts' / 'package.py'),
'@INPUT@',
'@OUTPUT@',
],
Regular → Executable
+2
View File
@@ -1,3 +1,5 @@
#!/usr/bin/env python3
import json
from pathlib import Path
import sys
Regular → Executable
+2
View File
@@ -1,3 +1,5 @@
#!/usr/bin/env python3
from dataclasses import dataclass
from io import BytesIO
import json
Regular → Executable
+2
View File
@@ -1,3 +1,5 @@
#!/usr/bin/env node
const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
Regular → Executable
View File
File mode changed.