1{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, makeWrapper
2, perlPackages, libxml2, libiconv }:
3
4stdenv.mkDerivation rec {
5 pname = "hivex";
6 version = "1.3.21";
7
8 src = fetchurl {
9 url = "https://libguestfs.org/download/hivex/${pname}-${version}.tar.gz";
10 sha256 = "sha256-ms4+9KL/LKUKmb4Gi2D7H9vJ6rivU+NF6XznW6S2O1Y=";
11 };
12
13 patches = [ ./hivex-syms.patch ];
14
15 nativeBuildInputs = [ pkg-config ];
16 buildInputs = [
17 autoreconfHook makeWrapper libxml2
18 ]
19 ++ (with perlPackages; [ perl IOStringy ])
20 ++ lib.optionals stdenv.isDarwin [ libiconv ];
21
22 postInstall = ''
23 wrapProgram $out/bin/hivexregedit \
24 --set PERL5LIB "$out/${perlPackages.perl.libPrefix}" \
25 --prefix "PATH" : "$out/bin"
26
27 wrapProgram $out/bin/hivexml \
28 --prefix "PATH" : "$out/bin"
29 '';
30
31 meta = with lib; {
32 description = "Windows registry hive extraction library";
33 license = licenses.lgpl2;
34 homepage = "https://github.com/libguestfs/hivex";
35 maintainers = with maintainers; [offline];
36 platforms = platforms.linux ++ platforms.darwin;
37 };
38}