|
@@ -1,7 +1,22 @@
|
|
|
-with import <nixpkgs> {};
|
|
|
|
|
let
|
|
let
|
|
|
- badvpnLocal = pkgs.badvpn.overrideDerivation (attrs: { src = stdenv.lib.cleanSource ./. ; });
|
|
|
|
|
-in rec {
|
|
|
|
|
- badvpn = badvpnLocal;
|
|
|
|
|
- badvpnWithDebug = badvpnLocal.override { debug = true; };
|
|
|
|
|
|
|
+ badvpnLocal = (
|
|
|
|
|
+ { stdenv, cmake, pkgconfig, openssl, nspr, nss, debug ? false }:
|
|
|
|
|
+ let
|
|
|
|
|
+ compileFlags = "-O3 ${stdenv.lib.optionalString (!debug) "-DNDEBUG"}";
|
|
|
|
|
+ in
|
|
|
|
|
+ stdenv.mkDerivation {
|
|
|
|
|
+ name = "badvpn";
|
|
|
|
|
+ nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
|
+ buildInputs = [ openssl nspr nss ];
|
|
|
|
|
+ src = stdenv.lib.cleanSource ./.;
|
|
|
|
|
+ preConfigure = ''
|
|
|
|
|
+ cmakeFlagsArray=( "-DCMAKE_BUILD_TYPE=" "-DCMAKE_C_FLAGS=${compileFlags}" );
|
|
|
|
|
+ '';
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+in
|
|
|
|
|
+with import <nixpkgs> {};
|
|
|
|
|
+rec {
|
|
|
|
|
+ badvpn = pkgs.callPackage badvpnLocal {};
|
|
|
|
|
+ badvpnDebug = pkgs.callPackage badvpnLocal { debug = true; };
|
|
|
}
|
|
}
|