@@ -1,4 +1,5 @@
1−{ stdenv, lib, fetchurl, pkgs, makeWrapper, bash
1+{ stdenv, fetchurl, makeWrapper
2+, pkgconfig, openssl, fuse, libxml2
23, cabextract ? null
34, cdrkit ? null
45, mtools ? null
@@ -10,37 +11,34 @@ stdenv.mkDerivation rec {
1011 version = "1.12.0";
1112 name = "wimlib-${version}";
1213
13− nativeBuildInputs = with pkgs; [ pkgconfig makeWrapper ];
14− buildInputs = with pkgs; [ openssl fuse libxml2 ntfs3g ];
14+ nativeBuildInputs = [ pkgconfig makeWrapper ];
15+ buildInputs = [ openssl fuse libxml2 ntfs3g ];
1516
1617 src = fetchurl {
1718 url = "https://wimlib.net/downloads/${name}.tar.gz";
1819 sha256 = "852cf59d682a91974f715f09fa98cab621b740226adcfea7a42360be0f86464f";
1920 };
2021
21− prefixPackages = [ cabextract cdrkit mtools ntfs3g syslinux ];
22−
2322 preBuild = ''
24− substituteInPlace programs/mkwinpeimg.in --replace '/usr/lib/syslinux' "${syslinux}/share/syslinux"
23+ substituteInPlace programs/mkwinpeimg.in \
24+ --replace '/usr/lib/syslinux' "${syslinux}/share/syslinux"
2525 '';
2626
27− postInstall = ''
27+ postInstall = let
28+ path = stdenv.lib.makeBinPath [ cabextract cdrkit mtools ntfs3g syslinux ];
29+ in ''
2830 for prog in $out/bin/*; do
29− wrapProgram $prog --prefix PATH : ${lib.makeBinPath prefixPackages}
31+ wrapProgram $prog --prefix PATH : ${path}
3032 done
3133 '';
3234
3335 doCheck = true;
3436
35− checkPhase = ''
36− patchShebangs tests/
37− for testfile in tests/test-*; do
38− wrapProgram $testfile --prefix PATH : ${lib.makeBinPath prefixPackages}
39− done
40− make check
37+ preCheck = ''
38+ patchShebangs tests
4139 '';
4240
43− meta = with lib; {
41+ meta = with stdenv.lib; {
4442 homepage = https://wimlib.net;
4543 description = "A library and program to extract, create, and modify WIM files";
4644 platforms = platforms.unix;