Debian Codegraph @

e2e-tests/cmd/python/Makefile

raw
1 #!/bin/bash
2 # SPDX-License-Identifier: MPL-2.0
3 #
4 # libpathrs: safe path resolution on Linux
5 # Copyright (C) 2019-2025 SUSE LLC
6 # Copyright (C) 2026 Aleksa Sarai <[email protected]>
7 #
8 # This Source Code Form is subject to the terms of the Mozilla Public
9 # License, v. 2.0. If a copy of the MPL was not distributed with this
10 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
11
12 define script =
13 #!/bin/bash
14 # SPDX-License-Identifier: MPL-2.0
15 #
16 # libpathrs: safe path resolution on Linux
17 # Copyright (C) 2019-2025 SUSE LLC
18 # Copyright (C) 2026 Aleksa Sarai <[email protected]>
19 #
20 # This Source Code Form is subject to the terms of the Mozilla Public
21 # License, v. 2.0. If a copy of the MPL was not distributed with this
22 # file, You can obtain one at https://mozilla.org/MPL/2.0/.
23
24 set -Eeuo pipefail
25
26 SRC_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")"
27
28 exec "$SRC_DIR/.venv/bin/python3" "$SRC_DIR/pathrs-cmd.py" "$@"
29 endef
30
31 .ONESHELL:
32
33 .PHONY: pathrs-cmd
34 pathrs-cmd: .venv
35 cat >$@ <<'EOF'
36 $(value script)
37 EOF
38 chmod +x $@
39
40 .PHONY: .venv
41 .venv:
42 python3 -m venv $@
43 make -C ../../../contrib/bindings/python
44 $@/bin/pip3 install --force ../../../contrib/bindings/python/dist/*.whl