{ stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, libX11, libXext, qttools }:

stdenv.mkDerivation rec {
  name = "qtstyleplugin-kvantum-${version}";
  version = "0.10.4";

  src = fetchFromGitHub {
    owner = "tsujan";
    repo = "Kvantum";
    rev = "0527bb03f2252269fd382e11181a34ca72c96b4b";
    sha256 = "0ky44s1fgqxraywagx1mv07yz76ppgiz3prq447db78wkwqg2d8p";
  };

  nativeBuildInputs = [ qmake qttools ];
  buildInputs = [ qtbase qtsvg qtx11extras libX11 libXext  ];

  postUnpack = "sourceRoot=\${sourceRoot}/Kvantum";

  postInstall= ''
    mkdir -p $out/$qtPluginPrefix/styles
    mv $NIX_QT5_TMP/$qtPluginPrefix/styles/libkvantum.so $out/$qtPluginPrefix/styles/libkvantum.so
  '';

  meta = with stdenv.lib; {
    description = "SVG-based Qt5 theme engine plus a config tool and extra themes";
    homepage = "https://github.com/tsujan/Kvantum";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = [ maintainers.bugworm ];
    broken = true; # 2018-04-10
  };
}

{ stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, libX11, libXext, qttools }:

stdenv.mkDerivation rec {
  name = "qtstyleplugin-kvantum-${version}";
  version = "0.10.4";

  src = fetchFromGitHub {
    owner = "tsujan";
    repo = "Kvantum";
    rev = "0527bb03f2252269fd382e11181a34ca72c96b4b";
    sha256 = "0ky44s1fgqxraywagx1mv07yz76ppgiz3prq447db78wkwqg2d8p";
  };

  nativeBuildInputs = [ qmake qttools ];
  buildInputs = [ qtbase qtsvg qtx11extras libX11 libXext  ];

  postUnpack = "sourceRoot=\${sourceRoot}/Kvantum";

  postInstall= ''
    mkdir -p $out/$qtPluginPrefix/styles
    mv $NIX_QT5_TMP/$qtPluginPrefix/styles/libkvantum.so $out/$qtPluginPrefix/styles/libkvantum.so
  '';

  meta = with stdenv.lib; {
    description = "SVG-based Qt5 theme engine plus a config tool and extra themes";
    homepage = "https://github.com/tsujan/Kvantum";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = [ maintainers.bugworm ];
  };
}

Revert "qtstyleplugin-kvantum: mark as broken"
Revert "qtstyleplugin-kvantum: mark as broken"

No longer broken on master, fixed by
version bump in 35049f9e61dd4e87413d137122cced4764f50f2f.

This reverts commit 2456b4e4a51073b5cff640f54328240ca315f7fa.
