Skip to content

Commit

Permalink
misc video players: Clean up cross
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed May 10, 2018
1 parent 7d0906e commit 7864a17
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 66 deletions.
22 changes: 11 additions & 11 deletions pkgs/applications/video/omxplayer/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ let
sha256 = "03s1zsprz5p6gjgwwqcf7b6cvzwwid6l8k7bamx9i0f1iwkgdm0j";
};

configurePlatforms = [];
configureFlags = [
"--arch=arm"
"--arch=${hostPlatform.parsed.cpu.name}"
] ++ stdenv.lib.optionals stdenv.hostPlatform.isAarch32 [
# TODO be better with condition
"--cpu=arm1176jzf-s"
] ++ [
"--disable-muxers"
"--enable-muxer=spdif"
"--enable-muxer=adts"
Expand Down Expand Up @@ -42,19 +46,14 @@ let
"--enable-hardcoded-tables"
"--disable-runtime-cpudetect"
"--disable-debug"
"--arch=${hostPlatform.parsed.cpu.name}"
"--target_os=${hostPlatform.parsed.kernel.name}"
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
];

enableParallelBuilding = true;

crossAttrs = {
configurePlatforms = [];
configureFlags = configureFlags ++ [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=linux"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

meta = {
homepage = http://www.ffmpeg.org/;
Expand Down Expand Up @@ -83,5 +82,6 @@ stdenv.mkDerivation rec {
homepage = https://github.com/huceke/omxplayer;
description = "Commandline OMX player for the Raspberry Pi";
license = stdenv.lib.licenses.gpl2Plus;
platforms = stdenv.lib.platforms.arm;
};
}
21 changes: 6 additions & 15 deletions pkgs/development/libraries/ffmpeg-full/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,10 @@ stdenv.mkDerivation rec {
--replace /usr/local/lib/frei0r-1 ${frei0r}/lib/frei0r-1
'';

configurePlatforms = [];
configureFlags = [
"--target_os=${hostPlatform.parsed.kernel.name}"
"--arch=${hostPlatform.parsed.cpu.name}"
/*
* Licensing flags
*/
Expand Down Expand Up @@ -371,8 +374,6 @@ stdenv.mkDerivation rec {
#(enableFeature quvi "libquvi")
(enableFeature (rtmpdump != null) "librtmp")
#(enableFeature (schroedinger != null) "libschroedinger")
#(enableFeature (shine != null) "libshine")
(enableFeature (samba != null && gplLicensing && version3Licensing) "libsmbclient")
(enableFeature (SDL2 != null) "sdl2")
(enableFeature (soxr != null) "libsoxr")
(enableFeature (speex != null) "libspeex")
Expand All @@ -396,6 +397,9 @@ stdenv.mkDerivation rec {
(enableFeature optimizationsDeveloper "optimizations")
(enableFeature extraWarningsDeveloper "extra-warnings")
(enableFeature strippingDeveloper "stripping")
] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
];

nativeBuildInputs = [ perl pkgconfig texinfo yasm ];
Expand Down Expand Up @@ -432,21 +436,8 @@ stdenv.mkDerivation rec {
done
'';


enableParallelBuilding = true;

/* Cross-compilation is untested, consider this an outline, more work
needs to be done to portions of the build to get it to work correctly */
crossAttrs = {
configurePlatforms = [];
configureFlags = configureFlags ++ [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=${hostPlatform.parsed.kernel.name}"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

meta = with stdenv.lib; {
description = "A complete, cross-platform solution to record, convert and stream audio and video";
homepage = https://www.ffmpeg.org/;
Expand Down
18 changes: 6 additions & 12 deletions pkgs/development/libraries/ffmpeg/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ stdenv.mkDerivation rec {
++ optional (reqMin "1.0") "doc" ; # just dev-doc
setOutputFlags = false; # doesn't accept all and stores configureFlags in libs!

configurePlatforms = [];
configureFlags = [
"--arch=${hostPlatform.parsed.cpu.name}"
"--target_os=${hostPlatform.parsed.kernel.name}"
# License
"--enable-gpl"
"--enable-version3"
Expand Down Expand Up @@ -145,6 +148,9 @@ stdenv.mkDerivation rec {
"--disable-stripping"
# Disable mmx support for 0.6.90
(verFix null "0.6.90" "--disable-mmx")
] ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
] ++ optional stdenv.cc.isClang "--cc=clang";

nativeBuildInputs = [ perl pkgconfig texinfo yasm ];
Expand All @@ -168,18 +174,6 @@ stdenv.mkDerivation rec {
moveToOutput share/ffmpeg/examples "$doc"
'';

/* Cross-compilation is untested, consider this an outline, more work
needs to be done to portions of the build to get it to work correctly */
crossAttrs = {
configurePlatforms = [];
configureFlags = configureFlags ++ [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=${hostPlatform.parsed.kernel.name}"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

installFlags = [ "install-man" ];

passthru = {
Expand Down
52 changes: 24 additions & 28 deletions pkgs/development/libraries/libav/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

assert faacSupport -> enableUnfree;

let inherit (stdenv.lib) optional optionals hasPrefix; in
let inherit (stdenv.lib) optional optionals hasPrefix enableFeature; in

/* ToDo:
- more deps, inspiration: http://packages.ubuntu.com/raring/libav-tools
Expand Down Expand Up @@ -51,29 +51,35 @@ let
substituteInPlace ./configure --replace "#! /bin/sh" "#!${bash}/bin/sh"
'';

configureFlags =
assert stdenv.lib.all (x: x!=null) buildInputs;
[
configurePlatforms = [];
configureFlags = assert stdenv.lib.all (x: x!=null) buildInputs; [
"--arch=${hostPlatform.parsed.cpu.name}"
"--target_os=${hostPlatform.parsed.kernel.name}"
#"--enable-postproc" # it's now a separate package in upstream
"--disable-avserver" # upstream says it's in a bad state
"--enable-avplay"
"--enable-shared"
"--enable-runtime-cpudetect"
"--cc=cc"
]
++ optionals enableGPL [ "--enable-gpl" "--enable-swscale" ]
++ optional mp3Support "--enable-libmp3lame"
++ optional speexSupport "--enable-libspeex"
++ optional theoraSupport "--enable-libtheora"
++ optional vorbisSupport "--enable-libvorbis"
++ optional vpxSupport "--enable-libvpx"
++ optional x264Support "--enable-libx264"
++ optional xvidSupport "--enable-libxvid"
++ optional faacSupport "--enable-libfaac --enable-nonfree"
++ optional vaapiSupport "--enable-vaapi"
++ optional vdpauSupport "--enable-vdpau"
++ optional freetypeSupport "--enable-libfreetype"
;
(enableFeature enableGPL "gpl")
(enableFeature enableGPL "swscale")
(enableFeature mp3Support "libmp3lame")
(enableFeature mp3Support "libmp3lame")
(enableFeature speexSupport "libspeex")
(enableFeature theoraSupport "libtheora")
(enableFeature vorbisSupport "libvorbis")
(enableFeature vpxSupport "libvpx")
(enableFeature x264Support "libx264")
(enableFeature xvidSupport "libxvid")
(enableFeature faacSupport "libfaac")
(enableFeature faacSupport "nonfree")
(enableFeature vaapiSupport "vaapi")
(enableFeature vdpauSupport "vdpau")
(enableFeature freetypeSupport "libfreetype")
] ++ optional (stdenv.hostPlatform != stdenv.buildPlatform) [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
];

nativeBuildInputs = [ pkgconfig perl ];
buildInputs = [ lame yasm zlib bzip2 SDL bash ]
Expand Down Expand Up @@ -112,16 +118,6 @@ let
doInstallCheck = false; # fails randomly
installCheckTarget = "check"; # tests need to be run *after* installation

crossAttrs = {
configurePlatforms = [];
configureFlags = configureFlags ++ [
"--cross-prefix=${stdenv.cc.targetPrefix}"
"--enable-cross-compile"
"--target_os=linux"
"--arch=${hostPlatform.parsed.cpu.name}"
];
};

passthru = { inherit vdpauSupport; };

meta = with stdenv.lib; {
Expand Down

0 comments on commit 7864a17

Please sign in to comment.