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