Summary Files Commits Branches @commit @diff @stats
path: root / packages / CapacityTester / default.nix
blob: f29e63b71e8f6c85ce46dab974c4b49bb8946946 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  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
  '';
}