update document of build

This commit is contained in:
Rongsong Shen 2025-11-25 17:11:09 +08:00
parent cf425dfa56
commit 10fd1c7e9f

View file

@ -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 <your account>
```
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