@@ -0,0 +1,48 @@
1+{ stdenv, fetchurl, makeWrapper
2+, pkgconfig, openssl, fuse, libxml2
3+, cabextract ? null
4+, cdrkit ? null
5+, mtools ? null
6+, ntfs3g ? null
7+, syslinux ? null
8+}:
9+
10+stdenv.mkDerivation rec {
11+ version = "1.12.0";
12+ name = "wimlib-${version}";
13+
14+ nativeBuildInputs = [ pkgconfig makeWrapper ];
15+ buildInputs = [ openssl fuse libxml2 ntfs3g ];
16+
17+ src = fetchurl {
18+ url = "https://wimlib.net/downloads/${name}.tar.gz";
19+ sha256 = "852cf59d682a91974f715f09fa98cab621b740226adcfea7a42360be0f86464f";
20+ };
21+
22+ preBuild = ''
23+ substituteInPlace programs/mkwinpeimg.in \
24+ --replace '/usr/lib/syslinux' "${syslinux}/share/syslinux"
25+ '';
26+
27+ postInstall = let
28+ path = stdenv.lib.makeBinPath [ cabextract cdrkit mtools ntfs3g syslinux ];
29+ in ''
30+ for prog in $out/bin/*; do
31+ wrapProgram $prog --prefix PATH : ${path}
32+ done
33+ '';
34+
35+ doCheck = true;
36+
37+ preCheck = ''
38+ patchShebangs tests
39+ '';
40+
41+ meta = with stdenv.lib; {
42+ homepage = https://wimlib.net;
43+ description = "A library and program to extract, create, and modify WIM files";
44+ platforms = platforms.unix;
45+ maintainers = with maintainers; [ andir ];
46+ license = with licenses; [ gpl3 lgpl3 cc0 ];
47+ };
48+}