commit 3d620ad53ef4a27d9ff9be81f8174abb6a70403e Author: sagar Date: Fri Jul 11 17:59:19 2025 +0000 softethe v5 (dev) building perfectly fine with nix and cmake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82e0cdf --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/result \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c21ffb6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1751984180, + "narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..6378faa --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + description = "softether-5"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + pname = "softether-5"; + version = "5.02.5187"; + in { + packages.${system}.default = pkgs.callPackage ./package.nix { inherit pname version; }; + }; +} diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..dd14a32 --- /dev/null +++ b/package.nix @@ -0,0 +1,59 @@ +{ + pkgs, + lib, + stdenv, + fetchFromGitHub, + 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; + }; + + 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=" + "-DCMAKE_BUILD_TYPE=Debug" + "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}" + "-DCMAKE_INSTALL_LIBDIR=lib" + "-DCMAKE_INSTALL_INCLUDEDIR=include" + "-DCMAKE_INSTALL_LIBEXECDIR=libexec" + ]; + + meta = { + description = "Open-Source Free Cross-platform Multi-protocol VPN Program"; + homepage = "https://www.softether.org/"; + license = lib.licenses.asl20; + maintainers = [ lib.maintainers.rick68 ]; + platforms = [ + "x86_64-linux" + "aarch64-linux" + ]; + }; +}) \ No newline at end of file