Skip to content

Commit

Permalink
lmdb: fix library id on darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
LnL7 committed Sep 22, 2017
1 parent 456e96f commit 84bd2f4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkgs/development/libraries/lmdb/default.nix
@@ -1,7 +1,6 @@
{ stdenv, fetchFromGitHub }:

let optional = stdenv.lib.optional;
in stdenv.mkDerivation rec {
stdenv.mkDerivation rec {
name = "lmdb-${version}";
version = "0.9.21";

Expand All @@ -16,7 +15,8 @@ in stdenv.mkDerivation rec {

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;
checkPhase = "make test";
Expand All @@ -25,12 +25,6 @@ in stdenv.mkDerivation rec {
moveToOutput bin "$bin"
moveToOutput "lib/*.a" REMOVE # until someone needs it
''

# fix bogus library name
+ stdenv.lib.optionalString stdenv.isDarwin ''
mv "$out"/lib/liblmdb.{so,dylib}

This comment has been minimized.

Copy link
@LnL7

LnL7 Sep 22, 2017

Author Member

@vcunat Do you remember why you added this? I don't see how this could have worked without a proper install_name.

This comment has been minimized.

Copy link
@vcunat

vcunat Sep 23, 2017

Member

I certainly didn't really run it on a darwin machine, just trying to fix some depending builds on Hydra. I was under impression that .dylib extension is always used for usual libraries, so I assumed that was triggering some build failures I saw.

This comment has been minimized.

Copy link
@LnL7

LnL7 Sep 23, 2017

Author Member

alright, the LDFLAGS should fix the library for dependencies

This comment has been minimized.

Copy link
@vcunat

vcunat Sep 23, 2017

Member

Thanks, builds of the reverse dependencies work now OK :-) (at least)

''

# add lmdb.pc (dynamic only)
+ ''
mkdir -p "$dev/lib/pkgconfig"
Expand Down

0 comments on commit 84bd2f4

Please sign in to comment.