lmdb: fix library id on darwin

This commit is contained in:
Daiderd Jordan 2017-09-22 23:12:12 +02:00
parent 456e96fbbf
commit 84bd2f4ab0
No known key found for this signature in database
GPG Key ID: D02435D05B810C96

View File

@ -1,7 +1,6 @@
{ stdenv, fetchFromGitHub }: { stdenv, fetchFromGitHub }:
let optional = stdenv.lib.optional; stdenv.mkDerivation rec {
in stdenv.mkDerivation rec {
name = "lmdb-${version}"; name = "lmdb-${version}";
version = "0.9.21"; version = "0.9.21";
@ -16,7 +15,8 @@ in stdenv.mkDerivation rec {
outputs = [ "bin" "out" "dev" ]; outputs = [ "bin" "out" "dev" ];
makeFlags = [ "prefix=$(out)" "CC=cc" ]; makeFlags = [ "prefix=$(out)" "CC=cc" ]
++ stdenv.lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so";
doCheck = true; doCheck = true;
checkPhase = "make test"; checkPhase = "make test";
@ -25,12 +25,6 @@ in stdenv.mkDerivation rec {
moveToOutput bin "$bin" moveToOutput bin "$bin"
moveToOutput "lib/*.a" REMOVE # until someone needs it moveToOutput "lib/*.a" REMOVE # until someone needs it
'' ''
# fix bogus library name
+ stdenv.lib.optionalString stdenv.isDarwin ''
mv "$out"/lib/liblmdb.{so,dylib}
''
# add lmdb.pc (dynamic only) # add lmdb.pc (dynamic only)
+ '' + ''
mkdir -p "$dev/lib/pkgconfig" mkdir -p "$dev/lib/pkgconfig"