{ stdenv, fetchFromGitHub }: let optional = stdenv.lib.optional; in stdenv.mkDerivation rec { name = "lmdb-${version}"; version = "0.9.19"; src = fetchFromGitHub { owner = "LMDB"; repo = "lmdb"; rev = "LMDB_${version}"; sha256 = "04qx803jdmhkcam748fn0az3cyzvj91lw28kcvwfyq0al7pmjkfs"; }; postUnpack = "sourceRoot=\${sourceRoot}/libraries/liblmdb"; outputs = [ "bin" "out" "dev" ]; makeFlags = [ "prefix=$(out)" "CC=cc" ]; doCheck = true; checkPhase = "make test"; postInstall = '' moveToOutput bin "$bin" moveToOutput "lib/*.a" REMOVE # until someone needs it '' # add lmdb.pc (dynamic only) + '' mkdir -p "$dev/lib/pkgconfig" cat > "$dev/lib/pkgconfig/lmdb.pc" <