badvpn: Add debug flag to enable assertions.

This commit is contained in:
ambrop7@gmail.com 2014-11-01 15:15:21 +01:00
parent faaa8a6acf
commit 4664321cd3

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 = {