about summary refs log tree commit diff
path: root/pkgs/by-name/co/corrscope/package.nix
blob: 8b8607d723a6ff2cfd120e26ea08be2a4fa9659e (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ stdenv
, lib
, python3Packages
, fetchFromGitHub
, ffmpeg
, libsForQt5
, testers
, corrscope
}:

python3Packages.buildPythonApplication rec {
  pname = "corrscope";
  version = "0.9.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "corrscope";
    repo = "corrscope";
    rev = "refs/tags/${version}";
    hash = "sha256-SKsPe68CNaoUzGjMZn4azGFM3SbBipHK8gJcrm4+T+I=";
  };

  pythonRelaxDeps = [ "attrs" "ruamel.yaml" ];

  nativeBuildInputs = (with libsForQt5; [
    wrapQtAppsHook
  ]) ++ (with python3Packages; [
    poetry-core
    pythonRelaxDepsHook
  ]);

  buildInputs = [
    ffmpeg
  ] ++ (with libsForQt5; [
    qtbase
  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
    qtwayland
  ]);

  propagatedBuildInputs = with python3Packages; [
    appdirs
    appnope
    atomicwrites
    attrs
    click
    matplotlib
    numpy
    packaging
    qtpy
    pyqt5
    ruamel-yaml
    colorspacious
  ];

  dontWrapQtApps = true;

  preFixup = ''
    makeWrapperArgs+=(
      --prefix PATH : ${lib.makeBinPath [ ffmpeg ]}
      "''${qtWrapperArgs[@]}"
    )
  '';

  passthru.tests.version = testers.testVersion {
    package = corrscope;
    # Tries writing to
    # - $HOME/.local/share/corrscope on Linux
    # - $HOME/Library/Application Support/corrscope on Darwin
    command = "env HOME=$TMPDIR ${lib.getExe corrscope} --version";
  };

  meta = with lib; {
    description = "Render wave files into oscilloscope views, featuring advanced correlation-based triggering algorithm";
    longDescription = ''
      Corrscope renders oscilloscope views of WAV files recorded from chiptune (game music from
      retro sound chips).

      Corrscope uses "waveform correlation" to track complex waves (including SNES and Sega
      Genesis/FM synthesis) which jump around on other oscilloscope programs.
    '';
    homepage = "https://github.com/corrscope/corrscope";
    license = licenses.bsd2;
    maintainers = with maintainers; [ OPNA2608 ];
    platforms = platforms.all;
    mainProgram = "corr";
  };
}