Merge #22751: lmdb: split outputs, share lib, ...

This commit is contained in:
Vladimír Čunát 2017-02-13 21:29:35 +01:00
commit 9fe4c1eb6e
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
3 changed files with 24 additions and 9 deletions

View File

@ -14,14 +14,28 @@ in stdenv.mkDerivation rec {
postUnpack = "sourceRoot=\${sourceRoot}/libraries/liblmdb";
makeFlags = ["prefix=$(out)"]
++ optional stdenv.cc.isClang "CC=clang";
outputs = [ "bin" "out" "dev" ];
makeFlags = [ "prefix=$(out)" "CC=cc" ];
doCheck = true;
checkPhase = "make test";
preInstall = ''
mkdir -p $out/{bin,lib,include}
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" <<EOF
Name: lmdb
Description: ${meta.description}
Version: ${version}
Cflags: -I$dev/include
Libs: -L$out/lib -llmdb
EOF
'';
meta = with stdenv.lib; {
@ -34,7 +48,7 @@ in stdenv.mkDerivation rec {
limited to the size of the virtual address space.
'';
homepage = http://symas.com/mdb/;
maintainers = with maintainers; [ jb55 ];
maintainers = with maintainers; [ jb55 vcunat ];
license = licenses.openldap;
platforms = platforms.all;
};

View File

@ -16,15 +16,17 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ];
buildInputs = [
gnutls jansson liburcu libidn
gnutls jansson liburcu libidn lmdb
nettle libedit
libiconv
# without sphinx &al. for developer documentation
]
# Use embedded lmdb there for now, as detection is broken on Darwin somehow.
++ stdenv.lib.optionals stdenv.isLinux [ libcap_ng systemd lmdb ]
++ stdenv.lib.optionals stdenv.isLinux [ libcap_ng systemd ]
++ stdenv.lib.optional stdenv.isDarwin zlib; # perhaps due to gnutls
configureFlags = [ "--with-lmdb=${stdenv.lib.getLib lmdb}"/*not perfect*/ ];
enableParallelBuilding = true;
CFLAGS = [ "-O2" "-DNDEBUG" ];

View File

@ -23,8 +23,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig which makeWrapper hexdump ];
buildInputs = [ knot-dns luajit libuv gnutls ]
# TODO: lmdb needs lmdb.pc; embedded for now
buildInputs = [ knot-dns lmdb luajit libuv gnutls ]
## optional dependencies
++ optional doInstallCheck cmocka
++ optional stdenv.isLinux systemd # socket activation