summary refs log tree commit diff
path: root/pkgs/tools/compression/hacpack/default.nix
blob: 34722d52ccfd3ffdb96907c0f6843e0a9a7e84a7 (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
{ lib, stdenv, fetchFromGitHub }:

stdenv.mkDerivation rec {
  pname = "hacpack";
  version = "1.36";

  src = fetchFromGitHub {
    owner = "The-4n";
    repo = "hacpack";
    rev = "v${version}";
    sha256 = "0d846l36w1n9rxv79fbyhl2zdbqhlgrvk21b9vzr9x77yki89ygs";
  };

  preConfigure = ''
    mv config.mk.template config.mk
  '';

  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
  enableParallelBuilding = true;

  installPhase = ''
    mkdir -p $out/bin
    cp ./hacpack $out/bin
  '';

  meta = with lib; {
    homepage = "https://github.com/The-4n/hacPack";
    description = "Make and repack Nintendo Switch NCAs/NSPs";
    license = licenses.gpl2Only;
    maintainers = [ maintainers.ivar ];
    platforms = platforms.linux;
  };
}