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

View File

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

View File

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