about summary refs log tree commit diff
path: root/pkgs/applications/science/misc/convertall/default.nix
blob: 9a7ac2a8b13c4bf1fd2b69211e479fbdea470dee (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
{ lib, stdenv, fetchFromGitHub, python3, wrapQtAppsHook }:

let
  inherit (python3.pkgs) wrapPython pyqt5;
in stdenv.mkDerivation rec {
  pname = "convertall";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "doug-101";
    repo = "ConvertAll";
    rev = "v${version}";
    sha256 = "02xxasgbjbivsbhyfpn3cpv52lscdx5kc95s6ns1dvnmdg0fpng0";
  };

  nativeBuildInputs = [ python3 wrapPython wrapQtAppsHook ];

  propagatedBuildInputs = [ pyqt5 ];

  installPhase = ''
    python3 install.py -p $out -x
  '';

  postFixup = ''
    buildPythonPath $out
    patchPythonScript $out/share/convertall/convertall.py
    makeQtWrapper $out/share/convertall/convertall.py $out/bin/convertall
  '';

  meta = with lib; {
    homepage = "https://convertall.bellz.org/";
    description = "Graphical unit converter";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ orivej ];
    platforms = pyqt5.meta.platforms;
  };
}