1{ lib, stdenv, fetchgit, autoreconfHook, pkg-config, cmocka, acl, libuuid, lzo, zlib, zstd }:
2
3stdenv.mkDerivation rec {
4 pname = "mtd-utils";
5 version = "2.1.5";
6
7 src = fetchgit {
8 url = "git://git.infradead.org/mtd-utils.git";
9 rev = "v${version}";
10 sha256 = "sha256-Ph9Xjb2Nyo7l3T1pDgW2gnSJxn0pOC6uvCGUfCh0MXU=";
11 };
12
13 nativeBuildInputs = [ autoreconfHook pkg-config ] ++ lib.optional doCheck cmocka;
14 buildInputs = [ acl libuuid lzo zlib zstd ];
15
16 enableParallelBuilding = true;
17
18 configureFlags = with lib; [
19 (enableFeature doCheck "unit-tests")
20 (enableFeature doCheck "tests")
21 ];
22
23 doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
24
25 outputs = [ "out" "dev" ];
26
27 postInstall = ''
28 mkdir -p $dev/lib
29 mv *.a $dev/lib/
30 mv include $dev/
31 '';
32
33 meta = with lib; {
34 description = "Tools for MTD filesystems";
35 downloadPage = "https://git.infradead.org/mtd-utils.git";
36 license = licenses.gpl2Plus;
37 homepage = "http://www.linux-mtd.infradead.org/";
38 maintainers = with maintainers; [ viric ];
39 platforms = with platforms; linux;
40 };
41}