From 10fd1c7e9ff6c61876462d1ca83133aa7baa1024 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Tue, 25 Nov 2025 17:11:09 +0800 Subject: [PATCH] update document of build --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b8eda4f..c000831 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,75 @@ clang-format -style="{BasedOnStyle: webkit}" -i XX.c 使用默认 gofmt -# 3. misc -## 3.1. Windows remap ctrl and alt key +# 3. build environment and build (example of ubuntu) +## 3.1 build environment + +- Install nix package management tool + +```sh +sh <(curl -L https://nixos.org/nix/install) --daemon +``` + +- Edit /etc/nix/nix.conf to make sure + +``` +experimental-features = nix-command flakes +sandbox = true +sandbox-fallback = false +substituters = https://mirrors.ustc.edu.cn/nix-channels/store https://cache.nixos.org https://cache.nixos.org/ +trusted-users = root +``` + +make sure that you have restarted nix-daemon service after you have checked /etc/nix/nix.conf + +- Install socat and config ssh (for clone by ssh protocol) + +```sh +nix profile add nixpkgs#socat +``` + +.ssh/config +``` +Host gitea.shenrs.eu + HostName gitea.shenrs.eu + IdentityFile ~/.ssh/id_ed25519 + ProxyCommand socat - openssl-connect:gitea.shenrs.eu:2022,snihost=gitea.shenrs.eu,verify=0 +``` + +## 3.2 checkout source code + +## 3.3 build (for package and release) + +```sh +cd xce/src + +# for build debug version +nix build --option sandbox false .#xce_debug + +# for normal build +nix build --option sandbox false .#xce +``` + +You can find the generated binaries at =result= directory + +## 3.4 build (for daily develop) + +```sh +cd xce/src +nix develop + +# using meson to generated build configuration (debug and address sanitize) + +meson setup build --buildtype=debug -Db_sanitize=address + +# run meson to build +meson compile -C build + +# The generated files will be in build/ +``` + +# 4. misc +## 4.1. Windows remap ctrl and alt key create a reg file, e.g. remapkey.reg ``` Windows Registry Editor Version 5.00