From faf21a9627612082ae91124e5ea316bd82168472 Mon Sep 17 00:00:00 2001 From: liberodark Date: Tue, 18 Feb 2025 16:18:10 +0100 Subject: [PATCH 1/2] openfortivpn: format --- pkgs/by-name/op/openfortivpn/package.nix | 52 +++++++++++++----------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/pkgs/by-name/op/openfortivpn/package.nix b/pkgs/by-name/op/openfortivpn/package.nix index 1b1885965b21..147139d3d01d 100644 --- a/pkgs/by-name/op/openfortivpn/package.nix +++ b/pkgs/by-name/op/openfortivpn/package.nix @@ -1,13 +1,14 @@ -{ stdenv -, lib -, fetchFromGitHub -, autoreconfHook -, pkg-config -, openssl -, ppp -, systemd -, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd -, withPpp ? stdenv.hostPlatform.isLinux +{ + stdenv, + lib, + fetchFromGitHub, + autoreconfHook, + pkg-config, + openssl, + ppp, + systemd, + withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, + withPpp ? stdenv.hostPlatform.isLinux, }: stdenv.mkDerivation rec { @@ -27,21 +28,26 @@ stdenv.mkDerivation rec { --replace '$(DESTDIR)$(confdir)' /tmp ''; - nativeBuildInputs = [ autoreconfHook pkg-config ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; - buildInputs = [ - openssl - ] - ++ lib.optional withSystemd systemd - ++ lib.optional withPpp ppp; + buildInputs = + [ + openssl + ] + ++ lib.optional withSystemd systemd + ++ lib.optional withPpp ppp; - configureFlags = [ - "--sysconfdir=/etc" - ] - ++ lib.optional withSystemd "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - ++ lib.optional withPpp "--with-pppd=${ppp}/bin/pppd" - # configure: error: cannot check for file existence when cross compiling - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-proc"; + configureFlags = + [ + "--sysconfdir=/etc" + ] + ++ lib.optional withSystemd "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" + ++ lib.optional withPpp "--with-pppd=${ppp}/bin/pppd" + # configure: error: cannot check for file existence when cross compiling + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-proc"; enableParallelBuilding = true; From cfca2520cd19ece9da40f5180d4d334bf06bec89 Mon Sep 17 00:00:00 2001 From: liberodark Date: Tue, 18 Feb 2025 16:21:46 +0100 Subject: [PATCH 2/2] openfortivpn: 1.22.1 -> 1.23.1 --- pkgs/by-name/op/openfortivpn/package.nix | 26 +++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/op/openfortivpn/package.nix b/pkgs/by-name/op/openfortivpn/package.nix index 147139d3d01d..6651f17ed167 100644 --- a/pkgs/by-name/op/openfortivpn/package.nix +++ b/pkgs/by-name/op/openfortivpn/package.nix @@ -9,17 +9,19 @@ systemd, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, withPpp ? stdenv.hostPlatform.isLinux, + versionCheckHook, + nix-update-script, }: stdenv.mkDerivation rec { pname = "openfortivpn"; - version = "1.22.1"; + version = "1.23.1"; src = fetchFromGitHub { owner = "adrienverge"; repo = pname; - rev = "v${version}"; - hash = "sha256-FhS4q8p1Q2Lu7xj2ZkUbJcMWvRSn+lqFdYqBNYB3V1E="; + tag = "v${version}"; + hash = "sha256-Pv9v7e5xPTIrgqldBDtTFxW+aIjbxSeu0sQ9n6HjO9w="; }; # we cannot write the config file to /etc and as we don't need the file, so drop it @@ -51,12 +53,22 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - meta = with lib; { + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { description = "Client for PPP+SSL VPN tunnel services"; homepage = "https://github.com/adrienverge/openfortivpn"; - license = licenses.gpl3; - maintainers = with maintainers; [ madjar ]; - platforms = with platforms; linux ++ darwin; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ madjar ]; + platforms = with lib.platforms; linux ++ darwin; mainProgram = "openfortivpn"; }; }