mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-07 16:04:19 +01:00
2.6 KiB
2.6 KiB
Get the source code
git clone git@github.com:siyuan-note/siyuan.git- Switch to dev branch
git checkout dev
NPM dependencies
Install pnpm: npm install -g pnpm@10.28.2
For China mainland
Set the Electron mirror environment variable and install Electron:
- macOS/Linux:
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@39.5.1 -D - Windows:
SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/pnpm install electron@39.5.1 -D
NPM mirror:
- Use npmmirror China mirror repository
pnpm --registry https://registry.npmmirror.com/ i - Revert to using official repository
pnpm --registry https://registry.npmjs.org i
Enter the app folder and execute:
pnpm install electron@39.5.1 -Dpnpm run devpnpm run start
Note: In the development environment, the kernel process will not be automatically started, and you need to manually start the kernel process first.
Kernel
- Install the latest version of golang
- Open CGO support, that is, configure the environment variable
CGO_ENABLED=1
Desktop
cd kernel- Windows:
go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe" - Linux/macOS:
go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel" cd ../app/kernel- Windows:
./SiYuan-Kernel.exe --wd=.. --mode=dev - Linux/macOS:
./SiYuan-Kernel --wd=.. --mode=dev
iOS
cd kernelgomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/- https://github.com/siyuan-note/siyuan-ios
Android
cd kernelset JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8gomobile bind --tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/- https://github.com/siyuan-note/siyuan-android
Harmony
Only support compilation under Linux, need to install Harmony SDK, and need to modify Go source code.
cd kernel/harmony./build.sh(./build-win.shfor Windows Emulator)- https://github.com/siyuan-note/siyuan-harmony
Modify Go source code:
-
go/src/runtime/vim tls_arm64.s
Change the ending
DATA runtime·tls_g+0(SB)/8, $16toDATA runtime·tls_g+0(SB)/8, $-144 -
go/src/runtime/cgo/gcc_android.c
Clear the inittls function
inittls(void **tlsg, void **tlsbase) { return; } -
go/src/net/cgo_resold.go
C.size_t(len(b))toC.socklen_t(len(b))
For other details, please refer to https://github.com/siyuan-note/siyuan/issues/13184