···11+{ fetchurl, stdenv, cmake }:
22+33+stdenv.mkDerivation rec {
44+ name = "cmocka-${version}";
55+ version = "1.0.1";
66+77+ src = fetchurl {
88+ url = "https://cmocka.org/files/1.0/cmocka-${version}.tar.xz";
99+ sha256 = "0fvm6rdalqcxckbddch8ycdw6n2ckldblv117n09chi2l7bm0q5k";
1010+ };
1111+1212+ buildInputs = [ cmake ];
1313+1414+ meta = with stdenv.lib; {
1515+ description = "Lightweight library to simplify and generalize unit tests for C";
1616+1717+ longDescription =
1818+ ''There are a variety of C unit testing frameworks available however
1919+ many of them are fairly complex and require the latest compiler
2020+ technology. Some development requires the use of old compilers which
2121+ makes it difficult to use some unit testing frameworks. In addition
2222+ many unit testing frameworks assume the code being tested is an
2323+ application or module that is targeted to the same platform that will
2424+ ultimately execute the test. Because of this assumption many
2525+ frameworks require the inclusion of standard C library headers in the
2626+ code module being tested which may collide with the custom or
2727+ incomplete implementation of the C library utilized by the code under
2828+ test.
2929+3030+ Cmocka only requires a test application is linked with the standard C
3131+ library which minimizes conflicts with standard C library headers.
3232+ Also, CMocka tries to avoid the use of some of the newer features of
3333+ C compilers.
3434+3535+ This results in CMocka being a relatively small library that can be
3636+ used to test a variety of exotic code. If a developer wishes to
3737+ simply test an application with the latest compiler then other unit
3838+ testing frameworks may be preferable.
3939+4040+ This is the successor of Google's Cmockery.'';
4141+4242+ homepage = https://cmocka.org/;
4343+4444+ license = licenses.asl20;
4545+ platforms = platforms.all;
4646+ maintainers = with maintainers; [ kragniz ];
4747+ };
4848+}