mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-19 02:44:17 +03:00
badvpn: refactor
This commit is contained in:
parent
d2a93c1fc1
commit
a90c60933d
@ -1,39 +1,29 @@
|
||||
{lib, stdenv, fetchurl, cmake, openssl, nss, pkg-config, 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";
|
||||
{ lib, stdenv, fetchurl, cmake, openssl, nss, pkg-config, nspr, bash, debug ? false }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "badvpn";
|
||||
version = "1.999.130";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ambrop72/badvpn/archive/${version}.tar.gz";
|
||||
sha256 = "sha256-v9S7/r1ydLzseSVYyaL9YOOc2S4EZzglreXQQVR2YQk=";
|
||||
};
|
||||
|
||||
|
||||
compileFlags = "-O3 ${lib.optionalString (!debug) "-DNDEBUG"}";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit (s) name version;
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
buildInputs = [
|
||||
openssl nss nspr
|
||||
openssl
|
||||
nss
|
||||
nspr
|
||||
];
|
||||
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}");
|
||||
cmakeFlagsArray=("-DCMAKE_BUILD_TYPE=" "-DCMAKE_C_FLAGS=-O3 ${lib.optionalString (!debug) "-DNDEBUG"}");
|
||||
'';
|
||||
|
||||
meta = {
|
||||
inherit (s) version;
|
||||
meta = with lib; {
|
||||
description = "A set of network-related (mostly VPN-related) tools";
|
||||
license = lib.licenses.bsd3 ;
|
||||
maintainers = [lib.maintainers.raskin];
|
||||
platforms = lib.platforms.linux;
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ raskin ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
url https://github.com/ambrop72/badvpn/releases
|
||||
version_link '[0-9][.]tar[.][a-z0-9]+$'
|
||||
version '.*/([0-9.]+)[.]tar[.].*' '\1'
|
Loading…
Reference in New Issue
Block a user