BadVPN – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | { stdenv, cmake, pkgconfig, openssl, nspr, nss, zlib, sqlite, zip, debug ? false }: |
2 | |||
3 | rec { |
||
4 | badvpn = ( |
||
5 | let |
||
6 | compileFlags = "-O3 ${stdenv.lib.optionalString (!debug) "-DNDEBUG"}"; |
||
7 | in |
||
8 | stdenv.mkDerivation { |
||
9 | name = "badvpn"; |
||
10 | |||
11 | src = stdenv.lib.cleanSource ./.; |
||
12 | |||
13 | nativeBuildInputs = [ cmake pkgconfig ]; |
||
14 | buildInputs = [ openssl nspr nss ]; |
||
15 | |||
16 | NIX_CFLAGS_COMPILE = "-I${nspr.crossDrv.dev}/include/nspr -I${nss.crossDrv.dev}/include/nss -ggdb"; |
||
17 | NIX_CFLAGS_LINK = ["-ggdb"]; |
||
18 | |||
19 | preConfigure = '' |
||
20 | cmakeFlagsArray=( "-DCMAKE_BUILD_TYPE=" "-DCMAKE_C_FLAGS=${compileFlags}" "-DCMAKE_SYSTEM_NAME=Windows" ); |
||
21 | ''; |
||
22 | |||
23 | postInstall = '' |
||
24 | for lib in eay32; do |
||
25 | cp ${openssl.crossDrv.bin}/bin/lib$lib.dll $out/bin/ |
||
26 | done |
||
27 | for lib in nspr4 plc4 plds4; do |
||
28 | cp ${nspr.crossDrv.out}/lib/lib$lib.dll $out/bin/ |
||
29 | done |
||
30 | for lib in nss3 nssutil3 smime3 ssl3 softokn3 freebl3; do |
||
31 | cp ${nss.crossDrv.out}/lib/$lib.dll $out/bin/ |
||
32 | done |
||
33 | cp ${zlib.crossDrv.out}/bin/zlib1.dll $out/bin/ |
||
34 | cp ${sqlite.crossDrv.out}/bin/libsqlite3-0.dll $out/bin/ |
||
35 | _linkDLLs() { true; } |
||
36 | ''; |
||
37 | |||
38 | dontCrossStrip = true; |
||
39 | }).crossDrv; |
||
40 | |||
41 | badvpnZip = stdenv.mkDerivation { |
||
42 | name = "badvpn.zip"; |
||
43 | unpackPhase = "true"; |
||
44 | nativeBuildInputs = [ zip ]; |
||
45 | installPhase = '' |
||
46 | mkdir badvpn-win32 |
||
47 | ln -s ${badvpn}/bin badvpn-win32/bin |
||
48 | zip -q -r $out badvpn-win32 |
||
49 | ''; |
||
50 | }; |
||
51 | } |