nixpkgs/pkgs/applications/video/omxplayer/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

101 lines
2.6 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, fetchurl
, raspberrypifw
, pcre
, boost
, freetype
, zlib
2017-06-26 23:47:43 +01:00
}:
2013-03-29 20:53:44 +00:00
let
ffmpeg = stdenv.mkDerivation rec {
pname = "ffmpeg";
version = "1.1.3";
2021-01-15 05:42:41 +00:00
2013-03-29 20:53:44 +00:00
src = fetchurl {
url = "http://www.ffmpeg.org/releases/ffmpeg-${version}.tar.bz2";
2013-03-29 20:53:44 +00:00
sha256 = "03s1zsprz5p6gjgwwqcf7b6cvzwwid6l8k7bamx9i0f1iwkgdm0j";
};
2021-01-15 05:42:41 +00:00
configurePlatforms = [ ];
2013-03-29 20:53:44 +00:00
configureFlags = [
"--arch=${stdenv.hostPlatform.parsed.cpu.name}"
2021-01-15 05:42:41 +00:00
] ++ lib.optionals stdenv.hostPlatform.isAarch32 [
2018-05-10 06:38:51 +01:00
# TODO be better with condition
2013-03-29 20:53:44 +00:00
"--cpu=arm1176jzf-s"
2018-05-10 06:38:51 +01:00
] ++ [
2013-03-29 20:53:44 +00:00
"--disable-muxers"
"--enable-muxer=spdif"
"--enable-muxer=adts"
"--disable-encoders"
"--enable-encoder=ac3"
"--enable-encoder=aac"
"--disable-decoder=mpeg_xvmc"
"--disable-devices"
"--disable-ffprobe"
"--disable-ffplay"
"--disable-ffserver"
"--disable-ffmpeg"
"--enable-shared"
"--disable-doc"
"--enable-postproc"
"--enable-gpl"
"--enable-protocol=http"
"--enable-pthreads"
"--disable-runtime-cpudetect"
"--enable-pic"
"--disable-armv5te"
"--disable-neon"
"--enable-armv6t2"
"--enable-armv6"
"--enable-hardcoded-tables"
"--disable-runtime-cpudetect"
"--disable-debug"
"--arch=${stdenv.hostPlatform.parsed.cpu.name}"
"--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
2021-01-15 05:42:41 +00:00
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
2018-05-10 06:38:51 +01:00
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
2013-03-29 20:53:44 +00:00
];
enableParallelBuilding = true;
meta = {
homepage = "http://www.ffmpeg.org/";
2013-03-29 20:53:44 +00:00
description = "A complete, cross-platform solution to record, convert and stream audio and video";
};
};
in
stdenv.mkDerivation rec {
pname = "omxplayer";
version = "unstable-2013-03-28";
src = fetchFromGitHub {
owner = "huceke";
repo = "omxplayer";
rev = "fbee325dc20441138d04d8d2022ad85956302e97";
2013-03-29 20:53:44 +00:00
sha256 = "0fkvv8il7ffqxki2gp8cxa5shh6sz9jsy5vv3f4025g4gss6afkg";
};
postPatch = ''
2013-03-29 20:53:44 +00:00
sed -i 1d Makefile
export INCLUDES="-I${raspberrypifw}/include/interface/vcos/pthreads -I${raspberrypifw}/include/interface/vmcs_host/linux/"
'';
2013-03-29 20:53:44 +00:00
installPhase = ''
mkdir -p $out/bin
2013-03-29 20:53:44 +00:00
cp omxplayer.bin $out/bin
'';
buildInputs = [ raspberrypifw ffmpeg pcre boost freetype zlib ];
2013-03-29 20:53:44 +00:00
meta = with lib; {
homepage = "https://github.com/huceke/omxplayer";
2013-03-29 20:53:44 +00:00
description = "Commandline OMX player for the Raspberry Pi";
license = licenses.gpl2Plus;
platforms = platforms.arm;
2013-03-29 20:53:44 +00:00
};
}