From 6f250cbb893238ec6f956db5f07597823fac4d8c Mon Sep 17 00:00:00 2001 From: Jason Pell Date: Fri, 29 Dec 2023 16:29:36 +1100 Subject: [PATCH] refactor the development.md to remove duplication and add arch specific instructions --- DEVELOPMENT.md | 70 +++++++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 27 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4e544d5..d401555 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -21,41 +21,53 @@ The Guppy Screen uses features (filesystem) from C++17, so a gcc/g++ version (7. `ZBOLT` - Define it to use the Z-Bolt icon set. By default the build uses the Material Design Icons. `GUPPYSCREEN_VERSION` - Version string displayed in the System Panel in the UI. -### Build Essentials -Based on Ubuntu/Debian, install build essentials +### Build Environment -`sudo apt-get install -y build-essential` +#### Ubuntu and Debian +For Ubuntu/Debian install build essentials and libsdl2-dev packages. -### Mipsel (Ingenic X2000E) - specific to the K1 SoC -Building for the K1/Max +`sudo apt-get install -y build-essential libsdl2-dev` + +#### Arch and Derivatives + +For Arch and derivatives install 'base-devel' and 'sdl2' packages. + +`sudo pacman -S base-devel sdl2` + +#### Mipsel Tool chain + +To build guppyscreen for Mipsel (Ingenic X2000E) - specific to the K1 SoC, you will need the mips-gcc720 tool chain. 1. Download the toolchain [here](https://github.com/ballaswag/k1-discovery/releases/download/1.0.0/mips-gcc720-glibc229.tar.gz) 2. `tar xf mips-gcc720-glibc229.tar.gz && export PATH=:$PATH` -3. `git clone --recursive https://github.com/ballaswag/guppyscreen && cd guppyscreen` -4. `unset SIMULATION && export CROSS_COMPILE=mips-linux-gnu-` -5. `(cd lv_drivers/ && git apply ../patches/0001-lv_driver_fb_ioctls.patch)` -6. `(cd spdlog/ && git apply ../patches/0002-spdlog_fmt_initializer_list.patch)` -7. `make -C wpa_supplicant/wpa_supplicant/ clean && make wpaclient` -8. `make -C libhv clean && make libhv.a` -9. `make clean && make -j$(nproc) ### executable is in ./build/bin/guppyscreen` +### The Code + +Clone the guppyscreen repo (and submodules) and apply a couple of patches locally. + +1. `git clone --recursive https://github.com/ballaswag/guppyscreen && cd guppyscreen` +2. `(cd lv_drivers/ && git apply ../patches/0001-lv_driver_fb_ioctls.patch)` +3. `(cd spdlog/ && git apply ../patches/0002-spdlog_fmt_initializer_list.patch)` + +### Mipsel (Ingenic X2000E) - specific to the K1 SoC +Building for the K1/Max + +1. `unset SIMULATION && export CROSS_COMPILE=mips-linux-gnu-` +2. `make -C wpa_supplicant/wpa_supplicant/ clean && make wpaclient` +3. `make -C libhv clean && make libhv.a` +4. `make clean && make -j$(nproc) ### executable is in ./build/bin/guppyscreen` ### x86_64 (Intel/AMD) Building and running Guppy Screen on your local machine speeds up development. Changes can tested on the local machine before rebuilding for the other architectures. -1. `sudo apt-get install -y build-essential libsdl2-dev` -2. `git clone --recursive https://github.com/ballaswag/guppyscreen && cd guppyscreen` -3. `unset CROSS_COMPILE && export SIMULATION=1` -4. `(cd lv_drivers/ && git apply ../patches/0001-lv_driver_fb_ioctls.patch)` -5. `(cd spdlog/ && git apply ../patches/0002-spdlog_fmt_initializer_list.patch)` -6. `make -C wpa_supplicant/wpa_supplicant/ clean && make wpaclient` -7. `make -C libhv clean && make libhv.a` -8. `make clean && make -j$(nproc) ### executable is in ./build/bin/guppyscreen` - +1. `unset CROSS_COMPILE && export SIMULATION=1` +2. `make -C wpa_supplicant/wpa_supplicant/ clean && make wpaclient` +3. `make -C libhv clean && make libhv.a` +4. `make clean && make -j$(nproc) ### executable is in ./build/bin/guppyscreen` ### Simulation Guppy Screen default configurations (guppyconfig.json) is configured for the K1/Max. In order to run it remotely as a simulator build, a few thing needs to be setup. -The following attributes need to be configured in `guppyconfig.json` +The following attributes need to be configured in `build/bin/guppyconfig.json` 1. `log_path` - Absolute path to `guppyscreen.log`. Directory must exists locally. 2. `thumbnail_path` - Absolute path to a local directory for storing gcode thumbnails. @@ -76,7 +88,7 @@ The following attributes need to be configured in `guppyconfig.json` } }, "thumbnail_path": "", - "wpa_supplicant": " + "wpa_supplicant": "" } ``` @@ -88,7 +100,9 @@ Note: Guppy Screen currently requires running as `root` because it directly inte It is possible to use https://github.com/mainsail-crew/virtual-klipper-printer to start a virtual printer locally to make local testing and development easier. You will need to install docker-ce and docker-compose locally. -#### Install Docker and Docker Compose +### Install Docker and Docker Compose + +#### Ubuntu and Debian You can follow the instructions to get docker and docker-compose setup on Ubuntu: https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository @@ -100,13 +114,15 @@ https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository 3. `echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null` 4. `sudo apt-get update` 5. `sudo apt-get install docker-ce docker-compose docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin` -6. `sudo usermod -a -G docker $USER` -In order to use docker without `sudo`, you will need to logout and back in so that the `docker` group assignment takes effect. +#### For Arch and Derivatives + +1. `sudo pacman -S docker docker-compose` +2. `sudo systemctl start docker` #### Build and Start 1. `git clone https://github.com/mainsail-crew/virtual-klipper-printer.git && cd virtual-klipper-printer` -2. `docker-compose up -d` +2. `sudo docker-compose up -d` You can now configure the guppyconfig.json `moonraker_host` to be `127.0.0.1` and `moonraker_port` to be 7125