diff options
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r-- | pkgs/applications/video/avidemux/default.nix | 127 | ||||
-rw-r--r-- | pkgs/applications/video/avidemux/dynamic_install_dir.patch | 12 | ||||
-rw-r--r-- | pkgs/applications/video/avidemux/wrapper.nix | 29 | ||||
-rw-r--r-- | pkgs/applications/video/vlc/default.nix | 5 |
4 files changed, 144 insertions, 29 deletions
diff --git a/pkgs/applications/video/avidemux/default.nix b/pkgs/applications/video/avidemux/default.nix index 485d8c54eb3..3ffc18e3b18 100644 --- a/pkgs/applications/video/avidemux/default.nix +++ b/pkgs/applications/video/avidemux/default.nix @@ -1,46 +1,115 @@ -{stdenv, fetchurl, cmake, pkgconfig, libxml2, qt4, gtk, gettext, SDL, -libXv, pixman, libpthreadstubs, libXau, libXdmcp, libxslt, x264, -alsaLib, lame, faad2, libvorbis, yasm, libvpx, xvidcore, libva, -faac ? null, faacSupport ? false }: +{ stdenv, lib, fetchurl, cmake, pkgconfig, lndir +, zlib, gettext, libvdpau, libva, libXv, sqlite, x265 +, yasm, fribidi, gtk3, qt4 +, withX264 ? true, x264 +, withLAME ? true, lame +, withFAAC ? true, faac +, withVorbis ? true, libvorbis +, withPulse ? true, libpulseaudio +, withFAAD ? true, faad2 +, withOpus ? true, libopus +, withVPX ? true, libvpx +}: -assert stdenv ? glibc; -assert faacSupport -> faac != null; - -stdenv.mkDerivation { - name = "avidemux-2.5.6"; +stdenv.mkDerivation rec { + name = "avidemux-${version}"; + version = "2.6.12"; src = fetchurl { - url = mirror://sourceforge/avidemux/avidemux_2.5.6.tar.gz; - sha256 = "12wvxz0n2g85f079d8mdkkp2zm279d34m9v7qgcqndh48cn7znnn"; + url = "mirror://sourceforge/avidemux/avidemux/${version}/avidemux_${version}.tar.gz"; + sha256 = "0nz52yih8sff53inndkh2dba759xjzsh4b8xjww419lcpk0qp6kn"; }; - buildInputs = [ cmake pkgconfig libxml2 qt4 gtk gettext SDL libXv - pixman libpthreadstubs libXau libXdmcp libxslt x264 alsaLib - lame faad2 libvorbis yasm libvpx xvidcore libva - ] ++ stdenv.lib.optional faacSupport faac; + nativeBuildInputs = [ cmake pkgconfig yasm lndir ]; + buildInputs = [ zlib gettext libvdpau libva libXv sqlite x265 fribidi gtk3 qt4 ] + ++ lib.optional withX264 x264 + ++ lib.optional withLAME lame + ++ lib.optional withFAAC faac + ++ lib.optional withVorbis libvorbis + ++ lib.optional withPulse libpulseaudio + ++ lib.optional withFAAD faad2 + ++ lib.optional withOpus libopus + ++ 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 - cmakeFlags = "-DPTHREAD_INCLUDE_DIR=${stdenv.glibc}/include" + - " -DGETTEXT_INCLUDE_DIR=${gettext}/include" + - " -DSDL_INCLUDE_DIR=${SDL}/include/SDL"; + 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 + } - NIX_LDFLAGS="-lpthread"; + buildOutput COMMON $out avidemux_core + buildOutput SETTINGS $out + buildUi CLI $cli avidemux/cli + buildUi GTK $gtk avidemux/gtk + buildUi QT4 $qt4 avidemux/qt4 - postInstall = '' - cd $NIX_BUILD_TOP/$sourceRoot - mkdir build_plugins - cd build_plugins - cmake $cmakeFlags -DAVIDEMUX_INSTALL_PREFIX=$out \ - -DAVIDEMUX_SOURCE_DIR=$NIX_BUILD_TOP/$sourceRoot \ - -DAVIDEMUX_CORECONFIG_DIR=$NIX_BUILD_TOP/$sourceRoot/build/config ../plugins + fixupPhase - make - make install + fixupUi $cli + fixupUi $gtk + fixupUi $qt4 ''; meta = { homepage = http://fixounet.free.fr/avidemux/; description = "Free video editor designed for simple video editing tasks"; - maintainers = with stdenv.lib.maintainers; [viric]; + maintainers = with stdenv.lib.maintainers; [ viric abbradar ]; platforms = with stdenv.lib.platforms; linux; + license = stdenv.lib.licenses.gpl2; }; } diff --git a/pkgs/applications/video/avidemux/dynamic_install_dir.patch b/pkgs/applications/video/avidemux/dynamic_install_dir.patch new file mode 100644 index 00000000000..f2f963e5169 --- /dev/null +++ b/pkgs/applications/video/avidemux/dynamic_install_dir.patch @@ -0,0 +1,12 @@ +diff -ru3 avidemux_2.6.12.old/avidemux_core/ADM_core/src/ADM_fileio.cpp avidemux_2.6.12/avidemux_core/ADM_core/src/ADM_fileio.cpp +--- avidemux_2.6.12.old/avidemux_core/ADM_core/src/ADM_fileio.cpp 2016-03-25 15:26:00.368213627 +0300 ++++ avidemux_2.6.12/avidemux_core/ADM_core/src/ADM_fileio.cpp 2016-03-26 02:32:56.163550537 +0300 +@@ -393,7 +393,7 @@ + + return ADM_getRelativePath(buffer, base1, base2, base3); + #else +- return ADM_getRelativePath(ADM_INSTALL_DIR, base1, base2, base3); ++ return ADM_getRelativePath(getenv("ADM_ROOT_DIR"), base1, base2, base3); + #endif + } + diff --git a/pkgs/applications/video/avidemux/wrapper.nix b/pkgs/applications/video/avidemux/wrapper.nix new file mode 100644 index 00000000000..ad41f56d39d --- /dev/null +++ b/pkgs/applications/video/avidemux/wrapper.nix @@ -0,0 +1,29 @@ +{ buildEnv, avidemux, makeWrapper +# GTK version is broken upstream, see https://bugzilla.redhat.com/show_bug.cgi?id=1244340 +, withUi ? "qt4" +}: + +let + ui = builtins.getAttr withUi avidemux; + +in buildEnv { + name = "avidemux-${withUi}-" + avidemux.version; + + paths = [ avidemux ui ]; + + buildInputs = [ makeWrapper ]; + + postBuild = '' + # TODO: This could be avoided if buildEnv could be forced to create all directories + if [ -L $out/bin ]; then + rm $out/bin + mkdir $out/bin + for i in ${ui}/bin/*; do + ln -s $i $out/bin + done + fi + for i in $out/bin/*; do + wrapProgram $i --set ADM_ROOT_DIR $out + done + ''; +} diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix index 0e08c21fc99..a84f24a303a 100644 --- a/pkgs/applications/video/vlc/default.nix +++ b/pkgs/applications/video/vlc/default.nix @@ -27,6 +27,11 @@ stdenv.mkDerivation rec { sha256 = "1dazxbmzx2g5570pkg519a7fsj07rdr155kjsw7b9y8npql33lls"; }; + # Comment-out the Qt 5.5 version check, as we do apply the relevant patch. + # https://trac.videolan.org/vlc/ticket/16497 + postPatch = if (!withQt5) then null else + "sed '/I78ef29975181ee22429c9bd4b11d96d9e68b7a9c/s/^/: #/' -i configure"; + buildInputs = [ xz bzip2 perl zlib a52dec libmad faad2 ffmpeg alsaLib libdvdnav libdvdnav.libdvdread libbluray dbus fribidi libvorbis libtheora speex lua5 libgcrypt |