about summary refs log tree commit diff
path: root/pkgs/by-name/go/gordonflashtool/package.nix
blob: 63fecf970c716d8ad7673a154413a95455908362 (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
{ lib, stdenv, fetchFromGitHub, nasm, unixtools }:

let
  version = "10";
in

stdenv.mkDerivation {
  pname = "gordonflashtool";
  inherit version;

  src = fetchFromGitHub {
    owner = "marmolak";
    repo = "GordonFlashTool";
    rev = "release-${version}";
    hash = "sha256-/zpw7kVdQeR7QcRsP1+qcu8+hlEQTGwOKClJkwVcBPg=";
  };

  nativeBuildInputs = [ nasm unixtools.xxd ];

  buildPhase = ''
    runHook preBuild
    # build the gordon binary
    make all-boot-code
    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall
    install -Dm755 gordon $out/bin/gordon
    runHook postInstall
  '';

  meta = {
    homepage = "https://github.com/marmolak/GordonFlashTool";
    description = "Toolset for Gotek SFR1M44-U100 formatted usb flash drives.";
    maintainers = with lib.maintainers; [ marmolak ];
    license = lib.licenses.bsd3;
    platforms = lib.platforms.all;
    mainProgram = "gordon";
  };
}