vscodium/docs/howto-build.md

150 lines
3.8 KiB
Markdown
Raw Normal View History

# How to build VSCodium
2021-06-30 08:24:06 +00:00
## Table of Contents
- [Dependencies](#dependencies)
- [Linux](#dependencies-linux)
- [MacOS](#dependencies-macos)
- [Windows](#dependencies-windows)
- [Build Scripts](#build-scripts)
- [Build in Docker](#build-docker)
- [X64](#build-docker-x64)
- [ARM 32bits](#build-docker-arm32)
- [Build Snap](#build-snap)
2022-06-19 10:08:28 +00:00
- [Patch Update Process](#patch-update-process)
- [Semi-Automated](#patch-update-process-semiauto)
- [Manual](#patch-update-process-manual)
2021-06-30 08:24:06 +00:00
## <a id="dependencies"></a>Dependencies
2022-04-19 20:55:02 +00:00
- node 16
2021-06-30 08:24:06 +00:00
- yarn
- jq
2021-08-23 03:05:01 +00:00
- git
2021-06-30 08:24:06 +00:00
### <a id="dependencies-linux"></a>Linux
- GCC
- make
- pkg-config
2021-06-30 08:24:06 +00:00
- libx11-dev
- libxkbfile-dev
- libsecret-1-dev
- fakeroot
- rpm
- rpmbuild
- dpkg
- python3
- imagemagick (for AppImage)
2021-06-30 08:24:06 +00:00
### <a id="dependencies-macos"></a>MacOS
2023-04-02 22:09:32 +00:00
- imagemagick
- png2icns (`npm install png2icns -g`)
- librsvg
2021-06-30 08:24:06 +00:00
### <a id="dependencies-windows"></a>Windows
- powershell
- sed
- 7z
- [WiX Toolset](http://wixtoolset.org/releases/)
2022-05-07 07:50:30 +00:00
- python3
- 'Tools for Native Modules' from official Node.js installer
2021-06-30 08:24:06 +00:00
## <a id="build-scripts"></a>Build Scripts
2022-08-29 13:13:25 +00:00
A build helper script can be found at `build/build.sh`.
2021-06-30 08:24:06 +00:00
2022-08-29 13:13:25 +00:00
- Linux: `./build/build.sh`
- MacOS: `./build/build.sh`
- Windows: `powershell -ExecutionPolicy ByPass -File .\build\build.ps1` or `"C:\Program Files\Git\bin\bash.exe" ./build/build.sh`
### Insider
The `insider` version can be built with `./build/build.sh -i` on the `insider` branch.
You can try the lastest version with the command `./build/build.sh -il` but the patches might not be up to date.
2021-06-30 08:24:06 +00:00
## <a id="build-docker"></a>Build in Docker
To build for Linux, you can alternatively build VSCodium in docker
### <a id="build-docker-x64"></a>X64
2021-06-30 08:24:06 +00:00
Firstly, create the container with:
```
docker run -ti --volume=<local vscodium source>:/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-x64 bash
```
like
```
docker run -ti --volume=$(pwd):/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-x64 bash
```
2021-06-30 08:24:06 +00:00
When inside the container, you can use the following commands to build:
```
cd /root/vscodium
2021-06-30 08:24:06 +00:00
./build/build.sh
```
### <a id="build-docker-arm32"></a>ARM 32bits
Firstly, create the container with:
```
docker run -ti --volume=<local vscodium source>:/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-armhf bash
```
like
```
docker run -ti --volume=$(pwd):/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-armhf bash
```
When inside the container, you can use the following commands to build:
```
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs desktop-file-utils
cd /root/vscodium
./build/build.sh
```
2022-06-19 10:08:28 +00:00
## <a id="build-snap"></a>Build Snap
```
# for the stable version
cd ./stores/snapcraft/stable
# for the insider version
cd ./stores/snapcraft/insider
# create the snap
snapcraft --use-lxd
# verify the snap
review-tools.snap-review --allow-classic codium*.snap
```
2022-06-19 10:08:28 +00:00
## <a id="patch-update-process"></a>Patch Update Process
## <a id="patch-update-process-semiauto"></a>Semi-Automated
- run `./build/build_<os>.sh`, if a patch is failing then,
- run `./build/update_patches.sh`
- when the script pause at `Press any key when the conflict have been resolved...`, open `vscode` directory in **VSCodium**
- fix all the `*.rej` files
- run `yarn watch`
- run `./script/code.sh` until everything ok
- press any key to continue the script `update_patches.sh`
## <a id="patch-update-process-manual"></a>Manual
2022-06-19 10:08:28 +00:00
- run `./build/build_<os>.sh`, if a patch is failing then,
- open `vscode` directory in **VSCodium**
2022-06-19 10:08:28 +00:00
- revert all changes
- run `git apply --reject ../patches/<name>.patch`
- fix all the `*.rej` files
- run `yarn watch`
- run `./script/code.sh` until everything ok
- run `git diff > ../patches/<name>.patch`