avidemux: refactor again to fix build failures
This commit is contained in:
parent
0420a532e9
commit
76281d5dec
@ -1,7 +1,9 @@
|
|||||||
{ stdenv, lib, fetchurl, cmake, pkgconfig, lndir
|
{ stdenv, lib, fetchurl, cmake, pkgconfig, lndir
|
||||||
, zlib, gettext, libvdpau, libva, libXv, sqlite, x265
|
, zlib, gettext, libvdpau, libva, libXv, sqlite
|
||||||
, yasm, fribidi, gtk3, qt4
|
, yasm, freetype, fontconfig, fribidi, gtk3, qt4
|
||||||
|
, withX265 ? true, x265
|
||||||
, withX264 ? true, x264
|
, withX264 ? true, x264
|
||||||
|
, withXvid ? true, xvidcore
|
||||||
, withLAME ? true, lame
|
, withLAME ? true, lame
|
||||||
, withFAAC ? false, faac
|
, withFAAC ? false, faac
|
||||||
, withVorbis ? true, libvorbis
|
, withVorbis ? true, libvorbis
|
||||||
@ -11,8 +13,7 @@
|
|||||||
, withVPX ? true, libvpx
|
, withVPX ? true, libvpx
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
name = "avidemux-${version}";
|
|
||||||
version = "2.6.12";
|
version = "2.6.12";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
@ -20,9 +21,18 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn";
|
sha256 = "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkgconfig yasm lndir ];
|
common = {
|
||||||
buildInputs = [ zlib gettext libvdpau libva libXv sqlite x265 fribidi gtk3 qt4 ]
|
inherit version src;
|
||||||
|
|
||||||
|
patches = [ ./dynamic_install_dir.patch ];
|
||||||
|
|
||||||
|
enableParallelBuilding = false;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ cmake pkgconfig yasm ];
|
||||||
|
buildInputs = [ zlib gettext libvdpau libva libXv sqlite fribidi fontconfig freetype ]
|
||||||
++ lib.optional withX264 x264
|
++ lib.optional withX264 x264
|
||||||
|
++ lib.optional withX265 x265
|
||||||
|
++ lib.optional withXvid xvidcore
|
||||||
++ lib.optional withLAME lame
|
++ lib.optional withLAME lame
|
||||||
++ lib.optional withFAAC faac
|
++ lib.optional withFAAC faac
|
||||||
++ lib.optional withVorbis libvorbis
|
++ lib.optional withVorbis libvorbis
|
||||||
@ -32,79 +42,6 @@ stdenv.mkDerivation rec {
|
|||||||
++ lib.optional withVPX libvpx
|
++ lib.optional withVPX libvpx
|
||||||
;
|
;
|
||||||
|
|
||||||
enableParallelBuilding = false;
|
|
||||||
|
|
||||||
outputs = [ "out" "cli" "gtk" "qt4" ];
|
|
||||||
|
|
||||||
patches = [ ./dynamic_install_dir.patch ];
|
|
||||||
|
|
||||||
buildCommand = ''
|
|
||||||
unpackPhase
|
|
||||||
cd "$sourceRoot"
|
|
||||||
patchPhase
|
|
||||||
|
|
||||||
export cmakeFlags="$cmakeFlags -DAVIDEMUX_SOURCE_DIR=$(pwd)"
|
|
||||||
|
|
||||||
function buildOutput() {
|
|
||||||
( plugin_ui="$1"
|
|
||||||
output_dir="$2"
|
|
||||||
shift 2
|
|
||||||
export cmakeFlags="$cmakeFlags -DPLUGIN_UI=$plugin_ui -DCMAKE_INSTALL_PREFIX=$output_dir"
|
|
||||||
for i in "$@" avidemux_plugins; do
|
|
||||||
( cd "$i"
|
|
||||||
cmakeConfigurePhase
|
|
||||||
buildPhase
|
|
||||||
installPhase
|
|
||||||
)
|
|
||||||
done
|
|
||||||
rm -rf avidemux_plugins/build
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildUi() {
|
|
||||||
plugin_ui="$1"
|
|
||||||
output_dir="$2"
|
|
||||||
shift 2
|
|
||||||
|
|
||||||
# Hack to split builds properly
|
|
||||||
mkdir -p $output_dir
|
|
||||||
lndir $out $output_dir
|
|
||||||
buildOutput $plugin_ui $output_dir "$@"
|
|
||||||
}
|
|
||||||
|
|
||||||
function fixupUi() {
|
|
||||||
output_dir="$1"
|
|
||||||
shift
|
|
||||||
|
|
||||||
find $output_dir -lname $out\* -delete
|
|
||||||
find $output_dir -type f | while read -r f; do
|
|
||||||
rpath="$(patchelf --print-rpath $f 2>/dev/null)" || continue
|
|
||||||
new_rpath=""
|
|
||||||
IFS=':' read -ra old_rpath <<< "$rpath"
|
|
||||||
for p in "''${old_rpath[@]}"; do
|
|
||||||
new_rpath="$new_rpath:$p"
|
|
||||||
if [[ $p = $output_dir* ]]; then
|
|
||||||
new_rpath="$new_rpath:$out/''${p#$output_dir}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
patchelf --set-rpath "$new_rpath" $f
|
|
||||||
patchelf --shrink-rpath $f
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
buildOutput COMMON $out avidemux_core
|
|
||||||
buildOutput SETTINGS $out
|
|
||||||
buildUi CLI $cli avidemux/cli
|
|
||||||
buildUi GTK $gtk avidemux/gtk
|
|
||||||
buildUi QT4 $qt4 avidemux/qt4
|
|
||||||
|
|
||||||
fixupPhase
|
|
||||||
|
|
||||||
fixupUi $cli
|
|
||||||
fixupUi $gtk
|
|
||||||
fixupUi $qt4
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://fixounet.free.fr/avidemux/;
|
homepage = http://fixounet.free.fr/avidemux/;
|
||||||
description = "Free video editor designed for simple video editing tasks";
|
description = "Free video editor designed for simple video editing tasks";
|
||||||
@ -112,4 +49,80 @@ stdenv.mkDerivation rec {
|
|||||||
platforms = with stdenv.lib.platforms; linux;
|
platforms = with stdenv.lib.platforms; linux;
|
||||||
license = stdenv.lib.licenses.gpl2;
|
license = stdenv.lib.licenses.gpl2;
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
core = stdenv.mkDerivation (common // {
|
||||||
|
name = "avidemux-${version}";
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
cd avidemux_core
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
buildPlugin = args: stdenv.mkDerivation (common // {
|
||||||
|
name = "avidemux-${args.pluginName}-${version}";
|
||||||
|
|
||||||
|
buildInputs = (args.buildInputs or []) ++ common.buildInputs ++ [ lndir ];
|
||||||
|
|
||||||
|
cmakeFlags = [ "-DPLUGIN_UI=${args.pluginUi}" ];
|
||||||
|
|
||||||
|
passthru.isUi = args.isUi or false;
|
||||||
|
|
||||||
|
buildCommand = ''
|
||||||
|
unpackPhase
|
||||||
|
cd "$sourceRoot"
|
||||||
|
patchPhase
|
||||||
|
|
||||||
|
mkdir $out
|
||||||
|
lndir ${core} $out
|
||||||
|
|
||||||
|
export cmakeFlags="$cmakeFlags -DAVIDEMUX_SOURCE_DIR=$(pwd)"
|
||||||
|
|
||||||
|
for i in ${toString (args.buildDirs or [])} avidemux_plugins; do
|
||||||
|
( cd "$i"
|
||||||
|
cmakeConfigurePhase
|
||||||
|
buildPhase
|
||||||
|
installPhase
|
||||||
|
)
|
||||||
|
done
|
||||||
|
|
||||||
|
fixupPhase
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
in {
|
||||||
|
avidemux_core = core;
|
||||||
|
|
||||||
|
avidemux_cli = buildPlugin {
|
||||||
|
pluginName = "cli";
|
||||||
|
pluginUi = "CLI";
|
||||||
|
isUi = true;
|
||||||
|
buildDirs = [ "avidemux/cli" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
avidemux_qt4 = buildPlugin {
|
||||||
|
pluginName = "qt4";
|
||||||
|
buildInputs = [ qt4 ];
|
||||||
|
pluginUi = "QT4";
|
||||||
|
isUi = true;
|
||||||
|
buildDirs = [ "avidemux/qt4" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
avidemux_gtk = buildPlugin {
|
||||||
|
pluginName = "gtk";
|
||||||
|
buildInputs = [ gtk3 ];
|
||||||
|
pluginUi = "GTK";
|
||||||
|
isUi = true;
|
||||||
|
buildDirs = [ "avidemux/gtk" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
avidemux_common = buildPlugin {
|
||||||
|
pluginName = "common";
|
||||||
|
pluginUi = "COMMON";
|
||||||
|
};
|
||||||
|
|
||||||
|
avidemux_settings = buildPlugin {
|
||||||
|
pluginName = "settings";
|
||||||
|
pluginUi = "SETTINGS";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
{ buildEnv, avidemux, makeWrapper
|
{ buildEnv, avidemux_unwrapped, makeWrapper
|
||||||
# GTK version is broken upstream, see https://bugzilla.redhat.com/show_bug.cgi?id=1244340
|
# GTK version is broken upstream, see https://bugzilla.redhat.com/show_bug.cgi?id=1244340
|
||||||
, withUi ? "qt4"
|
, withUi ? "qt4"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let ui = builtins.getAttr "avidemux_${withUi}" avidemux_unwrapped; in
|
||||||
ui = builtins.getAttr withUi avidemux;
|
|
||||||
|
|
||||||
in buildEnv {
|
assert ui.isUi;
|
||||||
name = "avidemux-${withUi}-" + avidemux.version;
|
|
||||||
|
|
||||||
paths = [ avidemux ui ];
|
buildEnv {
|
||||||
|
name = "avidemux-${withUi}-" + ui.version;
|
||||||
|
|
||||||
|
paths = [ ui avidemux_unwrapped.avidemux_common avidemux_unwrapped.avidemux_settings ];
|
||||||
|
|
||||||
|
ignoreCollisions = true;
|
||||||
|
|
||||||
buildInputs = [ makeWrapper ];
|
buildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
@ -26,4 +29,6 @@ in buildEnv {
|
|||||||
wrapProgram $i --set ADM_ROOT_DIR $out
|
wrapProgram $i --set ADM_ROOT_DIR $out
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
meta = ui.meta;
|
||||||
}
|
}
|
||||||
|
@ -11628,12 +11628,12 @@ in
|
|||||||
|
|
||||||
autopanosiftc = callPackage ../applications/graphics/autopanosiftc { };
|
autopanosiftc = callPackage ../applications/graphics/autopanosiftc { };
|
||||||
|
|
||||||
avidemux_unwrapped = callPackage ../applications/video/avidemux { };
|
avidemux_unwrapped = callPackage ../applications/video/avidemux {
|
||||||
|
libva = libva-full; # also wants libva-x11
|
||||||
avidemux = callPackage ../applications/video/avidemux/wrapper.nix {
|
|
||||||
avidemux = avidemux_unwrapped;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
avidemux = callPackage ../applications/video/avidemux/wrapper.nix { };
|
||||||
|
|
||||||
avogadro = callPackage ../applications/science/chemistry/avogadro {
|
avogadro = callPackage ../applications/science/chemistry/avogadro {
|
||||||
eigen = eigen2;
|
eigen = eigen2;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user