nixpkgs/pkgs/by-name/wi/wimlib/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

52 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper
, pkg-config
, cabextract ? null
, cdrkit ? null
, mtools ? null
, fuse3 ? null
, ntfs3g ? null
, syslinux ? null
}:
stdenv.mkDerivation rec {
version = "1.14.4";
pname = "wimlib";
nativeBuildInputs = [ pkg-config makeWrapper ];
buildInputs = [ ntfs3g ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ fuse3 ];
src = fetchurl {
url = "https://wimlib.net/downloads/${pname}-${version}.tar.gz";
hash = "sha256-NjPbK2yLJV64bTvz3zBZeWvR8I5QuMlyjH62ZmLlEwA=";
};
enableParallelBuilding = true;
preBuild = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
substituteInPlace programs/mkwinpeimg.in \
--replace '/usr/lib/syslinux' "${syslinux}/share/syslinux"
'';
postInstall = let
path = lib.makeBinPath ([ cabextract mtools ntfs3g ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ cdrkit syslinux fuse3 ]);
in ''
for prog in $out/bin/*; do
wrapProgram $prog --prefix PATH : $out/bin:${path}
done
'';
doCheck = (!stdenv.hostPlatform.isDarwin);
preCheck = ''
patchShebangs tests
'';
meta = with lib; {
homepage = "https://wimlib.net";
description = "Library and program to extract, create, and modify WIM files";
platforms = platforms.unix;
maintainers = [ ];
license = with licenses; [ gpl3 lgpl3 mit ];
};
}