depot/pkgs/by-name/mt/mtdutils/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

74 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchgit,
autoreconfHook,
pkg-config,
cmocka,
acl,
libuuid,
lzo,
util-linux,
zlib,
zstd,
}:
stdenv.mkDerivation rec {
pname = "mtd-utils";
version = "2.2.1";
src = fetchgit {
url = "git://git.infradead.org/mtd-utils.git";
rev = "v${version}";
hash = "sha256-vGgBOKu+ClmyRZHQkAS8r/YJtZihr/oD/yj8V7DeAQ8=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
] ++ lib.optional doCheck cmocka;
buildInputs = [
acl
libuuid
lzo
util-linux
zlib
zstd
];
postPatch = ''
substituteInPlace ubifs-utils/mount.ubifs \
--replace-fail "/bin/mount" "${util-linux}/bin/mount"
'';
enableParallelBuilding = true;
configureFlags = [
(lib.enableFeature doCheck "unit-tests")
(lib.enableFeature doCheck "tests")
];
makeFlags = [ "AR:=$(AR)" ];
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
outputs = [
"out"
"dev"
];
postInstall = ''
mkdir -p $dev/lib
mv *.a $dev/lib/
mv include $dev/
'';
meta = with lib; {
description = "Tools for MTD filesystems";
downloadPage = "https://git.infradead.org/mtd-utils.git";
license = licenses.gpl2Plus;
homepage = "http://www.linux-mtd.infradead.org/";
maintainers = with lib.maintainers; [ skeuchel ];
platforms = with platforms; linux;
};
}