From a2304646977cf5cd55d5e11837fa6ae2a6867b27 Mon Sep 17 00:00:00 2001
From: bugworm <bugworm@zoho.com>
Date: Sun, 23 Jul 2017 21:52:17 +0300
Subject: [PATCH] qtstyleplugin-kvantum: init at 0.10.4

---
 .../qtstyleplugin-kvantum-qt4/default.nix     | 37 +++++++++++++++++++
 .../qtstyleplugin-kvantum/default.nix         | 30 +++++++++++++++
 pkgs/top-level/all-packages.nix               |  4 ++
 3 files changed, 71 insertions(+)
 create mode 100644 pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
 create mode 100644 pkgs/development/libraries/qtstyleplugin-kvantum/default.nix

diff --git a/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix b/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
new file mode 100644
index 000000000000..c99c2ee7c543
--- /dev/null
+++ b/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub, qmake4Hook , qt4, libX11, libXext }:
+
+stdenv.mkDerivation rec {
+  name = "qtstyleplugin-kvantum-qt4-${version}";
+  version = "0.10.4";
+
+  src = fetchFromGitHub {
+    owner = "tsujan";
+    repo = "Kvantum";
+    rev = "0527bb03f2252269fd382e11181a34ca72c96b4b";
+    sha256 = "0ky44s1fgqxraywagx1mv07yz76ppgiz3prq447db78wkwqg2d8p";
+  };
+
+  nativeBuildInputs = [ qmake4Hook ];
+  buildInputs = [ qt4 libX11 libXext ];
+
+  postUnpack = "sourceRoot=\${sourceRoot}/Kvantum";
+
+  buildPhase = ''
+    qmake kvantum.pro
+    make
+  '';
+
+  installPhase = ''
+    mkdir $TMP/kvantum
+    make INSTALL_ROOT="$TMP/kvantum" install
+    mv $TMP/kvantum/usr/ $out
+    mv $TMP/kvantum/${qt4}/lib $out
+  '';
+
+  meta = with stdenv.lib; {
+    description = "SVG-based Qt4 theme engine";
+    homepage = "https://github.com/tsujan/Kvantum";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
new file mode 100644
index 000000000000..79b48934a8e6
--- /dev/null
+++ b/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
@@ -0,0 +1,30 @@
+{ 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;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f3dc88a54e23..de376222b4f4 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8069,6 +8069,8 @@ with pkgs;
 
   qt-gstreamer1 = callPackage ../development/libraries/gstreamer/qt-gstreamer { boost = boost155;};
 
+  qtstyleplugin-kvantum-qt4 = callPackage ../development/libraries/qtstyleplugin-kvantum-qt4 { };
+
   gnet = callPackage ../development/libraries/gnet { };
 
   gnu-config = callPackage ../development/libraries/gnu-config { };
@@ -9986,6 +9988,8 @@ with pkgs;
 
     qtstyleplugins = callPackage ../development/libraries/qtstyleplugins { };
 
+    qtstyleplugin-kvantum = libsForQt5.callPackage ../development/libraries/qtstyleplugin-kvantum { };
+
     quazip = callPackage ../development/libraries/quazip { };
 
     qwt = callPackage ../development/libraries/qwt/6.nix { };