@@ -27,6 +27,12 @@ stdenv.mkDerivation rec {
2727 sha256 = "1gjkrwlg8ab3skzl67cxb9qzg4187ifckd1z9kpy11q058fyjchn";
2828 };
2929
30+ patches = optional withQt5 (fetchurl {
31+ name = "Fix-build-using-old-GCC-intrinsics.patch";
32+ url = "https://patches.videolan.org/patch/14061/raw/";
33+ sha256 = "16v4k7378a590diz11bdvdaqi9cpf6333hp5wr6v5sfrsma8qvpx";
34+ });
35+
3036 # Comment-out the Qt 5.5 version check, as we do apply the relevant patch.
3137 # https://trac.videolan.org/vlc/ticket/16497
3238 postPatch = if (!withQt5) then null else
@@ -50,6 +56,15 @@ stdenv.mkDerivation rec {
5056
5157 LIVE555_PREFIX = live555;
5258
59+ preConfigure = ''
60+ sed -e "s@/bin/echo@echo@g" -i configure
61+ '' + optionalString withQt5 ''
62+ # Make sure we only *add* "-std=c++11" to CXXFLAGS instead of overriding the
63+ # values figured out by configure (for example "-g -O2").
64+ sed -i -re '/^ *CXXFLAGS=("[^$"]+")? *$/s/CXXFLAGS="?/&-std=c++11 /' \
65+ configure
66+ '';
67+
5368 configureFlags =
5469 [ "--enable-alsa"
5570 "--with-kde-solid=$out/share/apps/solid/actions"
@@ -61,8 +76,6 @@ stdenv.mkDerivation rec {
6176 ]
6277 ++ optional onlyLibVLC "--disable-vlc";
6378
64− preConfigure = ''sed -e "s@/bin/echo@echo@g" -i configure'';
65−
6679 enableParallelBuilding = true;
6780
6881 preBuild = ''
@@ -76,9 +89,5 @@ stdenv.mkDerivation rec {
7689 homepage = http://www.videolan.org/vlc/;
7790 platforms = platforms.linux;
7891 license = licenses.lgpl21Plus;
79− broken =
80− if withQt5
81− then builtins.compareVersions qtbase.version "5.7.0" >= 0
82− else false;
8392 };
8493}