-
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds the ability to configure and build per-release deb files that can be used effectively with reprepro to provide compatibility across distros and multiple architectures. The package contains a set of static, single-binary ffmpeg and ffprobe binaries that can be used instead of any system ffmpeg packages, for whatever reason. ffmpeg 4.0.3 was chosen as the latest Jellyfin-supported version. The resulting binary files are located in `/usr/share` rather than `/usr/bin`, so we don't need to `Conflicts` with system ffmpeg packages. It does require various shared dependencies, following as closely as possible (while compatible with all supported releases) the default configurations, all of which should be available on all releases and architectures by default (as would the system ffmpeg). A Docker-based infrastructure similar to the main Jelyfin package build infrastructure is included to build the various packages for the supported releases and architectures. The entrypoint for users cloning the repo is `build`. This configuration disables all tests as a number of them fail arbitrarily for unknown reasons on armhf, but not amd64. This might not be ideal long-term but provides a temporary solution. Reenabling tests can be done by removing the `override_dh_auto_test:` line in the `debian/rules` file.
- Loading branch information
1 parent
a9f9024
commit 0966a03
Showing
12 changed files
with
278 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM DISTRO | ||
# Docker build arguments | ||
ARG SOURCE_DIR=/ffmpeg | ||
ARG ARTIFACT_DIR=/dist | ||
# Docker run environment | ||
ENV ARCH=BUILD_ARCHITECTURE | ||
ENV GCC_VER=GCC_RELEASE_VERSION | ||
ENV SOURCE_DIR=/ffmpeg | ||
ENV ARTIFACT_DIR=/dist | ||
ENV DEB_BUILD_OPTIONS=noddebs | ||
|
||
# Prepare Debian build environment | ||
RUN apt-get update \ | ||
&& apt-get install -y apt-transport-https debhelper gnupg wget devscripts mmv equivs | ||
|
||
# Link to docker-build script | ||
RUN ln -sf ${SOURCE_DIR}/docker-build.sh /docker-build.sh | ||
|
||
VOLUME ${ARTIFACT_DIR}/ | ||
|
||
COPY . ${SOURCE_DIR}/ | ||
|
||
ENTRYPOINT ["/docker-build.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/make | ||
DISTRO=stretch | ||
GCC_VER=6 | ||
ARCH=amd64 | ||
.PHONY: Dockerfile | ||
Dockerfile: Dockerfile.in | ||
sed 's/DISTRO/$(DISTRO)/; s/BUILD_ARCHITECTURE/$(ARCH)/; s/GCC_RELEASE_VERSION/$(GCC_VER)/' $< > $@ || rm -f $@ | ||
clean: | ||
rm -f Dockerfile |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env bash | ||
|
||
usage() { | ||
echo -e "Build Jellyfin FFMPEG packages" | ||
echo -e " $0 <release> <arch>" | ||
echo -e "Releases: Arches:" | ||
echo -e " * stretch * amd64" | ||
echo -e " * buster * armhf" | ||
echo -e " * xenial" | ||
echo -e " * bionic" | ||
echo -e " * cosmic" | ||
} | ||
|
||
if [[ -z ${1} ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
cli_release="${1}" | ||
case ${cli_release} in | ||
'stretch') | ||
release="debian:stretch" | ||
gcc_version="6" | ||
;; | ||
'buster') | ||
release="debian:buster" | ||
gcc_version="7" | ||
;; | ||
'xenial') | ||
release="ubuntu:xenial" | ||
gcc_version="6" | ||
;; | ||
'bionic') | ||
release="ubuntu:bionic" | ||
gcc_version="7" | ||
;; | ||
'cosmic') | ||
release="ubuntu:cosmic" | ||
gcc_version="7" | ||
;; | ||
*) | ||
echo "Invalid release." | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
|
||
cli_arch="${2}" | ||
case ${cli_arch} in | ||
'amd64') | ||
arch="amd64" | ||
;; | ||
'armhf') | ||
arch="armhf" | ||
;; | ||
*) | ||
echo "Invalid architecture." | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
|
||
set -o xtrace | ||
set -o errexit | ||
|
||
image_name="jellyfin-ffmpeg-build-${cli_release}" | ||
package_temporary_dir="$( mktemp -d )" | ||
current_user="$( whoami )" | ||
|
||
# Trap cleanup for latter sections | ||
cleanup() { | ||
# Clean up the Dockerfile | ||
make -f Dockerfile.make clean | ||
# Remove tempdir | ||
rm -rf "${package_temporary_dir}" | ||
} | ||
trap cleanup EXIT INT | ||
|
||
# Generate Dockerfile | ||
make -f Dockerfile.make DISTRO=${release} GCC_VER=${gcc_version} ARCH=${arch} | ||
# Set up the build environment docker image | ||
docker build . -t "${image_name}" | ||
# Build the APKs and copy out to ${package_temporary_dir} | ||
docker run --rm -e "RELEASE=${release}" -v "${package_temporary_dir}:/dist" "${image_name}" | ||
# Correct ownership on the APKs (as current user, then as root if that fails) | ||
chown -R "${current_user}" "${package_temporary_dir}" &>/dev/null \ | ||
|| sudo chown -R "${current_user}" "${package_temporary_dir}" &>/dev/null | ||
# Move the APKs to the parent directory | ||
mv "${package_temporary_dir}"/deb/* ../ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
jellyfin-ffmpeg (4.0.3-3) unstable; urgency=medium | ||
|
||
* Move binaries to /usr/share to keep compat with system ffmpeg | ||
|
||
-- Joshua Boniface <[email protected]> Fri, 22 Feb 2019 23:31:07 -0500 | ||
|
||
jellyfin-ffmpeg (4.0.3-2) unstable; urgency=medium | ||
|
||
* Use 'Provides: ffmpeg' to avoid breaking other packages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
11 | ||
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
ffmpeg usr/bin | ||
ffprobe usr/bin | ||
ffmpeg usr/share/jellyfin-ffmpeg | ||
ffprobe usr/share/jellyfin-ffmpeg |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.