lmdb: fix cross compilation to mingwW64

amesgen c745afad 87995157

+27 -3
+21
pkgs/development/libraries/lmdb/bin-ext.patch
··· 1 + diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile 2 + index 612484e..2e6b562 100644 3 + --- a/libraries/liblmdb/Makefile 4 + +++ b/libraries/liblmdb/Makefile 5 + @@ -27,6 +27,7 @@ CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS) 6 + LDLIBS = 7 + SOLIBS = 8 + SOEXT = .so 9 + +BINEXT = 10 + prefix = /usr/local 11 + exec_prefix = $(prefix) 12 + bindir = $(exec_prefix)/bin 13 + @@ -49,7 +50,7 @@ install: $(ILIBS) $(IPROGS) $(IHDRS) 14 + mkdir -p $(DESTDIR)$(libdir) 15 + mkdir -p $(DESTDIR)$(includedir) 16 + mkdir -p $(DESTDIR)$(mandir)/man1 17 + - for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done 18 + + for f in $(IPROGS); do cp $$f$(BINEXT) $(DESTDIR)$(bindir); done 19 + for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done 20 + for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done 21 + for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
+6 -3
pkgs/development/libraries/lmdb/default.nix
··· 1 - { lib, stdenv, fetchFromGitLab }: 1 + { lib, stdenv, fetchFromGitLab, windows }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "lmdb"; ··· 14 14 15 15 postUnpack = "sourceRoot=\${sourceRoot}/libraries/liblmdb"; 16 16 17 - patches = [ ./hardcoded-compiler.patch ]; 17 + patches = [ ./hardcoded-compiler.patch ./bin-ext.patch ]; 18 18 patchFlags = [ "-p3" ]; 19 19 20 20 outputs = [ "bin" "out" "dev" ]; 21 + 22 + buildInputs = lib.optional stdenv.hostPlatform.isWindows windows.pthreads; 21 23 22 24 makeFlags = [ 23 25 "prefix=$(out)" 24 26 "CC=${stdenv.cc.targetPrefix}cc" 25 27 "AR=${stdenv.cc.targetPrefix}ar" 26 28 ] 27 - ++ lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so"; 29 + ++ lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so" 30 + ++ lib.optionals stdenv.hostPlatform.isWindows [ "SOEXT=.dll" "BINEXT=.exe" ]; 28 31 29 32 doCheck = true; 30 33 checkTarget = "test";