Updated Building from Source (markdown)

Joshua M. Boniface 2018-12-29 18:21:32 -05:00
parent 004ea977fe
commit 1ef24a1fec

@ -1,31 +1,42 @@
Jellyfin seeks to integrate build facilities for any desired packaging format. Instructions for the various formats can be found below.
As an alternative to using [binary packages](https://github.com/jellyfin/jellyfin/wiki/Prebuilt-Packages), you can build Jellyfin from source. This is required when [contributing to Jellyfin](https://github.com/jellyfin/jellyfin/wiki/Contributing-to-Jellyfin).
NOTE: When building from source, only cloning the full Git repository is supported, rather than using a `.zip`/`.tar` archive, in order to support submodules.
Jellyfin supports several methods of building for different platforms and instructions for all supported platforms are below.
### Debian/Ubuntu
All package builds begin with the first two steps (for Linux/OSX; alter as needed for Windows):
Debian build facilities are integrated into the repo at `debian/`.
1. Clone the repository: `git clone https://github.com/jellyfin/jellyfin.git && cd jellyfin`
2. Initialize the submodules: `git submodule update --init`
0. Install the `dotnet-sdk-2.2` package via [Microsoft's repositories](https://dotnet.microsoft.com/download/dotnet-core/2.2).
1. Run `dpkg-buildpackage -us -uc`.
2. Install the resulting `jellyfin_*.deb` file on your system.
## Docker
A huge thanks to Carlos Hernandez who created the original Debian build configuration for Emby 3.1.1.
3. Build the Docker image: `docker build -t $USERNAME/jellyfin`
## Debian Packages via Docker
3. Run the build script: `./build-deb.sh`
4. Resulting packages will be in `../jellyfin*.deb`
## Debian Packages via `dpkg-dev`
3. Add the Microsoft .NET Core repository:
```
sudo apt-get install -y apt-transport-https debhelper gnupg wget devscripts
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg
wget -qO- https://packages.microsoft.com/config/debian/9/prod.list | sudo tee /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
```
4. Install build dependencies: `sudo mk-build-deps -i`
5. Build the packages: `dpkg-buildpackage -us -uc`
### Windows (64 bit)
A pre-built windows installer will be available soon. Until then it isn't too hard to install Jellyfin from Source.
1. Install the dotnet core SDK 2.2 from [Microsoft's Webpage](https://dotnet.microsoft.com/download/dotnet-core/2.2) and [install Git for Windows](https://gitforwindows.org/)
2. Set `executionpolicy` to unrestricted.
3. Run the Jellyfin build script: `build-jellyfin.ps1`
0. Install the dotnet core SDK 2.2 from [Microsoft's Webpage](https://dotnet.microsoft.com/download/dotnet-core/2.2) and [install Git for Windows](https://gitforwindows.org/)
1. Clone Jellyfin into a directory of your choice.
git clone https://github.com/jellyfin/jellyfin.git C:\Jellyfin
2. From the Jellyfin directory you can use our Jellyfin build script. Call `Build-Jellyfin.ps1 -InstallFFMPEG` from inside the directory in a powershell window. Make sure you've set your executionpolicy to unrestricted.
* The `-WindowsVersion` and `-Architecture` flags can optimize the build for your current environment; the default is generic Windows x64.
* The `-InstallLocation` flag lets you select where the compiled binaries go; the default is `$Env:AppData\Jellyfin-Server\` .
* The `-InstallFFMPEG` flag will automatically pull the stable `ffmpeg` binaries appropriate to your architecture (x86/x64 only for now) from [Zeranoe](https://ffmpeg.zeranoe.com/builds/) and place them in your Jellyfin directory.
Additional flags:
- If you want to optimize for your environment you can use the `-WindowsVersion` and `-Architecture` flags to do so; the default is generic Windows x64.
- The `-InstallLocation` flag lets you select where the compiled binaries go; the default is `$Env:AppData\JellyFin-Server\` .
- The `-InstallFFMPEG` flag will automatically pull the stable ffmpeg binaries appropriate to your architecture (x86/x64 only for now) from [Zeranoe](https://ffmpeg.zeranoe.com/builds/) and place them in your Jellyfin directory.
3. (Optional) Use [NSSM](https://nssm.cc/) to configure JellyFin to run as a service
4. Jellyfin is now available in the default directory (or the directory you chose). Assuming you kept the default directory, to start it from a Powershell window, run, `&"$env:APPDATA\Jellyfin-Server\EmbyServer.exe"`. To start it from CMD, run, `%APPDATA%\Jellyfin-Server\EmbyServer.exe`
4. (Optional) Use [NSSM](https://nssm.cc/) to configure Jellyfin to run as a service
5. Jellyfin is now available in the default directory (or the directory you chose). Assuming you kept the default directory, to start it from a Powershell window, run, `&"$env:APPDATA\Jellyfin-Server\jellyfin.exe"`. To start it from CMD, run, `%APPDATA%\Jellyfin-Server\jellyfin.exe`