about summary refs log tree commit diff
path: root/pkgs/tools/archivers/innoextract/default.nix
blob: 1219c48ab7d295380547095cdd0a3c1523ff004d (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
42
43
44
45
46
{ lib
, stdenv
, fetchurl
, cmake
, makeWrapper
, boost
, xz
, libiconv
, withGog ? false
, unar ? null
}:

stdenv.mkDerivation rec {
  pname = "innoextract";
  version = "1.9";

  src = fetchurl {
    url = "https://constexpr.org/innoextract/files/innoextract-${version}.tar.gz";
    sha256 = "09l1z1nbl6ijqqwszdwch9mqr54qb7df0wp2sd77v17dq6gsci33";
  };

  buildInputs = [ xz boost ]
    ++ lib.optionals stdenv.isDarwin [ libiconv ];

  # Python is reported as missing during the build, however
  # including Python does not change the output.

  nativeBuildInputs = [ cmake makeWrapper ];

  strictDeps = true;

  # we need unar to for multi-archive extraction
  postFixup = lib.optionalString withGog ''
    wrapProgram $out/bin/innoextract \
      --prefix PATH : ${lib.makeBinPath [ unar ]}
  '';

  meta = with lib; {
    description = "Tool to unpack installers created by Inno Setup";
    homepage = "https://constexpr.org/innoextract/";
    license = licenses.zlib;
    maintainers = with maintainers; [ abbradar ];
    platforms = platforms.unix;
    mainProgram = "innoextract";
  };
}