10 sha256 = "1iajg55n47hqxcpdzmyq4g4aprx7bzxcp885i850h355k5vmf68r";
11 # Please don’t forget to update the docs:
12 # clone https://github.com/Profpatsch/cdb-docs
13 # and create a pull request with the result of running
15 # from the repository’s root folder.
16 docRepo = fetchFromGitHub {
19 rev = "359b6c55c9e170ebfc88f3f38face8ae2315eacb";
20 sha256 = "1y0ivviy58i0pmavhvrpznc4yjigjknff298gnw9rkg5wxm0gbbq";
29 url = "https://cr.yp.to/cdb/cdb-${version}.tar.gz";
39 env.NIX_CFLAGS_COMPILE = toString [
40 "-Wno-error=implicit-int"
41 "-Wno-error=implicit-function-declaration"
45 # A little patch, borrowed from Archlinux AUR, borrowed from Gentoo Portage
46 sed -e 's/^extern int errno;$/#include <errno.h>/' -i error.h
50 # don't use make setup, but move the binaries ourselves
52 install -m 755 -t $bin/bin/ cdbdump cdbget cdbmake cdbmake-12 cdbmake-sv cdbstats cdbtest
54 # patch paths in scripts
55 function cdbmake-subst {
56 substituteInPlace $bin/bin/$1 \
57 --replace /usr/local/bin/cdbmake $bin/bin/cdbmake
59 cdbmake-subst cdbmake-12
60 cdbmake-subst cdbmake-sv
63 mkdir -p $doc/share/cdb
64 cp -r "${docRepo}/docs" $doc/share/cdb/html
68 homepage = "https://cr.yp.to/cdb.html";
69 license = lib.licenses.publicDomain;
70 maintainers = [ lib.maintainers.Profpatsch ];
71 platforms = lib.platforms.unix;