{ lib, stdenv, fetchFromGitHub, qt5, pkg-config, libusb1, ... }: stdenv.mkDerivation rec { pname = "CapacityTester"; version = "v0.7c"; src = fetchFromGitHub { owner = "c0xc"; repo = pname; rev = "refs/tags/" + version; hash = "sha256-Do2W09q5EbbqqMiWJtny47S8T/eeVNVNOzU+kW2bS34="; fetchSubmodules = true; # Thanks https://github.com/NixOS/nixpkgs/pull/458145 preFetch = '' # Can't clone using ssh export GIT_CONFIG_COUNT=1 export GIT_CONFIG_KEY_0=url.https://github.com/.insteadOf export GIT_CONFIG_VALUE_0=git@github.com: ''; }; buildInputs = [ pkg-config qt5.qtbase ]; nativeBuildInputs = [ qt5.qmake qt5.wrapQtAppsHook qt5.qttools libusb1 ]; postPatch = '' sed -i "/target.path/s|/usr|$out|" capacitytester.pro ''; }