From 361a3636c888c3519fd30045863f86707edb93d2 Mon Sep 17 00:00:00 2001 From: GloriousEggroll Date: Sun, 7 Jul 2024 09:46:42 -0600 Subject: [PATCH] add python shebang fixer to makefile --- Makefile.in | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index 88cede925..753092acf 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,21 +16,28 @@ DESTDIR ?= USERINSTALL ?= xfalse FLATPAK ?= xfalse +# Define the Python interpreter to use +PYTHON_INTERPRETER = /usr/bin/python3 .PHONY: all ifeq ($(FLATPAK), xtrue) -all: version umu umu-launcher +all: version umu umu-launcher fix_shebangs else -all: version umu umu-docs umu-launcher +all: version umu umu-docs umu-launcher fix_shebangs endif .PHONY: install ifeq ($(USERINSTALL), xtrue) -install: umu-install umu-launcher-install user-install +install: umu-install umu-launcher-install user-install fix_shebangs else -install: umu-install umu-launcher-install +install: umu-install umu-launcher-install fix_shebangs endif +fix_shebangs: + $(info :: Fixing shebangs... ) + find . -type f -name "*.py" -exec sed -i '1s|^#!/usr/bin/python|#!$(PYTHON_INTERPRETER)|' {} \; + find . -type f -name "*.py" -exec sed -i '1s|^#!/usr/bin/env python|#!/usr/bin/env python3|' {} \; + # Special case, do this inside the source directory for release distribution umu/umu_version.json: umu/umu_version.json.in $(info :: Updating $(@) )