tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
avidemux: refactor again to fix build failures
Nikolay Amiantov
9 years ago
76281d5d
0420a532
+108
-90
3 changed files
expand all
collapse all
unified
split
pkgs
applications
video
avidemux
default.nix
wrapper.nix
top-level
all-packages.nix
+93
-80
pkgs/applications/video/avidemux/default.nix
···
1
1
{ stdenv, lib, fetchurl, cmake, pkgconfig, lndir
2
2
-
, zlib, gettext, libvdpau, libva, libXv, sqlite, x265
3
3
-
, yasm, fribidi, gtk3, qt4
2
2
+
, zlib, gettext, libvdpau, libva, libXv, sqlite
3
3
+
, yasm, freetype, fontconfig, fribidi, gtk3, qt4
4
4
+
, withX265 ? true, x265
4
5
, withX264 ? true, x264
6
6
+
, withXvid ? true, xvidcore
5
7
, withLAME ? true, lame
6
8
, withFAAC ? false, faac
7
9
, withVorbis ? true, libvorbis
···
11
13
, withVPX ? true, libvpx
12
14
}:
13
15
14
14
-
stdenv.mkDerivation rec {
15
15
-
name = "avidemux-${version}";
16
16
+
let
16
17
version = "2.6.12";
17
18
18
19
src = fetchurl {
···
20
21
sha256 = "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn";
21
22
};
22
23
23
23
-
nativeBuildInputs = [ cmake pkgconfig yasm lndir ];
24
24
-
buildInputs = [ zlib gettext libvdpau libva libXv sqlite x265 fribidi gtk3 qt4 ]
25
25
-
++ lib.optional withX264 x264
26
26
-
++ lib.optional withLAME lame
27
27
-
++ lib.optional withFAAC faac
28
28
-
++ lib.optional withVorbis libvorbis
29
29
-
++ lib.optional withPulse libpulseaudio
30
30
-
++ lib.optional withFAAD faad2
31
31
-
++ lib.optional withOpus libopus
32
32
-
++ lib.optional withVPX libvpx
33
33
-
;
24
24
+
common = {
25
25
+
inherit version src;
26
26
+
27
27
+
patches = [ ./dynamic_install_dir.patch ];
28
28
+
29
29
+
enableParallelBuilding = false;
30
30
+
31
31
+
nativeBuildInputs = [ cmake pkgconfig yasm ];
32
32
+
buildInputs = [ zlib gettext libvdpau libva libXv sqlite fribidi fontconfig freetype ]
33
33
+
++ lib.optional withX264 x264
34
34
+
++ lib.optional withX265 x265
35
35
+
++ lib.optional withXvid xvidcore
36
36
+
++ lib.optional withLAME lame
37
37
+
++ lib.optional withFAAC faac
38
38
+
++ lib.optional withVorbis libvorbis
39
39
+
++ lib.optional withPulse libpulseaudio
40
40
+
++ lib.optional withFAAD faad2
41
41
+
++ lib.optional withOpus libopus
42
42
+
++ lib.optional withVPX libvpx
43
43
+
;
44
44
+
45
45
+
meta = {
46
46
+
homepage = http://fixounet.free.fr/avidemux/;
47
47
+
description = "Free video editor designed for simple video editing tasks";
48
48
+
maintainers = with stdenv.lib.maintainers; [ viric abbradar ];
49
49
+
platforms = with stdenv.lib.platforms; linux;
50
50
+
license = stdenv.lib.licenses.gpl2;
51
51
+
};
52
52
+
};
34
53
35
35
-
enableParallelBuilding = false;
54
54
+
core = stdenv.mkDerivation (common // {
55
55
+
name = "avidemux-${version}";
36
56
37
37
-
outputs = [ "out" "cli" "gtk" "qt4" ];
57
57
+
preConfigure = ''
58
58
+
cd avidemux_core
59
59
+
'';
60
60
+
});
38
61
39
39
-
patches = [ ./dynamic_install_dir.patch ];
62
62
+
buildPlugin = args: stdenv.mkDerivation (common // {
63
63
+
name = "avidemux-${args.pluginName}-${version}";
40
64
41
41
-
buildCommand = ''
42
42
-
unpackPhase
43
43
-
cd "$sourceRoot"
44
44
-
patchPhase
65
65
+
buildInputs = (args.buildInputs or []) ++ common.buildInputs ++ [ lndir ];
45
66
46
46
-
export cmakeFlags="$cmakeFlags -DAVIDEMUX_SOURCE_DIR=$(pwd)"
67
67
+
cmakeFlags = [ "-DPLUGIN_UI=${args.pluginUi}" ];
47
68
48
48
-
function buildOutput() {
49
49
-
( plugin_ui="$1"
50
50
-
output_dir="$2"
51
51
-
shift 2
52
52
-
export cmakeFlags="$cmakeFlags -DPLUGIN_UI=$plugin_ui -DCMAKE_INSTALL_PREFIX=$output_dir"
53
53
-
for i in "$@" avidemux_plugins; do
54
54
-
( cd "$i"
55
55
-
cmakeConfigurePhase
56
56
-
buildPhase
57
57
-
installPhase
58
58
-
)
59
59
-
done
60
60
-
rm -rf avidemux_plugins/build
61
61
-
)
62
62
-
}
69
69
+
passthru.isUi = args.isUi or false;
63
70
64
64
-
function buildUi() {
65
65
-
plugin_ui="$1"
66
66
-
output_dir="$2"
67
67
-
shift 2
71
71
+
buildCommand = ''
72
72
+
unpackPhase
73
73
+
cd "$sourceRoot"
74
74
+
patchPhase
68
75
69
69
-
# Hack to split builds properly
70
70
-
mkdir -p $output_dir
71
71
-
lndir $out $output_dir
72
72
-
buildOutput $plugin_ui $output_dir "$@"
73
73
-
}
76
76
+
mkdir $out
77
77
+
lndir ${core} $out
74
78
75
75
-
function fixupUi() {
76
76
-
output_dir="$1"
77
77
-
shift
79
79
+
export cmakeFlags="$cmakeFlags -DAVIDEMUX_SOURCE_DIR=$(pwd)"
78
80
79
79
-
find $output_dir -lname $out\* -delete
80
80
-
find $output_dir -type f | while read -r f; do
81
81
-
rpath="$(patchelf --print-rpath $f 2>/dev/null)" || continue
82
82
-
new_rpath=""
83
83
-
IFS=':' read -ra old_rpath <<< "$rpath"
84
84
-
for p in "''${old_rpath[@]}"; do
85
85
-
new_rpath="$new_rpath:$p"
86
86
-
if [[ $p = $output_dir* ]]; then
87
87
-
new_rpath="$new_rpath:$out/''${p#$output_dir}"
88
88
-
fi
89
89
-
done
90
90
-
patchelf --set-rpath "$new_rpath" $f
91
91
-
patchelf --shrink-rpath $f
81
81
+
for i in ${toString (args.buildDirs or [])} avidemux_plugins; do
82
82
+
( cd "$i"
83
83
+
cmakeConfigurePhase
84
84
+
buildPhase
85
85
+
installPhase
86
86
+
)
92
87
done
93
93
-
}
94
88
95
95
-
buildOutput COMMON $out avidemux_core
96
96
-
buildOutput SETTINGS $out
97
97
-
buildUi CLI $cli avidemux/cli
98
98
-
buildUi GTK $gtk avidemux/gtk
99
99
-
buildUi QT4 $qt4 avidemux/qt4
89
89
+
fixupPhase
90
90
+
'';
91
91
+
});
100
92
101
101
-
fixupPhase
93
93
+
in {
94
94
+
avidemux_core = core;
95
95
+
96
96
+
avidemux_cli = buildPlugin {
97
97
+
pluginName = "cli";
98
98
+
pluginUi = "CLI";
99
99
+
isUi = true;
100
100
+
buildDirs = [ "avidemux/cli" ];
101
101
+
};
102
102
+
103
103
+
avidemux_qt4 = buildPlugin {
104
104
+
pluginName = "qt4";
105
105
+
buildInputs = [ qt4 ];
106
106
+
pluginUi = "QT4";
107
107
+
isUi = true;
108
108
+
buildDirs = [ "avidemux/qt4" ];
109
109
+
};
110
110
+
111
111
+
avidemux_gtk = buildPlugin {
112
112
+
pluginName = "gtk";
113
113
+
buildInputs = [ gtk3 ];
114
114
+
pluginUi = "GTK";
115
115
+
isUi = true;
116
116
+
buildDirs = [ "avidemux/gtk" ];
117
117
+
};
102
118
103
103
-
fixupUi $cli
104
104
-
fixupUi $gtk
105
105
-
fixupUi $qt4
106
106
-
'';
119
119
+
avidemux_common = buildPlugin {
120
120
+
pluginName = "common";
121
121
+
pluginUi = "COMMON";
122
122
+
};
107
123
108
108
-
meta = {
109
109
-
homepage = http://fixounet.free.fr/avidemux/;
110
110
-
description = "Free video editor designed for simple video editing tasks";
111
111
-
maintainers = with stdenv.lib.maintainers; [ viric abbradar ];
112
112
-
platforms = with stdenv.lib.platforms; linux;
113
113
-
license = stdenv.lib.licenses.gpl2;
124
124
+
avidemux_settings = buildPlugin {
125
125
+
pluginName = "settings";
126
126
+
pluginUi = "SETTINGS";
114
127
};
115
128
}
+11
-6
pkgs/applications/video/avidemux/wrapper.nix
···
1
1
-
{ buildEnv, avidemux, makeWrapper
1
1
+
{ buildEnv, avidemux_unwrapped, makeWrapper
2
2
# GTK version is broken upstream, see https://bugzilla.redhat.com/show_bug.cgi?id=1244340
3
3
, withUi ? "qt4"
4
4
}:
5
5
6
6
-
let
7
7
-
ui = builtins.getAttr withUi avidemux;
6
6
+
let ui = builtins.getAttr "avidemux_${withUi}" avidemux_unwrapped; in
7
7
+
8
8
+
assert ui.isUi;
9
9
+
10
10
+
buildEnv {
11
11
+
name = "avidemux-${withUi}-" + ui.version;
8
12
9
9
-
in buildEnv {
10
10
-
name = "avidemux-${withUi}-" + avidemux.version;
13
13
+
paths = [ ui avidemux_unwrapped.avidemux_common avidemux_unwrapped.avidemux_settings ];
11
14
12
12
-
paths = [ avidemux ui ];
15
15
+
ignoreCollisions = true;
13
16
14
17
buildInputs = [ makeWrapper ];
15
18
···
26
29
wrapProgram $i --set ADM_ROOT_DIR $out
27
30
done
28
31
'';
32
32
+
33
33
+
meta = ui.meta;
29
34
}
+4
-4
pkgs/top-level/all-packages.nix
···
11628
11628
11629
11629
autopanosiftc = callPackage ../applications/graphics/autopanosiftc { };
11630
11630
11631
11631
-
avidemux_unwrapped = callPackage ../applications/video/avidemux { };
11632
11632
-
11633
11633
-
avidemux = callPackage ../applications/video/avidemux/wrapper.nix {
11634
11634
-
avidemux = avidemux_unwrapped;
11631
11631
+
avidemux_unwrapped = callPackage ../applications/video/avidemux {
11632
11632
+
libva = libva-full; # also wants libva-x11
11635
11633
};
11634
11634
+
11635
11635
+
avidemux = callPackage ../applications/video/avidemux/wrapper.nix { };
11636
11636
11637
11637
avogadro = callPackage ../applications/science/chemistry/avogadro {
11638
11638
eigen = eigen2;