Skip to content

Build for GNU Linux

Daijiro Fukuda edited this page Dec 15, 2022 · 5 revisions

The following steps assume Ubuntu.

Prepare

Install dependent packages:

$ sudo apt install libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev

If freetype is not found, you may need libfreetype6-dev or libfreetype-dev.

$ sudo apt install libfreetype6-dev

Build

  1. Build the forked GLFW in which we are developing IME support: https://github.com/clear-code/glfw/tree/3.4-2022-09-21+im-support-all
$ git clone --branch=3.4-2022-09-21+im-support-all https://github.com/clear-code/glfw.git
$ cd glfw
$ cmake -B build -DCMAKE_INSTALL_PREFIX=bin
$ make -C build -j$(nproc) install
  1. Build the forked raylib in which we are developing IME support: https://github.com/clear-code/raylib/tree/4.2-2022-12-14+better-ime-support-all
$ git clone --branch=4.2-2022-12-14+better-ime-support-all https://github.com/clear-code/raylib.git
$ cd raylib
$ cmake -B build -DCMAKE_INSTALL_PREFIX=bin \
  -DUSE_EXTERNAL_GLFW=ON \
  -DCMAKE_PREFIX_PATH="{path of GLFW built in step-1}"
$ make -C build -j$(nproc) install
  1. Build and run this app
    • Set USE_EXTERNAL_GLFW ON
    • Set USE_SOFT_FULLSCREEN ON
    • Specify both of the path of GLFW built in step-1 and raylib built in step-2 to CMAKE_PREFIX_PATH
      • Ex: -DCMAKE_PREFIX_PATH="/test/glfw/bin;/test/raylib/bin;"
$ cmake -B build -DCMAKE_INSTALL_PREFIX=bin \
  -DUSE_EXTERNAL_GLFW=ON \
  -DUSE_SOFT_FULLSCREEN=ON \
  -DCMAKE_PREFIX_PATH="{path of GLFW built in step-1};{path of raylib built in step-2};"
$ make -C build -j$(nproc) install
$ bin/RaylibIMEInputSampleApp

Wayland

Basically the same, but some additional options need to be set for building GLFW and raylib.

  1. GLFW: in addition to the above steps, please set the following options as well.
    • Set GLFW_BUILD_WAYLAND ON
    • Set GLFW_BUILD_X11 OFF
$ git clone --branch=3.4-2022-09-21+im-support-all https://github.com/clear-code/glfw.git
$ cd glfw
$ cmake -B build -DCMAKE_INSTALL_PREFIX=bin -DGLFW_BUILD_WAYLAND=ON -DGLFW_BUILD_X11=OFF
$ make -C build -j$(nproc) install
  1. raylib: in addition to the above steps, please set the following options as well.
    • Set USE_WAYLAND ON too
$ git clone --branch=4.2-2022-12-14+better-ime-support-all https://github.com/clear-code/raylib.git
$ cd raylib
$ cmake -B build -DCMAKE_INSTALL_PREFIX=bin \
  -DUSE_EXTERNAL_GLFW=ON \
  -DUSE_WAYLAND=ON \
  -DCMAKE_PREFIX_PATH="{path of GLFW built in step-1}"
$ make -C build -j$(nproc) install
  1. This app: no need to set additional options. Please build it as above.

Use internal GLFW for Build

We are not currently developing in this way.

  1. Build the forked raylib in which we are developing IME support: https://github.com/clear-code/raylib/tree/better-ime-support-for-internal-glfw
$ git clone --branch=better-ime-support-for-internal-glfw [email protected]:clear-code/raylib.git
$ cd raylib
$ cmake -B build -DCMAKE_INSTALL_PREFIX=bin
$ make -C build -j$(nproc) install
  1. Build and run this app
    • Specify the path of raylib built in step-1 to CMAKE_PREFIX_PATH
      • Ex: -DCMAKE_PREFIX_PATH=/test/raylib/bin
$ cmake -B build -DCMAKE_INSTALL_PREFIX=bin -DCMAKE_PREFIX_PATH={...}
$ make -C build -j$(nproc) install
$ cd bin
$ ./RaylibIMEInputSampleApp
Clone this wiki locally