2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-07-12 17:31:57 +01:00
|
|
|
, fetchFromGitHub
|
2021-01-07 10:37:28 +00:00
|
|
|
, fetchpatch
|
2020-07-12 17:31:57 +01:00
|
|
|
, srt
|
|
|
|
, ffmpeg_3_4
|
|
|
|
, bc
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-07-12 17:31:57 +01:00
|
|
|
, perl
|
|
|
|
, openssl
|
|
|
|
, zlib
|
|
|
|
, ffmpeg
|
|
|
|
, libvpx
|
|
|
|
, libopus
|
|
|
|
, srtp
|
|
|
|
, jemalloc
|
2021-01-07 10:37:28 +00:00
|
|
|
, pcre2
|
2020-11-05 14:17:10 +00:00
|
|
|
}:
|
2020-07-12 17:31:57 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
ffmpeg = ffmpeg_3_4.overrideAttrs (super: {
|
|
|
|
pname = "${super.pname}-ovenmediaengine";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Airensoft";
|
|
|
|
repo = "FFmpeg";
|
2020-11-05 14:17:10 +00:00
|
|
|
rev = "142b4bb64b64e337f80066e6af935a68627fedae"; # on branch ome/3.4
|
2020-07-12 17:31:57 +01:00
|
|
|
sha256 = "0fla3940q3z0c0ik2xzkbvdfvrdg06ban7wi6y94y8mcipszpp11";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "oven-media-engine";
|
2021-01-07 10:37:28 +00:00
|
|
|
version = "0.10.9-hotfix";
|
2020-07-12 17:31:57 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AirenSoft";
|
|
|
|
repo = "OvenMediaEngine";
|
|
|
|
rev = "v${version}";
|
2021-01-07 10:37:28 +00:00
|
|
|
sha256 = "1fhria0vwqsgmsglv5gn858li33vfy2dwy1f1qdd2jwikskb53am";
|
2020-07-12 17:31:57 +01:00
|
|
|
};
|
|
|
|
|
2021-01-07 10:37:28 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Needed to fix compilation under GCC 10.
|
|
|
|
url = "https://github.com/AirenSoft/OvenMediaEngine/commit/ad83e1d2226445d649e4b7e0c75106e31af4940d.patch";
|
|
|
|
sha256 = "1zk1rgi1wsjl6gdx3hdmgxlgindv6a3lsnkwcgi87ga9abw4vafw";
|
|
|
|
stripLen = 1;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-07-12 17:31:57 +01:00
|
|
|
sourceRoot = "source/src";
|
|
|
|
makeFlags = "release CONFIG_LIBRARY_PATHS= CONFIG_PKG_PATHS= GLOBAL_CC=$(CC) GLOBAL_CXX=$(CXX) GLOBAL_LD=$(CXX) SHELL=${stdenv.shell}";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ bc pkg-config perl ];
|
2021-01-07 10:37:28 +00:00
|
|
|
buildInputs = [ openssl srt zlib ffmpeg libvpx libopus srtp jemalloc pcre2 ];
|
2020-07-12 17:31:57 +01:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
patchShebangs core/colorg++
|
|
|
|
patchShebangs core/colorgcc
|
|
|
|
patchShebangs projects/main/update_git_info.sh
|
|
|
|
|
|
|
|
sed -i -e '/^CC =/d' -e '/^CXX =/d' -e '/^AR =/d' projects/third_party/pugixml-1.9/scripts/pugixml.make
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm0755 bin/RELEASE/OvenMediaEngine $out/bin/OvenMediaEngine
|
|
|
|
install -Dm0644 ../misc/conf_examples/Origin.xml $out/share/examples/origin_conf/Server.xml
|
|
|
|
install -Dm0644 ../misc/conf_examples/Logger.xml $out/share/examples/origin_conf/Logger.xml
|
|
|
|
install -Dm0644 ../misc/conf_examples/Edge.xml $out/share/examples/edge_conf/Server.xml
|
|
|
|
install -Dm0644 ../misc/conf_examples/Logger.xml $out/share/examples/edge_conf/Logger.xml
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-07-12 17:31:57 +01:00
|
|
|
description = "Open-source streaming video service with sub-second latency";
|
|
|
|
homepage = "https://ovenmediaengine.com";
|
2021-01-07 10:37:28 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-07-12 17:31:57 +01:00
|
|
|
maintainers = with maintainers; [ lukegb ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|