Merge pull request #4762 from ambrop72/badvpn-debug

badvpn: Add debug flag to enable assertions.
This commit is contained in:
Jaka Hudoklin 2014-11-03 14:07:28 +01:00
commit c2d4fd7360

View File

@ -1,4 +1,4 @@
{stdenv, fetchurl, cmake, openssl, nss, pkgconfig, nspr, bash}:
{stdenv, fetchurl, cmake, openssl, nss, pkgconfig, nspr, bash, debug ? false}:
let
s = # Generated upstream information
rec {
@ -12,6 +12,7 @@ let
buildInputs = [
cmake openssl nss pkgconfig nspr
];
compileFlags = "-O3 ${stdenv.lib.optionalString (!debug) "-DNDEBUG"}";
in
stdenv.mkDerivation {
inherit (s) name version;
@ -23,6 +24,7 @@ stdenv.mkDerivation {
preConfigure = ''
find . -name '*.sh' -exec sed -e 's@#!/bin/sh@${stdenv.shell}@' -i '{}' ';'
find . -name '*.sh' -exec sed -e 's@#!/bin/bash@${bash}/bin/bash@' -i '{}' ';'
cmakeFlagsArray=("-DCMAKE_BUILD_TYPE=" "-DCMAKE_C_FLAGS=${compileFlags}");
'';
meta = {