forked from HarbourMasters/Shipwright
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
fpasteau edited this page Apr 5, 2024
·
1 revision
Welcome to the Shipwright_R36S wiki! If someone else is willing to do an update, here is a summary of how I've compiled it. There are two ways how you can compile this code that I know of using linux:
- you can chroot into jelos/UnofficialOS root directory and compile it as if you were on a R36S console,
- you can cross compile the code using jelos/UnofficialOS root directory as SYSROOT.
Using crosscompilation is way faster than using chroot. On my computer, using chroot, it takes up to 2h to compile the code, with crosscompilation, it's more or less 40 minutes. Here are some kind of tutorial on how to do it. It's from the top of my head, so you might need to figure some part out.
- Get a jelos/UnofficialOS image and extract the files from "SYSTEM" file into jelosroot directory. It will be your system root directory.
sudo apt install binfmt-support qemu-user-static
cp /usr/bin/qemu-aarch64-static jelosroot/usr/bin/
cp /etc/resolv.conf jelosroot/etc/resolv.conf
sudo chroot jelosroot
cd root
apt install gcc g++ git cmake ninja-build lsb-release
git clone https://github.com/HarbourMasters/Shipwright.git
cd Shipwright
git submodule update --init
wget https://www.libsdl.org/release/SDL2-2.28.5.tar.gz
tar -xzf SDL2-2.28.5.tar.gz cd SDL2-2.28.5
./configure --enable-hidapi-libusb
make -j 10
make install
cp -av /usr/local/lib/libSDL* /lib/aarch64-linux-gnu/
cd ..
wget https://libzip.org/download/libzip-1.10.1.tar.gz
tar -xzvf libzip-1.10.1.tar.gz
cd libzip-1.10.1
mkdir build
cd build
cmake ..
make
make install
cd ..
wget https://www.libsdl.org/projects/SDL_net/release/SDL2_net-2.2.0.tar.gz
tar -xzf SDL2_net-2.2.0.tar.gz
cd SDL2_net-2.2.0
./configure
make -j 10
make install
cp -av /usr/local/lib/libSDL* /lib/aarch64-linux-gnu/
cd ..
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DUSE_OPENGLES=ON -DCMAKE_BUILD_TYPE:STRING=Release
cmake --build build-cmake --config Release --target GenerateSohOtr
cmake --build build-cmake --config Release -j10
- Release file are in build-cmake/soh/
- it's easier for this method to use the jelosroot directory from method 1 as SDL libraries are already installed and don't need crosscompilation.
cd jelosroot/Shipwright
rm -r build-cmake
create a file ~/crosscompile.cmake
with this content, you will need to change {jelosroot} to use your own jelosroot path:
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Linux)
# which compilers to use for C and C++
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc-12)
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++-12)
# where is the target environment located
set(CMAKE_FIND_ROOT_PATH {jelosroot})
# adjust the default behavior of the FIND_XXX() commands:
# search programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# search headers and libraries in the target environment
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_SYSROOT {jelosroot})
sudo apt install g++-12-aarch64-linux-gnu gcc-12-aarch64-linux-gnu
cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DUSE_OPENGLES=ON -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_TOOLCHAIN_FILE=~/crosscompile.cmake
cmake --build build-cmake --config Release --target GenerateSohOtr
cmake --build build-cmake --config Release -j10
- Release file are in build-cmake/soh/
I hope it will be usefull for someone.