Unverified Commit d3417b69 authored by Anthony's avatar Anthony Committed by GitHub
Browse files

gns3-server,gns3-gui: migrate to pkgs/by-name, use `pyproject = true` (#481421)

parents d636f6c6 01951bed
Loading
Loading
Loading
Loading
+0 −39
Original line number Diff line number Diff line
{
  callPackage,
  libsForQt5,
}:

let
  mkGui =
    args:
    callPackage (import ./gui.nix args) {
      inherit (libsForQt5) wrapQtAppsHook;
    };

  mkServer = args: callPackage (import ./server.nix args) { };
in
{
  guiStable = mkGui {
    channel = "stable";
    version = "2.2.55";
    hash = "sha256-6jblQakNpoSQXfy5pU68Aedg661VcwpqQilvqOV15pQ=";
  };

  guiPreview = mkGui {
    channel = "stable";
    version = "2.2.55";
    hash = "sha256-6jblQakNpoSQXfy5pU68Aedg661VcwpqQilvqOV15pQ=";
  };

  serverStable = mkServer {
    channel = "stable";
    version = "2.2.55";
    hash = "sha256-o04RrHYsa5sWYUBDLJ5xgcK4iJK8CfZ4YdAiZ4eV/o4=";
  };

  serverPreview = mkServer {
    channel = "stable";
    version = "2.2.55";
    hash = "sha256-o04RrHYsa5sWYUBDLJ5xgcK4iJK8CfZ4YdAiZ4eV/o4=";
  };
}
+20 −21
Original line number Diff line number Diff line
{
  channel,
  version,
  hash,
}:

{
  fetchFromGitHub,
  gns3-gui,
@@ -11,7 +5,7 @@
  python3Packages,
  qt5,
  testers,
  wrapQtAppsHook,
  writableTmpDirAsHomeHook,
}:

let
@@ -23,21 +17,26 @@ let
in
pythonPackages.buildPythonApplication rec {
  pname = "gns3-gui";
  inherit version;
  format = "setuptools";
  version = "2.2.55";
  pyproject = true;

  src = fetchFromGitHub {
    inherit hash;
    owner = "GNS3";
    repo = "gns3-gui";
    tag = "v${version}";
    hash = "sha256-6jblQakNpoSQXfy5pU68Aedg661VcwpqQilvqOV15pQ";
  };

  nativeBuildInputs = [ wrapQtAppsHook ];
  pythonRelaxDeps = [
    "jsonschema"
    "sentry-sdk"
  ];

  build-system = with pythonPackages; [ setuptools ];
  nativeBuildInputs = [ qt5.wrapQtAppsHook ];

  propagatedBuildInputs = [ qt5.qtwayland ];
  buildInputs = [ qt5.qtwayland ];

  build-system = with pythonPackages; [ setuptools ];

  dependencies = with pythonPackages; [
    distro
@@ -53,17 +52,17 @@ pythonPackages.buildPythonApplication rec {
  dontWrapQtApps = true;

  preFixup = ''
    wrapQtApp "$out/bin/gns3"
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")
  '';

  doCheck = true;

  checkInputs = with pythonPackages; [ pytestCheckHook ];
  nativeCheckInputs = with pythonPackages; [
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
    export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
    export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins";
    export QT_PLUGIN_PATH="${lib.getBin qt5.qtbase}/${qt5.qtbase.qtPluginPrefix}"
    export QT_QPA_PLATFORM_PLUGIN_PATH="${lib.getBin qt5.qtbase}/lib/qt-${qt5.qtbase.version}/plugins";
    export QT_QPA_PLATFORM=offscreen
  '';

@@ -73,7 +72,7 @@ pythonPackages.buildPythonApplication rec {
  };

  meta = {
    description = "Graphical Network Simulator 3 GUI (${channel} release)";
    description = "Graphical Network Simulator 3 GUI";
    longDescription = ''
      Graphical user interface for controlling the GNS3 network simulator. This
      requires access to a local or remote GNS3 server (it's recommended to
+17 −20
Original line number Diff line number Diff line
{
  channel,
  version,
  hash,
}:

{
  fetchFromGitHub,
  gns3-server,
@@ -14,18 +8,19 @@
  stdenv,
  testers,
  util-linux,
  writableTmpDirAsHomeHook,
}:

python3Packages.buildPythonApplication {
python3Packages.buildPythonApplication rec {
  pname = "gns3-server";
  inherit version;
  format = "setuptools";
  version = "2.2.55";
  pyproject = true;

  src = fetchFromGitHub {
    inherit hash;
    owner = "GNS3";
    repo = "gns3-server";
    tag = "v${version}";
    hash = "sha256-o04RrHYsa5sWYUBDLJ5xgcK4iJK8CfZ4YdAiZ4eV/o4=";
  };

  # GNS3 2.3.26 requires a static BusyBox for the Docker integration
@@ -33,6 +28,14 @@ python3Packages.buildPythonApplication {
    cp ${pkgsStatic.busybox}/bin/busybox gns3server/compute/docker/resources/bin/busybox
  '';

  pythonRelaxDeps = [
    "aiohttp"
    "aiohttp-cors"
    "jsonschema"
    "platformdirs"
    "sentry-sdk"
  ];

  build-system = with python3Packages; [ setuptools ];

  dependencies = with python3Packages; [
@@ -40,6 +43,7 @@ python3Packages.buildPythonApplication {
    aiohttp
    aiohttp-cors
    async-generator
    async-timeout
    distro
    jinja2
    jsonschema
@@ -60,18 +64,11 @@ python3Packages.buildPythonApplication {
  # util-linux (script program) is required for Docker support
  makeWrapperArgs = [ "--suffix PATH : ${lib.makeBinPath [ util-linux ]}" ];

  doCheck = true;

  # Otherwise tests will fail to create directory
  # Permission denied: '/homeless-shelter'
  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  checkInputs = with python3Packages; [
  nativeCheckInputs = with python3Packages; [
    pytest-aiohttp
    pytest-rerunfailures
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  pytestFlags = [
@@ -94,7 +91,7 @@ python3Packages.buildPythonApplication {
  };

  meta = {
    description = "Graphical Network Simulator 3 server (${channel} release)";
    description = "Graphical Network Simulator 3 server";
    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
+1 −0
Original line number Diff line number Diff line
@@ -778,6 +778,7 @@ mapAliases {
  gnome-passwordsafe = throw "'gnome-passwordsafe' has been renamed to/replaced by 'gnome-secrets'"; # Converted to throw 2025-10-27
  gnome-recipes = throw "'gnome-recipes' has been removed due to lack of upstream maintenance and dependency on insecure libraries"; # Added 2025-09-06
  gnome-resources = throw "'gnome-resources' has been renamed to/replaced by 'resources'"; # Converted to throw 2025-10-27
  gns3Packages = throw "'gns3Packages' has been removed. Use 'gns3-gui' and 'gns3-server' instead."; # Added 2026-01-18
  gnu-cobol = throw "'gnu-cobol' has been renamed to/replaced by 'gnucobol'"; # Converted to throw 2025-10-27
  gnubik = throw "'gnubik' has been removed due to lack of maintenance upstream and its dependency on GTK 2"; # Added 2025-09-16
  go-thumbnailer = throw "'go-thumbnailer' has been renamed to/replaced by 'thud'"; # Converted to throw 2025-10-27
+0 −3
Original line number Diff line number Diff line
@@ -6916,9 +6916,6 @@ with pkgs;

  #GMP ex-satellite, so better keep it near gmp
  # A GMP fork
  gns3Packages = recurseIntoAttrs (callPackage ../applications/networking/gns3 { });
  gns3-gui = gns3Packages.guiStable;
  gns3-server = gns3Packages.serverStable;

  gobject-introspection = callPackage ../development/libraries/gobject-introspection/wrapper.nix { };