btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / go / gordonflashtool / package.nix
blob7f49895739a26d8bce40a0e1a5d196701158459f
1 { lib, stdenv, fetchFromGitHub, nasm, unixtools }:
3 let
4   version = "10";
5 in
7 stdenv.mkDerivation {
8   pname = "gordonflashtool";
9   inherit version;
11   src = fetchFromGitHub {
12     owner = "marmolak";
13     repo = "GordonFlashTool";
14     rev = "release-${version}";
15     hash = "sha256-/zpw7kVdQeR7QcRsP1+qcu8+hlEQTGwOKClJkwVcBPg=";
16   };
18   nativeBuildInputs = [ nasm unixtools.xxd ];
20   buildPhase = ''
21     runHook preBuild
22     # build the gordon binary
23     make all-boot-code
24     runHook postBuild
25   '';
27   installPhase = ''
28     runHook preInstall
29     install -Dm755 gordon $out/bin/gordon
30     runHook postInstall
31   '';
33   meta = {
34     homepage = "https://github.com/marmolak/GordonFlashTool";
35     description = "Toolset for Gotek SFR1M44-U100 formatted usb flash drives";
36     maintainers = with lib.maintainers; [ marmolak ];
37     license = lib.licenses.bsd3;
38     platforms = lib.platforms.all;
39     mainProgram = "gordon";
40   };