From 7957b51cb8b7ebb62bb90041529360ab245cef72 Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Sun, 1 Mar 2020 13:18:30 -0300 Subject: [PATCH 1/2] Fixed rspy/Makefile trying to use python3 on Windows --- rspy/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rspy/Makefile b/rspy/Makefile index 76285d577..78341c7c1 100644 --- a/rspy/Makefile +++ b/rspy/Makefile @@ -1,6 +1,12 @@ SHELL := /bin/bash FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find) +ifeq ($(OS),Windows_NT) + PYTHON_BIN := python +else + PYTHON_BIN := python3 +endif + .SHELLFLAGS := -eu -o pipefail -c .DELETE_ON_ERROR: MAKEFLAGS += --warn-undefined-variables @@ -37,7 +43,7 @@ build: $(DEPS) rm -rf $(OUTDIR)/ankirspy* touch ../proto/backend.proto FTL_TEMPLATE_DIRS="$(QT_FTL_TEMPLATES)" FTL_LOCALE_DIRS="$(QT_FTL_LOCALES)" \ - maturin build -i $(shell which python3) -o $(OUTDIR) $(BUILDFLAGS) + maturin build -i $(shell which ${PYTHON_BIN}) -o $(OUTDIR) $(BUILDFLAGS) check: .build/check From 9460082a9137d6c4c0dae26def08a7920049078c Mon Sep 17 00:00:00 2001 From: evandrocoan Date: Sun, 1 Mar 2020 20:49:45 -0300 Subject: [PATCH 2/2] Allow to define a externally PYTHON_BIN and ACTIVATE_SCRIPT --- Makefile | 18 ++++++++++++++---- rspy/Makefile | 8 ++++++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d80a94f4c..8c449998a 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,21 @@ SHELL := /bin/bash ifeq ($(OS),Windows_NT) - PYTHON_BIN := python - ACTIVATE_SCRIPT := pyenv/Scripts/activate + ifndef ACTIVATE_SCRIPT + ACTIVATE_SCRIPT := pyenv/Scripts/activate + endif + + ifndef PYTHON_BIN + PYTHON_BIN := python + endif else - PYTHON_BIN := python3 - ACTIVATE_SCRIPT := pyenv/bin/activate + ifndef ACTIVATE_SCRIPT + ACTIVATE_SCRIPT := pyenv/bin/activate + endif + + ifndef PYTHON_BIN + PYTHON_BIN := python3 + endif endif ifndef ANKI_EXTRA_PIP diff --git a/rspy/Makefile b/rspy/Makefile index 78341c7c1..f3cd05ad9 100644 --- a/rspy/Makefile +++ b/rspy/Makefile @@ -2,9 +2,13 @@ SHELL := /bin/bash FIND := $(if $(wildcard /bin/find),/bin/find,/usr/bin/find) ifeq ($(OS),Windows_NT) - PYTHON_BIN := python + ifndef PYTHON_BIN + PYTHON_BIN := python + endif else - PYTHON_BIN := python3 + ifndef PYTHON_BIN + PYTHON_BIN := python3 + endif endif .SHELLFLAGS := -eu -o pipefail -c