Mentions légales du service

Skip to content
Snippets Groups Projects
Verified Commit fb3213ed authored by Mattéo Delabre's avatar Mattéo Delabre
Browse files

Simplify build

parent 094d6c0d
No related branches found
No related tags found
No related merge requests found
[submodule "libvncserver"]
path = libvncserver
url = https://github.com/LibVNC/libvncserver
# Building
## Preparation
Download the [reMarkable toolchain](https://remarkable.engineering/), install it and source it.
```sh
curl https://remarkable.engineering/oecore-x86_64-cortexa9hf-neon-toolchain-zero-gravitas-1.8-23.9.2019.sh -o install-toolchain.sh
chmod u+x install-toolchain.sh
./install-toolchain.sh
source /usr/local/oecore-x86_64/environment-setup-cortexa9hf-neon-oe-linux-gnueabi
```
Clone this repository and change directory into it.
Clone this repository with its dependencies and change directory into it.
```sh
git clone git@forge.delab.re:matteo/rmvncclient.git
git clone --recursive git@forge.delab.re:matteo/rmvncclient.git
cd rmvncclient
```
Create a directory for build artifacts.
```sh
mkdir build
cd build
```
## Build `libvncserver`
In this section, we will build `libvncserver`, which is a required dependency of `rmvncclient`, for the reMarkable.
Firstly, clone the repository and change directory into it.
```sh
git clone https://github.com/LibVNC/libvncserver
cd libvncserver
```
Change the first four lines in `libvncclient.pc.cmakein` to the following.
```pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/include
```
Create a directory in which build artifacts for `libvncserver` will be placed.
```sh
mkdir -p build/Release
cd build/Release
......@@ -52,46 +25,6 @@ cd build/Release
Run CMake configuration.
```sh
cmake ../.. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$SDKTARGETSYSROOT/usr" \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_GNUTLS=OFF
```
The output should not contain any error and should end with those lines:
```txt
-- Configuring done
-- Generating done
-- Build files have been written to: (...)/rmvncclient/build/libvncserver/build/Release
```
Run build.
```sh
make
```
Install the libraries into your system. They will be installed into the reMarkable SDK, which is safely outside of your OS package manager’s files.
```sh
sudo make install
```
## Build `rmvncclient`
Go back to the main build directory and create a new build directory for `rmvncclient` itself.
```sh
cd ../../..
mkdir Release
cd Release
```
Run CMake configuration.
```sh
cmake ../.. -DCMAKE_BUILD_TYPE=Release
```
......@@ -101,7 +34,7 @@ The output should not contain any error and should end with those lines:
```txt
-- Configuring done
-- Generating done
-- Build files have been written to: /home/matteo/Projects/rmvncclient/build/Release
-- Build files have been written to: /rmvncclient/build/Release
```
Run build.
......
......@@ -30,11 +30,7 @@ if(TRACE)
add_definitions(-DTRACE)
endif()
# Find dependencies
find_package(PkgConfig REQUIRED)
pkg_check_modules(VNCCLIENT REQUIRED IMPORTED_TARGET libvncclient)
set_property(TARGET PkgConfig::VNCCLIENT PROPERTY
INTERFACE_LINK_LIBRARIES "${VNCCLIENT_STATIC_LIBRARIES}")
add_subdirectory(libvncserver)
add_executable(rmvncclient
src/rmioc/input.cpp
......@@ -46,5 +42,8 @@ add_executable(rmvncclient
)
set_property(TARGET rmvncclient PROPERTY CXX_STANDARD 17)
target_link_libraries(rmvncclient PUBLIC PkgConfig::VNCCLIENT)
target_link_libraries(rmvncclient PRIVATE vncclient)
target_include_directories(rmvncclient PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/libvncserver
libvncserver
)
Subproject commit 8df6111290859b6f63cf9c2a091f660349c7ba35
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment