1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-26 23:52:33 +00:00
nixpkgs/pkgs/tools/networking/badvpn/default.nix
2017-10-10 17:23:10 +02:00

40 lines
1.2 KiB
Nix

{stdenv, fetchurl, cmake, openssl, nss, pkgconfig, nspr, bash, debug ? false}:
let
s = # Generated upstream information
rec {
baseName="badvpn";
version="1.999.130";
name="${baseName}-${version}";
hash="02b1fra43l75mljkhrq45vcrrqv0znicjn15g7nbqx3jppzbpm5z";
url="https://github.com/ambrop72/badvpn/archive/1.999.130.tar.gz";
sha256="02b1fra43l75mljkhrq45vcrrqv0znicjn15g7nbqx3jppzbpm5z";
};
buildInputs = [
cmake openssl nss nspr
];
compileFlags = "-O3 ${stdenv.lib.optionalString (!debug) "-DNDEBUG"}";
in
stdenv.mkDerivation {
inherit (s) name version;
nativeBuildInputs = [ pkgconfig ];
inherit buildInputs;
src = fetchurl {
inherit (s) url sha256;
};
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 = {
inherit (s) version;
description = ''A set of network-related (mostly VPN-related) tools'';
license = stdenv.lib.licenses.bsd3 ;
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
};
}