|
1 | 1 | # Build guide |
2 | 2 |
|
3 | | -**This build guide assumes you’re using a Linux system.** |
| 3 | +_This build guide uses the [Toltec Docker toolchain](https://github.com/toltec-dev/toolchain), which requires a working Docker install._ |
4 | 4 |
|
5 | | -Download the [reMarkable toolchain](https://web.archive.org/web/20201129102245/https://remarkable.engineering/oecore-x86_64-cortexa9hf-neon-toolchain-zero-gravitas-1.8-23.9.2019.sh), install it and source it. |
6 | | - |
7 | | -```sh |
8 | | -curl https://web.archive.org/web/20201129102245/https://remarkable.engineering/oecore-x86_64-cortexa9hf-neon-toolchain-zero-gravitas-1.8-23.9.2019.sh -o install-toolchain.sh |
9 | | -chmod u+x install-toolchain.sh |
10 | | -./install-toolchain.sh |
11 | | -source /usr/local/oecore-x86_64/environment-setup-cortexa9hf-neon-oe-linux-gnueabi |
12 | | -``` |
13 | | - |
14 | | -Download the `OEToolchainConfig.cmake` file that is missing from the toolchain and install it in `/sysroots/x86_64-oesdk-linux/usr/share/cmake` directory of the toolchain. |
15 | | - |
16 | | -```sh |
17 | | -curl https://raw.githubusercontent.com/openembedded/openembedded-core/master/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake -o OEToolchainConfig.cmake |
18 | | -sudo mkdir -p /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/share/cmake |
19 | | -sudo mv OEToolchainConfig.cmake /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/share/cmake |
20 | | -``` |
21 | | - |
22 | | -Clone this repository with its dependencies and change directory into it. |
| 5 | +Start by cloning this repository with its dependencies, then change directory into it. |
23 | 6 |
|
24 | 7 | ```sh |
25 | 8 | git clone --recursive https://github.com/matteodelabre/vnsee |
26 | 9 | cd vnsee |
27 | 10 | ``` |
28 | 11 |
|
29 | | -Create a directory for build artifacts. |
| 12 | +Use the following command to spin up a container and run a build in the `build/Release` subdirectory. |
30 | 13 |
|
31 | 14 | ```sh |
32 | | -mkdir -p build/Release |
33 | | -cd build/Release |
| 15 | +docker container run -it --rm \ |
| 16 | + --mount type=bind,src="$(realpath .)",dst=/src \ |
| 17 | + ghcr.io/toltec-dev/base:v2.1 \ |
| 18 | + bash -c "cmake \ |
| 19 | + -DCMAKE_TOOLCHAIN_FILE=/usr/share/cmake/arm-linux-gnueabihf.cmake \ |
| 20 | + -DCMAKE_BUILD_TYPE=Release \ |
| 21 | + -S /src -B /src/build/Release \ |
| 22 | + && cmake --build /src/build/Release" |
34 | 23 | ``` |
35 | 24 |
|
36 | | -Run CMake configuration. |
| 25 | +This command will first run the CMake configuration command, which will automatically locate the appropriate compiler and determine flags. |
| 26 | +This step should end with the following lines: |
37 | 27 |
|
38 | | -```sh |
39 | | -cmake ../.. -DCMAKE_BUILD_TYPE=Release |
40 | 28 | ``` |
41 | | - |
42 | | -The output should not contain any error and should end with those lines: |
43 | | - |
44 | | -```txt |
| 29 | +... |
45 | 30 | -- Configuring done |
46 | 31 | -- Generating done |
47 | | --- Build files have been written to: …/vnsee/build/Release |
| 32 | +-- Build files have been written to: /src/build/Release |
48 | 33 | ``` |
49 | 34 |
|
50 | | -Run build. |
| 35 | +Right after the configuration step has finished, the command will start the actual build. |
| 36 | +You should see CMake’s colorful output logging the files it compiles, with lines similar to this one: |
51 | 37 |
|
52 | | -```sh |
53 | | -make |
| 38 | +``` |
| 39 | +... |
| 40 | +[ 16%] Building CXX object CMakeFiles/vnsee.dir/src/main.cpp.o |
| 41 | +... |
54 | 42 | ``` |
55 | 43 |
|
56 | | -You now have a `vnsee` executable ready to be executed on your reMarkable! |
| 44 | +When this step completes, you should have a working `vnsee` executable in the `build/Release` subdirectory, ready to be executed on your reMarkable! |
0 commit comments