1{ lib, stdenv, fetchFromGitHub }:
2
3stdenv.mkDerivation rec {
4 pname = "hactool";
5 version = "1.4.0";
6
7 src = fetchFromGitHub {
8 owner = "SciresM";
9 repo = "hactool";
10 rev = version;
11 sha256 = "0305ngsnwm8npzgyhyifasi4l802xnfz19r0kbzzniirmcn4082d";
12 };
13
14 patches = [ ./musl-compat.patch ];
15
16 preBuild = ''
17 mv config.mk.template config.mk
18 '';
19
20 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
21 enableParallelBuilding = true;
22
23 installPhase = ''
24 install -D hactool $out/bin/hactool
25 '';
26
27 meta = with lib; {
28 homepage = "https://github.com/SciresM/hactool";
29 description = "A tool to manipulate common file formats for the Nintendo Switch";
30 longDescription = "A tool to view information about, decrypt, and extract common file formats for the Nintendo Switch, especially Nintendo Content Archives";
31 license = licenses.isc;
32 maintainers = with maintainers; [ ivar ];
33 platforms = platforms.unix;
34 };
35}