Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 openssl, 6 readline, 7 ncurses, 8 zlib, 9 bash, 10 dataDir ? "/var/lib/softether", 11}: 12 13stdenv.mkDerivation (finalAttrs: { 14 pname = "softether"; 15 version = "4.44-9807-rtm"; 16 17 src = fetchFromGitHub { 18 owner = "SoftEtherVPN"; 19 repo = "SoftEtherVPN_Stable"; 20 tag = "v${finalAttrs.version}"; 21 hash = "sha256-roi5M/YmSBH44pRPSVZcADIHDbSpAfASiPbTdijisUM="; 22 }; 23 24 buildInputs = [ 25 openssl 26 readline 27 ncurses 28 zlib 29 bash 30 ]; 31 32 preConfigure = '' 33 ./configure 34 ''; 35 36 buildPhase = '' 37 mkdir -p $out/bin 38 sed -i \ 39 -e "/INSTALL_BINDIR=/s|/usr/bin|/bin|g" \ 40 -e "/_DIR=/s|/usr|${dataDir}|g" \ 41 -e "s|\$(INSTALL|$out/\$(INSTALL|g" \ 42 -e "/echo/s|echo $out/|echo |g" \ 43 Makefile 44 ''; 45 46 postInstall = '' 47 substituteInPlace $out/bin/vpnbridge --replace-fail /var/lib/softether/vpnbridge/vpnbridge $out/var/lib/softether/vpnbridge/vpnbridge 48 substituteInPlace $out/bin/vpnclient --replace-fail /var/lib/softether/vpnclient/vpnclient $out/var/lib/softether/vpnclient/vpnclient 49 substituteInPlace $out/bin/vpncmd --replace-fail /var/lib/softether/vpncmd/vpncmd $out/var/lib/softether/vpncmd/vpncmd 50 substituteInPlace $out/bin/vpnserver --replace-fail /var/lib/softether/vpnserver/vpnserver $out/var/lib/softether/vpnserver/vpnserver 51 ''; 52 53 env.NIX_CFLAGS_COMPILE = toString [ 54 "-Wno-incompatible-pointer-types" 55 "-Wno-implicit-function-declaration" 56 ]; 57 58 meta = { 59 description = "Open-Source Free Cross-platform Multi-protocol VPN Program"; 60 homepage = "https://www.softether.org/"; 61 license = lib.licenses.asl20; 62 maintainers = [ lib.maintainers.rick68 ]; 63 platforms = [ 64 "x86_64-linux" 65 "aarch64-linux" 66 ]; 67 }; 68})