with import <nixpkgs> {} ;
#{ stdenv, fetchurl, pkgconfig, cmake, makeWrapper, qt5 }:

with stdenv.lib;

let
  version = "0.9.1";

in stdenv.mkDerivation {
  name = "qcomicbook-${version}";  

  src = fetchurl {
    url = "https://github.com/stolowski/QComicBook/archive/0.9.1.tar.gz";
    sha256 = "39bb6ba0e20569985c930b0e8bdb19ae9c5453f27e9f7c01c6d44f56fb204619";
  };

  nativeBuildInputs = [
    cmake pkgconfig
  ];

  buildInputs = [
    (with qt5; [qtbase qttools qtx11extras])
    poppler_qt5
  ];

  postInstall = ''
    substituteInPlace $out/share/applications/*.desktop \
      --replace "Exec=qcomicbook" "Exec=$out/bin/qcomicbook"
  '';
}