tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
Making ffmpeg friendly for arm.
Lluís Batlle i Rossell
10 years ago
c431588c
d1a8d192
+17
-12
1 changed file
expand all
collapse all
unified
split
pkgs
development
libraries
ffmpeg
generic.nix
+17
-12
pkgs/development/libraries/ffmpeg/generic.nix
···
1
1
{ stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
2
2
, alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
3
3
-
, libtheora, libva, libvdpau, libvorbis, libvpx, lzma, libpulseaudio, SDL, soxr
3
3
+
, libtheora, libva, libvorbis, libvpx, lzma, libpulseaudio, soxr
4
4
, x264, xvidcore, zlib
5
5
, openglSupport ? false, mesa ? null
6
6
# Build options
7
7
, runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime
8
8
, multithreadBuild ? true # Multithreading via pthreads/win32 threads
9
9
+
, sdlSupport ? !stdenv.isArm, SDL ? null
10
10
+
, vdpauSupport ? !stdenv.isArm, libvdpau ? null
9
11
# Developer options
10
12
, debugDeveloper ? false
11
13
, optimizationsDeveloper ? true
···
39
41
*/
40
42
41
43
let
42
42
-
inherit (stdenv) icCygwin isDarwin isFreeBSD isLinux;
44
44
+
inherit (stdenv) icCygwin isDarwin isFreeBSD isLinux isArm;
43
45
inherit (stdenv.lib) optional optionals enableFeature;
44
46
45
47
cmpVer = builtins.compareVersions;
···
51
53
# Version specific fix
52
54
verFix = withoutFix: fixVer: withFix: if reqMatch fixVer then withFix else withoutFix;
53
55
54
54
-
# Disable dependency that needs fixes before it will work on Darwin
55
55
-
disDarwinFix = origArg: minVer: fixArg: if (isDarwin && reqMin minVer) then fixArg else origArg;
56
56
+
# Disable dependency that needs fixes before it will work on Darwin or Arm
57
57
+
disDarwinOrArmFix = origArg: minVer: fixArg: if ((isDarwin || isArm) && reqMin minVer) then fixArg else origArg;
56
58
in
57
59
58
60
assert openglSupport -> mesa != null;
···
117
119
(ifMinVer "0.6" (enableFeature (isLinux || isFreeBSD) "vaapi"))
118
120
"--enable-vdpau"
119
121
"--enable-libvorbis"
120
120
-
(disDarwinFix (ifMinVer "0.6" "--enable-libvpx") "0.6" "--disable-libvpx")
122
122
+
(disDarwinOrArmFix (ifMinVer "0.6" "--enable-libvpx") "0.6" "--disable-libvpx")
121
123
(ifMinVer "2.4" "--enable-lzma")
122
124
(ifMinVer "2.2" (enableFeature openglSupport "opengl"))
123
123
-
(disDarwinFix (ifMinVer "0.9" "--enable-libpulse") "0.9" "--disable-libpulse")
124
124
-
(ifMinVer "2.5" "--enable-sdl") # Only configurable since 2.5, auto detected before then
125
125
+
(disDarwinOrArmFix (ifMinVer "0.9" "--enable-libpulse") "0.9" "--disable-libpulse")
126
126
+
(ifMinVer "2.5" (if sdlSupport then "--enable-sdl" else "")) # Only configurable since 2.5, auto detected before then
125
127
(ifMinVer "1.2" "--enable-libsoxr")
126
128
"--enable-libx264"
127
129
"--enable-libxvid"
···
141
143
bzip2 fontconfig freetype gnutls libiconv lame libass libogg libtheora
142
144
libvdpau libvorbis lzma SDL soxr x264 xvidcore zlib
143
145
] ++ optional openglSupport mesa
144
144
-
++ optionals (!isDarwin) [ libvpx libpulseaudio ] # Need to be fixed on Darwin
145
145
-
++ optional (isLinux || isFreeBSD) libva
146
146
+
++ optionals (!isDarwin && !isArm) [ libvpx libpulseaudio ] # Need to be fixed on Darwin and ARM
147
147
+
++ optional ((isLinux || isFreeBSD) && !isArm) libva
146
148
++ optional isLinux alsaLib
147
147
-
++ optional isDarwin Cocoa;
149
149
+
++ optional isDarwin Cocoa
150
150
+
++ optional vdpauSupport libvdpau
151
151
+
++ optional sdlSupport SDL;
152
152
+
148
153
149
154
enableParallelBuilding = true;
150
155
···
178
183
};
179
184
180
185
passthru = {
181
181
-
vaapiSupport = if reqMin "0.6" && (isLinux || isFreeBSD) then true else false;
182
182
-
vdpauSupport = true;
186
186
+
vaapiSupport = if reqMin "0.6" && ((isLinux || isFreeBSD) && !isArm) then true else false;
187
187
+
inherit vdpauSupport;
183
188
};
184
189
185
190
meta = with stdenv.lib; {