1{ lib, stdenv, fetchFromGitHub, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "tinyfecvpn";
5 version = "20230206.0";
6
7 src = fetchFromGitHub {
8 owner = "wangyu-";
9 repo = pname;
10 rev = version;
11 sha256 = "sha256-g4dduREH64TDK3Y2PKc5RZiISW4h2ALRh8vQK7jvCZU=";
12 fetchSubmodules = true;
13 };
14
15 enableParallelBuilding = true;
16 nativeBuildInputs = [ pkg-config ];
17
18 patchPhase = ''
19 runHook prePatch
20 find . -type f -name "makefile" -exec sed "s/ -static/ -g/g" -i \{\} \;
21 runHook postPatch
22 '';
23
24 installPhase = ''
25 runHook preInstall
26 install -Dm755 tinyvpn $out/bin/tinyvpn
27 runHook postInstall
28 '';
29
30 meta = with lib; {
31 homepage = "https://github.com/wangyu-/tinyfecVPN";
32 description = "A VPN Designed for Lossy Links, with Build-in Forward Error Correction(FEC) Support";
33 license = licenses.mit;
34 platforms = platforms.linux;
35 maintainers = with maintainers; [ ];
36 };
37}