tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
lmdb: fix cross compilation to mingwW64
amesgen
3 years ago
c745afad
87995157
+27
-3
2 changed files
expand all
collapse all
unified
split
pkgs
development
libraries
lmdb
bin-ext.patch
default.nix
+21
pkgs/development/libraries/lmdb/bin-ext.patch
···
1
1
+
diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile
2
2
+
index 612484e..2e6b562 100644
3
3
+
--- a/libraries/liblmdb/Makefile
4
4
+
+++ b/libraries/liblmdb/Makefile
5
5
+
@@ -27,6 +27,7 @@ CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS)
6
6
+
LDLIBS =
7
7
+
SOLIBS =
8
8
+
SOEXT = .so
9
9
+
+BINEXT =
10
10
+
prefix = /usr/local
11
11
+
exec_prefix = $(prefix)
12
12
+
bindir = $(exec_prefix)/bin
13
13
+
@@ -49,7 +50,7 @@ install: $(ILIBS) $(IPROGS) $(IHDRS)
14
14
+
mkdir -p $(DESTDIR)$(libdir)
15
15
+
mkdir -p $(DESTDIR)$(includedir)
16
16
+
mkdir -p $(DESTDIR)$(mandir)/man1
17
17
+
- for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done
18
18
+
+ for f in $(IPROGS); do cp $$f$(BINEXT) $(DESTDIR)$(bindir); done
19
19
+
for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done
20
20
+
for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done
21
21
+
for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done
+6
-3
pkgs/development/libraries/lmdb/default.nix
···
1
1
-
{ lib, stdenv, fetchFromGitLab }:
1
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
17
-
patches = [ ./hardcoded-compiler.patch ];
17
17
+
patches = [ ./hardcoded-compiler.patch ./bin-ext.patch ];
18
18
patchFlags = [ "-p3" ];
19
19
20
20
outputs = [ "bin" "out" "dev" ];
21
21
+
22
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
27
-
++ lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so";
29
29
+
++ lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so"
30
30
+
++ lib.optionals stdenv.hostPlatform.isWindows [ "SOEXT=.dll" "BINEXT=.exe" ];
28
31
29
32
doCheck = true;
30
33
checkTarget = "test";