Skip to content

Source Engine (EN)

nillerusr edited this page Jan 25, 2023 · 4 revisions

Welcome to the Source Engine wiki!

Building instructions:

Linux:

Ubuntu 18.04 (bionic) / Debian 10 (buster)

Preparing

  • Install git and clone this repository with git clone --recursive --depth 1 command. --recursive key for init and update submodules on clone, and --depth 1 key for clone only one last commit from branch.
  • Add i386 architecture to dpkg with dpkg --add-architecture i386 command.
  • Install build-essential gcc-multilib g++-multilib pkg-config ccache packages.

Required dependencies

  • libsdl2-dev:i386 libfreetype6-dev:i386 libfontconfig1-dev:i386 libopenal-dev:i386 libjpeg-dev:i386 libpng-dev:i386 libcurl4-gnutls-dev:i386 libbz2-dev:i386 libedit-dev:i386 for 64bit system.
  • You can use libcurl4-openssl-dev or libcurl4-nss-dev instead of libcurl4-gnutls-dev.
OPUS
  • If you want a voice chat support, add --enable-opus argument to WAF and follow this instructions.
  • DO NOT INSTALL DEFAULT libopus-dev PACKAGE! This build of opus doesnt contains a custom modes support!!
  • Clone latest opus sources with git clone --recursive --depth 1 https://github.com/xiph/opus command and cd to it.
  • Run sudo apt update; sudo apt install automake autoconf libtool.
  • export CFLAGS="-m32" CPPFLAGS="-m32" for 64bit system, required for 32bit engine build.
  • After basic configure script dependencies installation run ./autogen.sh && ./configure --enable-custom-modes && make -j$(nproc) && sudo make install.
  • Now you can continue build engine.

Arch Linux and Arch Linux based distros

Required dependencies

  • Install git python gcc gcc-multilib sdl2 freetype2 fontconfig zlib bzip2 libjpeg libpng curl openal opus.
  • For 32 bit install lib32-gcc-libs lib32-sdl2 lib32-freetype2 lib32-fontconfig lib32-zlib lib32-bzip2 lib32-libjpeg lib32-libpng lib32-curl lib32-openal lib32-opus
  • Follow common build instructions.

Windows

  • Install MSVC 15.9 and Windows SDK from Visual Studio Installer. Or you can install full version of Visual Studio 2017 and use his MSVC 15.9.
  • Install Python 3 and add it to Path.
  • Build works for some reason only in PowerShell.
  • Follow common build instructions.

OSX

Preparing

  • Install Xcode frop AppStore.
  • Install Xcode build tools with xcode-select --install command.
  • Install HomeBrew.

Required dependencies

BSD

FreeBSD

Required dependencies

Common build instructions (For all OS)

  • Using a WAF build system you need to install python. I've recommend to use Python 3.
  • Run ./waf configure -T BUILDMODE, where BUILDMODE is release or debug.
  • On Windows you need to use .\waf.bat or run WAF script with python3 waf.
  • If waf says something like /usr/bin/env: 'python': No such file or directory use python3 prefix before ./waf.
  • If you need a 64 bit build add -8 or --64bits argument to WAF.

Dedicated server

  • Just add -d option on project configure state. lol

Android (on Linux)

Preparing

  • Download and extract Android NDK r10e from here.
  • Download and extract CLANG 11 or use CLANG from LLVM repository for APT-based distros.
  • Run export ANDROID_NDK_HOME="PATH/TO/NDK/android-ndk-r10e" and export PATH="PATH/TO/CLANG/bin:$PATH" or export PATH="/usr/lib/llvm-11/bin:$PATH" if you're use llvm.sh script.
  • Add to WAF args --togles --android=armeabi-v7a-hard,host,21. armeabi-v7a-hard can be replaced with aarch64 for arm64 build, but you need to add -8 or --64bits argument