From 392d93aa0548c1f2f2b5fe6f607d230e9ac3736a Mon Sep 17 00:00:00 2001 From: Leandro Date: Mon, 27 Apr 2020 15:22:12 -0300 Subject: [PATCH 1/3] Fix script path --- Makefile | 1 + assets/linux/flatcam-beta | 11 +++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 2a6037f1..19ed9735 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ install: ifeq ($(USER_ID), 0) @ echo "Installing it system-wide" cp -rf $(LOCAL_PATH) $(INSTALL_PATH) + @ sed -i "s|python_script_path=.*|python_script_path=$(INSTALL_PATH)|g" $(INSTALL_PATH)/assets/linux/flatcam-beta ln -sf $(INSTALL_PATH)/assets/linux/flatcam-beta /usr/local/bin cp -f $(ASSEST_PATH)/flatcam-beta.desktop $(APPS_PATH) @ sed -i "s|Exec=.*|Exec=$(INSTALL_PATH)/$(ASSEST_PATH)/flatcam-beta|g" $(APPS_PATH)/flatcam-beta.desktop diff --git a/assets/linux/flatcam-beta b/assets/linux/flatcam-beta index 3eed9aaa..92f18f39 100755 --- a/assets/linux/flatcam-beta +++ b/assets/linux/flatcam-beta @@ -1,10 +1,5 @@ #!/bin/bash -current_path=$(dirname $0) -cd $current_path -current_path=$(pwd) -cd - - -script_path=$(dirname $current_path) - -python3 $script_path/FlatCAM.py $* +script_path=$(readlink -f $0) +python_script_path=$(dirname $script_path)/../../ +python3 $python_script_path/FlatCAM.py $* From 8b9a3885eb9ee7e48e17cf7eac071827aa117734 Mon Sep 17 00:00:00 2001 From: Leandro Date: Mon, 27 Apr 2020 16:55:03 -0300 Subject: [PATCH 2/3] Add minium python version check --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 19ed9735..c3738950 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,14 @@ ASSEST_PATH = assets/linux INSTALL_PATH = /usr/share/flatcam-beta APPS_PATH = /usr/share/applications +MIN_PY3_MINOR_VERSION := 5 +PY3_MINOR_VERSION := $(shell python3 --version | cut -d'.' -f2) + +ifneq ($(MIN_PY3_MINOR_VERSION), $(firstword $(sort $(PY3_MINOR_VERSION) $(MIN_PY3_MINOR_VERSION)))) + $(info Current python version is "3.$(PY3_MINOR_VERSION)") + $(error You must have at least 3.$(MIN_PY3_MINOR_VERSION) installed) +endif + install: ifeq ($(USER_ID), 0) @ echo "Installing it system-wide" From e7a42d037b230831fede1e2cd0136776900515ac Mon Sep 17 00:00:00 2001 From: Leandro Date: Mon, 27 Apr 2020 17:07:11 -0300 Subject: [PATCH 3/3] Normalize messages --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c3738950..7bda1647 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ MIN_PY3_MINOR_VERSION := 5 PY3_MINOR_VERSION := $(shell python3 --version | cut -d'.' -f2) ifneq ($(MIN_PY3_MINOR_VERSION), $(firstword $(sort $(PY3_MINOR_VERSION) $(MIN_PY3_MINOR_VERSION)))) - $(info Current python version is "3.$(PY3_MINOR_VERSION)") + $(info Current python version is 3.$(PY3_MINOR_VERSION)) $(error You must have at least 3.$(MIN_PY3_MINOR_VERSION) installed) endif