2023-11-02 04:36:13 -04:00
|
|
|
# How to build VSCodium
|
2021-06-30 04:24:06 -04:00
|
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
|
|
|
- [Dependencies](#dependencies)
|
|
|
|
- [Linux](#dependencies-linux)
|
|
|
|
- [MacOS](#dependencies-macos)
|
|
|
|
- [Windows](#dependencies-windows)
|
|
|
|
- [Build Scripts](#build-scripts)
|
|
|
|
- [Build in Docker](#build-docker)
|
2022-06-20 04:34:50 -04:00
|
|
|
- [X64](#build-docker-x64)
|
|
|
|
- [ARM 32bits](#build-docker-arm32)
|
2022-09-05 09:19:04 -04:00
|
|
|
- [Build Snap](#build-snap)
|
2022-06-19 06:08:28 -04:00
|
|
|
- [Patch Update Process](#patch-update-process)
|
2022-06-20 04:34:50 -04:00
|
|
|
- [Semi-Automated](#patch-update-process-semiauto)
|
|
|
|
- [Manual](#patch-update-process-manual)
|
2021-06-30 04:24:06 -04:00
|
|
|
|
|
|
|
## <a id="dependencies"></a>Dependencies
|
|
|
|
|
2024-02-06 18:51:19 -05:00
|
|
|
- node 18.15
|
2021-06-30 04:24:06 -04:00
|
|
|
- yarn
|
|
|
|
- jq
|
2021-08-22 23:05:01 -04:00
|
|
|
- git
|
2024-02-06 18:51:19 -05:00
|
|
|
- python3 3.11
|
2021-06-30 04:24:06 -04:00
|
|
|
|
|
|
|
### <a id="dependencies-linux"></a>Linux
|
|
|
|
|
2024-02-06 18:51:19 -05:00
|
|
|
- gcc
|
|
|
|
- g++
|
2021-12-12 16:08:34 -05:00
|
|
|
- make
|
|
|
|
- pkg-config
|
2021-06-30 04:24:06 -04:00
|
|
|
- libx11-dev
|
|
|
|
- libxkbfile-dev
|
|
|
|
- libsecret-1-dev
|
2024-02-06 18:51:19 -05:00
|
|
|
- libkrb5-dev
|
2021-06-30 04:24:06 -04:00
|
|
|
- fakeroot
|
|
|
|
- rpm
|
2021-07-23 03:48:52 -04:00
|
|
|
- rpmbuild
|
|
|
|
- dpkg
|
2021-12-12 16:08:34 -05:00
|
|
|
- imagemagick (for AppImage)
|
2024-02-07 09:18:32 -05:00
|
|
|
- snapcraft
|
2021-06-30 04:24:06 -04:00
|
|
|
|
|
|
|
### <a id="dependencies-macos"></a>MacOS
|
2023-04-02 18:09:32 -04:00
|
|
|
|
2024-02-06 18:51:19 -05:00
|
|
|
see [the common dependencies](#dependencies)
|
2021-06-30 04:24:06 -04:00
|
|
|
|
|
|
|
### <a id="dependencies-windows"></a>Windows
|
|
|
|
|
|
|
|
- powershell
|
|
|
|
- sed
|
2021-09-08 19:38:07 -04:00
|
|
|
- 7z
|
|
|
|
- [WiX Toolset](http://wixtoolset.org/releases/)
|
2024-02-06 18:51:19 -05:00
|
|
|
- 'Tools for Native Modules' from the official Node.js installer
|
2021-06-30 04:24:06 -04:00
|
|
|
|
|
|
|
## <a id="build-scripts"></a>Build Scripts
|
|
|
|
|
2022-08-29 09:13:25 -04:00
|
|
|
A build helper script can be found at `build/build.sh`.
|
2021-06-30 04:24:06 -04:00
|
|
|
|
2022-08-29 09:13:25 -04: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.
|
|
|
|
|
2023-11-07 13:20:49 -05:00
|
|
|
You can try the latest version with the command `./build/build.sh -il` but the patches might not be up to date.
|
2021-06-30 04:24:06 -04:00
|
|
|
|
2024-02-06 18:51:19 -05:00
|
|
|
### Flags
|
|
|
|
|
|
|
|
The script `build/build.sh` provides several flags:
|
|
|
|
|
|
|
|
- `-i`: build the Insiders version
|
|
|
|
- `-l`: build with latest version of Visual Studio Code
|
|
|
|
- `-o`: skip the build step
|
|
|
|
- `-p`: generate the packages/assets/installers
|
|
|
|
- `-s`: do not retrieve the source code of Visual Studio Code, it won't delete the existing build
|
|
|
|
|
2021-06-30 04:24:06 -04:00
|
|
|
## <a id="build-docker"></a>Build in Docker
|
|
|
|
|
|
|
|
To build for Linux, you can alternatively build VSCodium in docker
|
|
|
|
|
2022-06-20 04:34:50 -04:00
|
|
|
### <a id="build-docker-x64"></a>X64
|
2022-05-14 12:44:59 -04:00
|
|
|
|
2021-06-30 04:24:06 -04: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
|
|
|
|
```
|
2022-08-05 07:09:02 -04:00
|
|
|
like
|
|
|
|
```
|
|
|
|
docker run -ti --volume=$(pwd):/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-x64 bash
|
|
|
|
```
|
2021-06-30 04:24:06 -04:00
|
|
|
|
|
|
|
When inside the container, you can use the following commands to build:
|
|
|
|
```
|
2022-05-14 12:44:59 -04:00
|
|
|
cd /root/vscodium
|
2021-06-30 04:24:06 -04:00
|
|
|
|
2023-08-04 11:51:58 -04:00
|
|
|
./build/build.sh
|
2021-10-27 21:37:44 -04:00
|
|
|
```
|
2022-05-14 12:44:59 -04:00
|
|
|
|
2022-06-20 04:34:50 -04:00
|
|
|
### <a id="build-docker-arm32"></a>ARM 32bits
|
2022-05-14 12:44:59 -04:00
|
|
|
|
|
|
|
Firstly, create the container with:
|
|
|
|
```
|
2023-08-04 11:51:58 -04:00
|
|
|
docker run -ti --volume=<local vscodium source>:/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-armhf bash
|
2022-05-14 12:44:59 -04:00
|
|
|
```
|
2022-08-05 07:09:02 -04:00
|
|
|
like
|
|
|
|
```
|
2023-08-04 11:51:58 -04:00
|
|
|
docker run -ti --volume=$(pwd):/root/vscodium --name=vscodium-build-agent vscodium/vscodium-linux-build-agent:bionic-armhf bash
|
2022-08-05 07:09:02 -04:00
|
|
|
```
|
2022-05-14 12:44:59 -04:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-08-04 11:51:58 -04:00
|
|
|
./build/build.sh
|
2022-05-14 12:44:59 -04:00
|
|
|
```
|
2022-06-19 06:08:28 -04:00
|
|
|
|
2022-09-05 09:19:04 -04: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 06:08:28 -04:00
|
|
|
## <a id="patch-update-process"></a>Patch Update Process
|
|
|
|
|
2022-06-20 04:34:50 -04:00
|
|
|
## <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`
|
2023-11-07 13:20:49 -05:00
|
|
|
- when the script pauses at `Press any key when the conflict have been resolved...`, open `vscode` directory in **VSCodium**
|
2022-06-20 04:34:50 -04:00
|
|
|
- fix all the `*.rej` files
|
|
|
|
- run `yarn watch`
|
2023-11-07 13:20:49 -05:00
|
|
|
- run `./script/code.sh` until everything is ok
|
2022-06-20 04:34:50 -04:00
|
|
|
- press any key to continue the script `update_patches.sh`
|
|
|
|
|
|
|
|
## <a id="patch-update-process-manual"></a>Manual
|
|
|
|
|
2022-06-19 06:08:28 -04:00
|
|
|
- run `./build/build_<os>.sh`, if a patch is failing then,
|
2022-06-20 04:34:50 -04:00
|
|
|
- open `vscode` directory in **VSCodium**
|
2022-06-19 06:08:28 -04:00
|
|
|
- revert all changes
|
|
|
|
- run `git apply --reject ../patches/<name>.patch`
|
|
|
|
- fix all the `*.rej` files
|
|
|
|
- run `yarn watch`
|
2023-11-07 13:20:49 -05:00
|
|
|
- run `./script/code.sh` until everything is ok
|
2022-06-19 06:08:28 -04:00
|
|
|
- run `git diff > ../patches/<name>.patch`
|
2024-02-06 18:51:19 -05:00
|
|
|
|
|
|
|
### <a id="icons"></a>icons/build_icons.sh
|
|
|
|
|
|
|
|
To run `icons/build_icons.sh`, you will need:
|
|
|
|
|
|
|
|
- imagemagick
|
|
|
|
- png2icns (`npm install png2icns -g`)
|
|
|
|
- librsvg
|