From 517c188a2c872b3196b26ff672b3b5875311678c Mon Sep 17 00:00:00 2001 From: Anthony Roussel Date: Wed, 16 Aug 2023 18:29:54 +0200 Subject: [PATCH] gns3-server,gns3-gui: 2.2.35.1 -> 2.2.42 --- pkgs/applications/networking/gns3/default.nix | 46 ++++++++----------- pkgs/applications/networking/gns3/gui.nix | 32 ++++++------- pkgs/applications/networking/gns3/server.nix | 26 ++++++----- 3 files changed, 47 insertions(+), 57 deletions(-) diff --git a/pkgs/applications/networking/gns3/default.nix b/pkgs/applications/networking/gns3/default.nix index b17986daf588..43aa6e7343a7 100644 --- a/pkgs/applications/networking/gns3/default.nix +++ b/pkgs/applications/networking/gns3/default.nix @@ -3,44 +3,34 @@ }: let - stableVersion = "2.2.35.1"; - previewVersion = stableVersion; - addVersion = args: - let version = if args.stable then stableVersion else previewVersion; - branch = if args.stable then "stable" else "preview"; - in args // { inherit version branch; }; - extraArgs = rec { - mkOverride = attrname: version: sha256: - self: super: { - "${attrname}" = super."${attrname}".overridePythonAttrs (oldAttrs: { - inherit version; - src = oldAttrs.src.override { - inherit version sha256; - }; - }); - }; + mkGui = args: callPackage (import ./gui.nix (args)) { + inherit (libsForQt5) wrapQtAppsHook; }; - mkGui = args: libsForQt5.callPackage (import ./gui.nix (addVersion args // extraArgs)) { }; - mkServer = args: callPackage (import ./server.nix (addVersion args // extraArgs)) { }; - guiSrcHash = "sha256-iVvADwIp01HeZoDayvH1dilYRHRkRBTBR3Fh395JBq0="; - serverSrcHash = "sha256-41dbiSjvmsDNYr9/rRkeQVOnPSVND34xx1SNknCgHfc="; + mkServer = args: callPackage (import ./server.nix (args)) { }; in { + guiStable = mkGui { - stable = true; - sha256Hash = guiSrcHash; + channel = "stable"; + version = "2.2.42"; + hash = "sha256-FW8Nuha+NrYVhR/66AiBpcCLHRhiLTW8KdHFyWSao84="; }; + guiPreview = mkGui { - stable = false; - sha256Hash = guiSrcHash; + channel = "stable"; + version = "2.2.42"; + hash = "sha256-FW8Nuha+NrYVhR/66AiBpcCLHRhiLTW8KdHFyWSao84="; }; serverStable = mkServer { - stable = true; - sha256Hash = serverSrcHash; + channel = "stable"; + version = "2.2.42"; + hash = "sha256-YM07krEay2W+/6mKLAg+B7VEnAyDlkD+0+cSO1FAJzA="; }; + serverPreview = mkServer { - stable = false; - sha256Hash = serverSrcHash; + channel = "stable"; + version = "2.2.42"; + hash = "sha256-YM07krEay2W+/6mKLAg+B7VEnAyDlkD+0+cSO1FAJzA="; }; } diff --git a/pkgs/applications/networking/gns3/gui.nix b/pkgs/applications/networking/gns3/gui.nix index b809d4091936..13764d506697 100644 --- a/pkgs/applications/networking/gns3/gui.nix +++ b/pkgs/applications/networking/gns3/gui.nix @@ -1,8 +1,6 @@ -{ stable -, branch +{ channel , version -, sha256Hash -, mkOverride +, hash }: { lib @@ -11,18 +9,19 @@ , wrapQtAppsHook }: -python3.pkgs.buildPythonPackage rec { +python3.pkgs.buildPythonApplication rec { pname = "gns3-gui"; inherit version; src = fetchFromGitHub { + inherit hash; owner = "GNS3"; repo = pname; rev = "v${version}"; - sha256 = sha256Hash; }; - nativeBuildInputs = [ + nativeBuildInputs = with python3.pkgs; [ + pythonRelaxDepsHook wrapQtAppsHook ]; @@ -33,25 +32,24 @@ python3.pkgs.buildPythonPackage rec { sentry-sdk setuptools sip_4 (pyqt5.override { withWebSockets = true; }) + truststore + ]; + + pythonRelaxDeps = [ + "jsonschema" + "sentry-sdk" ]; doCheck = false; # Failing dontWrapQtApps = true; - postFixup = '' - wrapQtApp "$out/bin/gns3" - ''; - - postPatch = '' - substituteInPlace requirements.txt \ - --replace "psutil==" "psutil>=" \ - --replace "jsonschema>=4.17.0,<4.18" "jsonschema" \ - --replace "sentry-sdk==1.10.1,<1.11" "sentry-sdk" + preFixup = '' + wrapQtApp "$out/bin/gns3" ''; meta = with lib; { - description = "Graphical Network Simulator 3 GUI (${branch} release)"; + description = "Graphical Network Simulator 3 GUI (${channel} release)"; longDescription = '' Graphical user interface for controlling the GNS3 network simulator. This requires access to a local or remote GNS3 server (it's recommended to diff --git a/pkgs/applications/networking/gns3/server.nix b/pkgs/applications/networking/gns3/server.nix index fef781e1c0c6..200153b15e03 100644 --- a/pkgs/applications/networking/gns3/server.nix +++ b/pkgs/applications/networking/gns3/server.nix @@ -1,13 +1,12 @@ -{ stable -, branch +{ channel , version -, sha256Hash -, mkOverride +, hash }: { lib , python3 , fetchFromGitHub +, pkgsStatic }: python3.pkgs.buildPythonApplication { @@ -15,23 +14,25 @@ python3.pkgs.buildPythonApplication { inherit version; src = fetchFromGitHub { + inherit hash; owner = "GNS3"; repo = "gns3-server"; rev = "refs/tags/v${version}"; - sha256 = sha256Hash; }; - pythonRelaxDeps = [ - "aiofiles" - "jsonschema" - "psutil" - "sentry-sdk" - ]; + # GNS3 2.3.26 requires a static BusyBox for the Docker integration + prePatch = '' + cp ${pkgsStatic.busybox}/bin/busybox gns3server/compute/docker/resources/bin/busybox + ''; nativeBuildInputs = with python3.pkgs; [ pythonRelaxDepsHook ]; + pythonRelaxDeps = [ + "jsonschema" + ]; + propagatedBuildInputs = with python3.pkgs; [ aiofiles aiohttp @@ -47,6 +48,7 @@ python3.pkgs.buildPythonApplication { py-cpuinfo sentry-sdk setuptools + truststore yarl zipstream ]; @@ -59,7 +61,7 @@ python3.pkgs.buildPythonApplication { ''; meta = with lib; { - description = "Graphical Network Simulator 3 server (${branch} release)"; + description = "Graphical Network Simulator 3 server (${channel} release)"; longDescription = '' The GNS3 server manages emulators such as Dynamips, VirtualBox or Qemu/KVM. Clients like the GNS3 GUI control the server using a HTTP REST