diff --git a/Makefile.in b/Makefile.in index 88cede925..e46d28c79 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: + @echo "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 $(@) )