|
| 1 | + |
| 2 | +## Development Dependencies |
| 3 | + |
| 4 | +- `git` |
| 5 | +- `dotnet-sdk-10.0` |
| 6 | +- `ffmpeg` (<7) |
| 7 | +- `rust` & `cargo` (<1.80) (macOS only, the rest use SharpCapture) |
| 8 | +- `clang` |
| 9 | +- `zlib-devel` |
| 10 | + |
| 11 | +#### IDE of Choice |
| 12 | + |
| 13 | +JetBrains Rider is the recommended IDE. It works on Linux, Windows, and macOS. It's free for noncommercial use. |
| 14 | + |
| 15 | +<a href="https://www.jetbrains.com/rider/" target="_blank"> |
| 16 | + <img |
| 17 | + src="https://github.com/user-attachments/assets/96b8e44e-47b3-4850-b4f3-c4e7ed8dd385" |
| 18 | + alt="JetBrains Rider - The world's most loved .NET and game dev IDE" |
| 19 | + title="JetBrains Rider - The world's most loved .NET and game dev IDE" |
| 20 | + style="width: 400px; height: auto;" |
| 21 | + /> |
| 22 | +</a> |
| 23 | + |
| 24 | +### Fedora 42+ 🌟 |
| 25 | + |
| 26 | +```bash |
| 27 | +sudo dnf in -y git dotnet-sdk-aot-10.0 /usr/bin/ffmpeg |
| 28 | +``` |
| 29 | + |
| 30 | +### Ubuntu 24.04+ ⚡ |
| 31 | + |
| 32 | +```bash |
| 33 | +sudo apt update && sudo apt install -y software-properties-common |
| 34 | +sudo add-apt-repository ppa:dotnet/backports -y # Ubuntu 24.04 doesn't have .NET 10 packaged. Do not add this PPA on Ubuntu 24.10+ |
| 35 | +sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg8 -y # Ubuntu 24.04 doesn't have FFMPEG 7 packaged. |
| 36 | +sudo apt install -y git dotnet-sdk-10.0 ffmpeg clang zlib1g-dev libsm6 |
| 37 | +``` |
| 38 | + |
| 39 | + |
| 40 | +### Windows 10 22H2+ 🪟 |
| 41 | + |
| 42 | +End of life Windows versions are not supported. For example, Windows 11 22H2 is at its EOL and, thus, unsupported. |
| 43 | + |
| 44 | +SnapX now uses the Windows SDK to generate C# Windows API binding code. |
| 45 | +You need the Windows 11 SDK `10.0.26100.0`. |
| 46 | +It works on Windows 10, too. |
| 47 | + |
| 48 | +```shell |
| 49 | +# Installing Visual Studio Community |
| 50 | +# You cannot build with NativeAOT without it on Windows. It has the linker program. However, you can compile on Rider or whatever your favorite IDE is after you've installed Visual Studio. |
| 51 | +# See https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot |
| 52 | +winget install --id Microsoft.VisualStudio.2022.Community --override "--quiet --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.Windows11SDK.26100 --includeRecommended" |
| 53 | +winget install -e --id Git.Git |
| 54 | +# Install Rider (optional) |
| 55 | +winget install -e --id JetBrains.Rider |
| 56 | +``` |
| 57 | + |
| 58 | +### macOS 14 Sonoma+ 🍎 |
| 59 | + |
| 60 | +End of life macOS versions are not supported. For example, macOS 13 Ventura is at its EOL and thus, unsupported. |
| 61 | + |
| 62 | +> Using the script to install the .NET SDK from the .NET team ensures you don't run into issues of Rider not detecting it. |
| 63 | +
|
| 64 | +```zsh |
| 65 | +xcode-select --install |
| 66 | +brew install ffmpeg@8 rust |
| 67 | +git --version # If prompted to install Git, do it. |
| 68 | +exec $SHELL -l |
| 69 | +``` |
| 70 | + |
| 71 | +> [!TIP] |
| 72 | +> If you're using MacPorts, run this instead of `brew install`: |
| 73 | +> |
| 74 | +> ```zsh |
| 75 | +> sudo port selfupdate |
| 76 | +> sudo port install ffmpeg8 cargo |
| 77 | +> ``` |
| 78 | +
|
| 79 | +### Alpine Linux 3.23+ |
| 80 | +
|
| 81 | +```bash |
| 82 | +sudo apk update |
| 83 | +# Only need to install dependencies of .NET, the build script installs the .NET version we're using automatically. |
| 84 | +sudo apk add bash icu-libs krb5-libs libgcc libintl libssl3 libstdc++ zlib |
| 85 | +``` |
| 86 | +
|
| 87 | +### FreeBSD 14+ |
| 88 | + |
| 89 | +```bash |
| 90 | +# Install required system dependencies |
| 91 | +sudo pkg install -y curl bash icu terminfo-db libunwind libinotify \ |
| 92 | + brotli openssl lttng-ust krb5 llvm21 sqlite3 sudo patchelf git \ |
| 93 | + flock xorg xorg-vfbserver dbus glx-utils pciutils dmidecode \ |
| 94 | + cmake rust-coreutils gawk onnxruntime |
| 95 | + |
| 96 | +sudo mkdir -p /usr/lib/dotnet |
| 97 | + |
| 98 | +# Download the community-built .NET 10 SDK for FreeBSD |
| 99 | +curl -L -o /tmp/dotnet.tar.gz https://github.com/Thefrank/dotnet-freebsd-crossbuild/releases/download/v10.0.102-sb1-amd64-freebsd-14/dotnet-sdk-10.0.102-freebsd-x64.tar.gz |
| 100 | + |
| 101 | +# Extract the SDK |
| 102 | +sudo tar -xzf /tmp/dotnet.tar.gz -C /usr/lib/dotnet --strip-components=1 |
| 103 | +rm /tmp/dotnet.tar.gz |
| 104 | + |
| 105 | +sudo ln -sf /usr/lib/dotnet/dotnet /usr/local/bin/dotnet |
| 106 | +sudo ln -sf /usr/lib/dotnet/dnx /usr/local/bin/dnx 2>/dev/null || true |
| 107 | + |
| 108 | +# Add the FreeBSD-specific NuGet source for runtime compatibility |
| 109 | +dotnet nuget add source https://pkgs.dev.azure.com/IFailAt/freebsd-dotnet-runtime-nightly/_packaging/freebsd-dotnet/nuget/v3/index.json --name freebsd-dotnet |
| 110 | + |
| 111 | +# Install SkiaSharp/HarfBuzzSharp |
| 112 | +curl -L -o /tmp/libskiasharp.pkg https://github.com/SnapXL/freebsd-libskiasharp3/releases/download/3.119.1/libskiasharp-3.119.1_1-amd64.pkg |
| 113 | +sudo pkg install -y /tmp/libskiasharp.pkg |
| 114 | +rm /tmp/libskiasharp.pkg |
| 115 | + |
| 116 | +# Install FFmpeg 8 and xvfb-run utility |
| 117 | +curl -fsSL https://github.com/Thefrank/ffmpeg-static-freebsd/releases/download/v8.0/ffmpeg -o /usr/local/bin/ffmpeg |
| 118 | +sudo chmod +x /usr/local/bin/ffmpeg |
| 119 | + |
| 120 | +curl -fsSL http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh -o /usr/local/bin/xvfb-run |
| 121 | +sudo chmod +x /usr/local/bin/xvfb-run |
| 122 | + |
| 123 | +# Verify installation |
| 124 | +dotnet --info |
| 125 | +``` |
| 126 | + |
| 127 | +## Building from Source |
| 128 | + |
| 129 | +### System Requirements for Compiling |
| 130 | + |
| 131 | +To successfully compile SnapX from source, ensure your system meets the following requirements: |
| 132 | + |
| 133 | +* **Memory (RAM):** A minimum of **8 GiB** free memory is required during the compilation process. |
| 134 | +* **Disk Space:** At least **15 GiB** of free disk space is recommended, preferably on a Solid State Drive (SSD) for optimal compilation speed. |
| 135 | + |
| 136 | +```bash |
| 137 | +git clone https://github.com/SnapXL/SnapX |
| 138 | +cd SnapX |
| 139 | +./build.sh # Linux/macOS |
| 140 | +.\build.ps1 # Windows |
| 141 | +Output/snapx-ui/snapx-ui # Run SnapX.Avalonia |
| 142 | +# Nothing is stopping you from using regular .NET building tools. |
| 143 | +# dotnet publish -c Release ./SnapX.slnx |
| 144 | +# SnapX.Avalonia/bin/Release/net10.0/linux-x64/publish/snapx-ui |
| 145 | +``` |
0 commit comments