anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / science / robotics / sumorobot-manager / default.nix
bloba26bd5d5fc288b4bd35929aab3e6fead6cb16249
1 { lib, stdenv, python3, qt5, fetchFromGitHub, wrapPython, pyqt5, pyserial, dos2unix }:
3 stdenv.mkDerivation rec {
4   pname = "sumorobot-manager";
5   version = "1.0.0";
7   src = fetchFromGitHub {
8     owner = "robokoding";
9     repo = pname;
10     rev = "v${version}";
11     sha256 = "07snhwmqqp52vdgr66vx50zxx0nmpmns5cdjgh50hzlhji2z1fl9";
12   };
14   buildInputs = [ python3 ];
15   pythonPath = [
16     pyqt5.dev pyserial
17   ];
19   nativeBuildInputs = [ wrapPython qt5.wrapQtAppsHook dos2unix ];
21   dontBuild = true;
23   installPhase = ''
24     mkdir -p $out/opt/sumorobot-manager
25     cp -r main.py lib res $out/opt/sumorobot-manager
26     chmod -R 644 $out/opt/sumorobot-manager/lib/*
27     mkdir $out/bin
28     dos2unix $out/opt/sumorobot-manager/main.py
29     makeQtWrapper $out/opt/sumorobot-manager/main.py $out/bin/sumorobot-manager \
30       --chdir "$out/opt/sumorobot-manager"
31   '';
33   preFixup = ''
34     patchShebangs $out/opt/sumorobot-manager/main.py
35     wrapPythonProgramsIn "$out/opt" "$pythonPath"
36   '';
38   meta = with lib; {
39     description = "Desktop App for managing SumoRobots";
40     mainProgram = "sumorobot-manager";
41     homepage = "https://www.robokoding.com/kits/sumorobot/sumomanager/";
42     license = licenses.mit;
43     maintainers = with maintainers; [ abbradar ];
44   };