2023-01-11 07:51:40 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, makeWrapper, perlPackages
|
|
|
|
, ocamlPackages, libxml2, libintl
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "hivex";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.3.23";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-10-07 09:15:18 +00:00
|
|
|
url = "https://libguestfs.org/download/hivex/${pname}-${version}.tar.gz";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-QM9UhPFclGciWfs7makL7285DmPzelKhwGgIogFqa70=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./hivex-syms.patch ];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ocaml/Makefile.am \
|
|
|
|
--replace '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib'
|
|
|
|
'';
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ autoreconfHook makeWrapper perlPackages.perl pkg-config ]
|
|
|
|
++ (with ocamlPackages; [ ocaml findlib ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-04-15 01:41:22 +00:00
|
|
|
libxml2
|
2020-04-24 23:36:52 +00:00
|
|
|
]
|
|
|
|
++ (with perlPackages; [ perl IOStringy ])
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ libintl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/hivexregedit \
|
|
|
|
--set PERL5LIB "$out/${perlPackages.perl.libPrefix}" \
|
|
|
|
--prefix "PATH" : "$out/bin"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/hivexml \
|
|
|
|
--prefix "PATH" : "$out/bin"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Windows registry hive extraction library";
|
2023-01-11 07:51:40 +00:00
|
|
|
license = licenses.lgpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/libguestfs/hivex";
|
|
|
|
maintainers = with maintainers; [offline];
|
2022-09-09 14:08:57 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|