runtime

Requirements to build dotnet/runtime on FreeBSD

This guide will walk you through the requirements needed to build and run dotnet/runtime on FreeBSD. We’ll start by showing how to set up your environment from scratch.

Since there is no official build and FreeBSD package, native build on FreeBSD is not trivial. There are generally three options, sorted by ease of use:

Docker

Install Docker. For further instructions on installation, see here.

All the required build tools are included in the Docker images used to do the build, so no additional setup is required.

Linux Environment

To cross-build FreeBSD on your Linux environment, first make sure you have all the normal Linux prerequisites fulfilled. Then, the crossrootfs for FreeBSD has to be constructed, and this requires a few more packages to be installed:

FreeBSD Environment

These instructions assume you use FreeBSD’s default binary package tool pkg (analog to apt, apt-get, or yum on Linux) to install the environment. Compiling the dependencies from source using the ports tree might work too, but is untested.

FreeBSD Prerequisites Coming Soon!

Meanwhile here are the old instructions.

Old Documentation

These instructions were written quite a while ago, and they may or may not work today. Updated instructions coming soon.

Toolchain Setup

Building the dotnet/runtime repo requires several tools to be installed.

Install the following packages:

sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 cmake openssl ninja

Running on FreeBSD

Install the following packages:

sudo pkg install --yes libunwind icu libinotify lttng-ust krb5 openssl terminfo-db

Extract the SDK: The canonical location for the SDK is /usr/share/dotnet

“VERSION” is the SDK version being unpacked.

sudo mkdir /usr/share/dotnet
tar xf /tmp/dotnet-sdk-VERSION-freebsd-x64.tar.gz -C /usr/share/dotnet/

NuGet Packages: The canonical location for the NuGet packages is /var/cache/nuget

“VERSION” is the same version as the SDK from above.

Add the following line to any NuGet.config you are using under the <packageSources> section:

<add key="local" value="/var/cache/nuget" />

Finally, either add /usr/share/dotnet to your PATH or create a symbolic for /usr/share/dotnet/dotnet