softether-5/package.nix
2025-07-11 20:03:31 +00:00

60 lines
No EOL
1.2 KiB
Nix

{
pkgs,
lib,
stdenv,
fetchFromGitHub,
debug ? false,
pname ? "softether",
logDir ? "/var/log/${pname}",
pidDir ? "/run/${pname}",
dbDir ? "/var/lib/${pname}",
dataDir ? "/var/lib/${pname}",
version ? "master",
}:
stdenv.mkDerivation (finalAttrs: {
inherit pname version;
src = fetchFromGitHub {
owner = "SoftEtherVPN";
repo = "SoftEtherVPN";
tag = "${finalAttrs.version}";
hash = "sha256-KGcQNsHwEtJ0CR35XcW89UPqnnLlGus/zAGBZDgz5uo=";
fetchSubmodules = true;
};
patches = [ ./ipb-profile-key.patch ];
nativeBuildInputs = with pkgs; [
cmake
pkg-config
libsodium
# Add other build tools here
];
buildInputs = with pkgs; [
openssl
readline
ncurses
zlib
bash
];
cmakeFlags = [
"-DSE_PIDDIR=${pidDir}" "-DSE_LOGDIR=${logDir}" "-DSE_DBDIR=${dbDir}" "-DCMAKE_INSTALL_SYSTEMD_UNITDIR="
(lib.optionalString debug "-DCMAKE_BUILD_TYPE=Debug")
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBEXECDIR=libexec"
];
meta = {
description = "Softether 5";
homepage = "https://www.softether.org/";
platforms = [
"x86_64-linux"
"aarch64-linux"
];
};
})