summary refs log tree commit diff
path: root/pkgs/tools/networking/sstp/default.nix
blob: eb769e59bd78d3e28d576bbe261beea8e1da291f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, stdenv, fetchurl, pkg-config, ppp, libevent, openssl }:

stdenv.mkDerivation rec {
  pname = "sstp-client";
  version = "1.0.17";

  src = fetchurl {
    url = "mirror://sourceforge/sstp-client/sstp-client/sstp-client-${version}.tar.gz";
    sha256 = "sha256-Kd07nHERrWmDzWY9Wi8Gnh+KlakTqryOFmlwFGZXkl0=";
  };

  postPatch = ''
    sed 's,/usr/sbin/pppd,${ppp}/sbin/pppd,' -i src/sstp-pppd.c
    sed "s,sstp-pppd-plugin.so,$out/lib/pppd/sstp-pppd-plugin.so," -i src/sstp-pppd.c
  '';

  configureFlags = [
    "--with-openssl=${openssl.dev}"
    "--with-runtime-dir=/run/sstpc"
    "--with-pppd-plugin-dir=$(out)/lib/pppd"
  ];

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [ libevent openssl ppp ];

  meta = with lib; {
    description = "SSTP client for Linux";
    homepage = "https://sstp-client.sourceforge.net/";
    platforms = platforms.linux;
    maintainers = with maintainers; [ ];
    license = licenses.gpl2Plus;
  };
}