Skip to content

Commit

Permalink
add python shebang fixer to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
GloriousEggroll committed Jul 7, 2024
1 parent af99f45 commit 361a363
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 $(@) )
Expand Down

0 comments on commit 361a363

Please sign in to comment.