This repository contains tools and scripts for building and packaging the V8 JavaScript engine as a static library for different platforms on AMD64 architecture.
The build.sh
script automates the process of building V8 from the source and creating Debian packages.
- Debian-based system (tested on Debian Bookworm)
- Internet connection for downloading source code
- Root privileges for dependency installation (can use sudo)
./build.sh [--build-number <num>] [--source-dir <dir>] [--pyenv-root <dir>]
[--output-dir <dir>] [--install-deps] [--setup-pyenv] [--debug]
--build-number
: Build number for package versioning (required for V8 build)--source-dir
: Source directory containing libv8-packaging (defaults to script directory)--pyenv-root
: Path for pyenv installation (defaults to /opt/pyenv)--output-dir
: Output directory for deb packages (defaults to $HOME/DEB)--install-deps
: Install dependencies--setup-pyenv
: Setup pyenv and install the required Python version--debug
: Enable verbose debugging output--help
: Show help message
Note: When --build-number is not specified, the script will only perform the environment setup steps (install dependencies and/or setup pyenv) if requested.
To set up the required dependencies and Python environment:
sudo ./build.sh --install-deps --setup-pyenv
./build.sh --build-number 42
./build.sh --build-number 123 --output-dir /path/to/output
sudo ./build.sh --install-deps --setup-pyenv --build-number 456 --output-dir /custom/output/dir
The script can be executed in a Docker container:
docker run -it -v $(pwd):/usr/src/libv8-packaging/ debian:bookworm bash -c \
"cd /usr/src/libv8-packaging/ && bash"
Then inside the container:
./build.sh --install-deps --setup-pyenv
./build.sh --build-number 42 --output-dir /root/DEB/
The script produces Debian packages (.deb files) placed in the specified output
directory or in $HOME/DEB
by default.
- The script uses Python 2.7.18 for compatibility with V8 build tools
- V8 version 6.1.298 is built by default
You must install the "Debugging Tools for Windows" feature from the Windows 10 SDK.
https://developer.microsoft.com/windows/downloads/windows-10-sdk
For building V8 on Windows, use the build.cmd
script:
build.cmd