diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..2a6037f1 --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ + +# Install on Ubuntu(-like) systems + +# Install dependencies system-wide (including python modules) +install_dependencies: + sudo -H ./setup_ubuntu.sh + +USER_ID = $(shell id -u) + +LOCAL_PATH = $(shell pwd) +LOCAL_APPS_PATH = ~/.local/share/applications +ASSEST_PATH = assets/linux + +INSTALL_PATH = /usr/share/flatcam-beta +APPS_PATH = /usr/share/applications + +install: +ifeq ($(USER_ID), 0) + @ echo "Installing it system-wide" + cp -rf $(LOCAL_PATH) $(INSTALL_PATH) + 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 + @ sed -i "s|Icon=.*|Icon=$(INSTALL_PATH)/$(ASSEST_PATH)/icon.png|g" $(APPS_PATH)/flatcam-beta.desktop +else + @ echo "Installing locally for $(USER) only" + cp -f $(ASSEST_PATH)/flatcam-beta.desktop $(LOCAL_APPS_PATH) + @ sed -i "s|Exec=.*|Exec=$(LOCAL_PATH)/$(ASSEST_PATH)/flatcam-beta|g" $(LOCAL_APPS_PATH)/flatcam-beta.desktop + @ sed -i "s|Icon=.*|Icon=$(LOCAL_PATH)/$(ASSEST_PATH)/icon.png|g" $(LOCAL_APPS_PATH)/flatcam-beta.desktop +endif + +remove: +ifeq ($(USER_ID), 0) + @ echo "Uninstalling it system-wide" + rm -rf $(INSTALL_PATH) + rm -f /usr/local/bin/flatcam-beta + rm -r $(APPS_PATH)/flatcam-beta.desktop +else + @ echo "Uninstalling only for $(USER) user" + rm -f $(LOCAL_APPS_PATH)/flatcam-beta.desktop +endif diff --git a/README.md b/README.md index c7756920..ec3f77a1 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,18 @@ sudo apt-get install python3.8-pip - run the file setup_ubuntu.sh and install all the dependencies with the command: ./setup_ubuntu.sh - if the previous command is successful and has no errors, run FlatCAM with the command: python3 FlatCAM.py +- Alternatively you can install it on Ubuntu with: +``` +# Optional if depencencies are missing +make install_dependencies + +# Install for the current user only (using the folder in its place) +make install + +# System-wide instalation +sudo make install +``` + 3. MacOS Instructions from here: https://gist.github.com/natevw/3e6fc929aff358b38c0a#gistcomment-3111878 diff --git a/assets/linux/flatcam-beta b/assets/linux/flatcam-beta new file mode 100755 index 00000000..3eed9aaa --- /dev/null +++ b/assets/linux/flatcam-beta @@ -0,0 +1,10 @@ +#!/bin/bash + +current_path=$(dirname $0) +cd $current_path +current_path=$(pwd) +cd - + +script_path=$(dirname $current_path) + +python3 $script_path/FlatCAM.py $* diff --git a/assets/linux/flatcam-beta.desktop b/assets/linux/flatcam-beta.desktop new file mode 100644 index 00000000..0b729b4f --- /dev/null +++ b/assets/linux/flatcam-beta.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Name=FlatCAM Beta +Exec=./bin/flatcam-beta +Type=Application +StartupNotify=true +Icon=./assets/icon.png +Comment=G-Code from GERBERS diff --git a/assets/linux/icon.png b/assets/linux/icon.png new file mode 100644 index 00000000..5f6d1726 Binary files /dev/null and b/assets/linux/icon.png differ diff --git a/setup_ubuntu.sh b/setup_ubuntu.sh index 50da3fdf..7700b389 100644 --- a/setup_ubuntu.sh +++ b/setup_ubuntu.sh @@ -1,9 +1,48 @@ -#!/bin/bash -sudo apt install --reinstall libpng-dev libfreetype6 libfreetype6-dev libgeos-dev libspatialindex-dev -sudo apt install --reinstall python3-dev python3-pyqt5 python3-pyqt5.qtopengl python3-gdal python3-simplejson -sudo apt install --reinstall python3-pip python3-tk +#!/bin/sh -e -sudo python3 -m pip install --upgrade pyqt5 -sudo python3 -m pip install --upgrade pip numpy shapely rtree tk lxml cycler python-dateutil kiwisolver dill -sudo python3 -m pip install --upgrade vispy pyopengl setuptools svg.path ortools freetype-py fontTools rasterio ezdxf -sudo python3 -m pip install --upgrade matplotlib qrcode reportlab svglib \ No newline at end of file +# Ubuntu packages + +sudo apt-get install -y \ + libfreetype6 \ + libfreetype6-dev \ + libgeos-dev \ + libpng-dev \ + libspatialindex-dev \ + python3-dev \ + python3-gdal \ + python3-pip \ + python3-pyqt5 \ + python3-pyqt5.qtopengl \ + python3-simplejson \ + python3-tk + + +# Python packages + +sudo -H python3 -m pip install --upgrade \ + pip \ + numpy \ + shapely \ + rtree \ + tk \ + lxml \ + cycler \ + python-dateutil \ + kiwisolver \ + dill \ + vispy \ + pyopengl \ + setuptools \ + svg.path \ + ortools \ + freetype-py \ + fontTools \ + rasterio \ + ezdxf \ + matplotlib \ + qrcode \ + pyqt5 \ + reportlab \ + svglib + +sudo -H easy_install -U distribute