Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ambrop72/badvpn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmbroz Bizjak <ambrop7@gmail.com>2015-01-24 17:23:26 +0300
committerAmbroz Bizjak <ambrop7@gmail.com>2015-01-24 17:23:26 +0300
commit17e554271a2714d252bd94fc27226107ae56734c (patch)
tree580c3d7e0e7943b1d9e1e83ed9c102fb3264c9bb
parentf282fbf4d2bcf4747fa4c14cddd83c4d6f4f135f (diff)
Rewrite the Nix expression so it doesn't depend on the one in nixpkgs.
-rw-r--r--build.nix25
1 files changed, 20 insertions, 5 deletions
diff --git a/build.nix b/build.nix
index bcd8fa4..cdc5343 100644
--- a/build.nix
+++ b/build.nix
@@ -1,7 +1,22 @@
-with import <nixpkgs> {};
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; };
}