7 isCross = stdenv.buildPlatform != stdenv.hostPlatform;
8 cross = "${stdenv.hostPlatform.config}";
9 static = stdenv.hostPlatform.isStatic;
11 cc = if !isCross then "cc" else "${cross}-cc";
12 ar = if !isCross then "ar" else "${cross}-ar";
13 ranlib = if !isCross then "ranlib" else "${cross}-ranlib";
15 stdenv.mkDerivation rec {
17 sed -i 's,set --, set -x; set --,' Makefile
21 # In general, static library (.a) goes to "dev", shared (.so) to
22 # "lib". In case of static build, there is no .so library, so "lib"
23 # output is useless and empty.
28 ] ++ lib.optional (!static) "lib";
29 separateDebugInfo = true;
36 ] ++ lib.optional (!static) "shared";
39 mkdir -p $dev/lib $out/bin
40 mv $out/lib/libcdb.a $dev/lib
51 cp libcdb.so* $lib/lib
52 cp cdb-shared $out/bin/cdb
57 url = "http://www.corpit.ru/mjt/tinycdb/${pname}-${version}.tar.gz";
58 sha256 = "sha256-wyG5BekCwsqZo/+Kjd39iCMkf+Ht7IpLuF+Dhpxjn7g=";
63 description = "utility to manipulate constant databases (cdb)";
67 tinycdb is a small, fast and reliable utility and subroutine
68 library for creating and reading constant databases. The database
69 structure is tuned for fast reading.
72 homepage = "https://www.corpit.ru/mjt/tinycdb.html";
73 license = licenses.publicDomain;
74 platforms = platforms.linux;