Skip to content

Commit

Permalink
Merge pull request #220547 from anthonyroussel/gns_2_2_38
Browse files Browse the repository at this point in the history
gns3-server,gns3-gui: 2.2.35.1 -> 2.2.42
  • Loading branch information
delroth authored Aug 16, 2023
2 parents 9049df5 + 517c188 commit 214c9de
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 57 deletions.
46 changes: 18 additions & 28 deletions pkgs/applications/networking/gns3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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=";
};
}
32 changes: 15 additions & 17 deletions pkgs/applications/networking/gns3/gui.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{ stable
, branch
{ channel
, version
, sha256Hash
, mkOverride
, hash
}:

{ lib
Expand All @@ -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
];

Expand All @@ -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
Expand Down
26 changes: 14 additions & 12 deletions pkgs/applications/networking/gns3/server.nix
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
{ stable
, branch
{ channel
, version
, sha256Hash
, mkOverride
, hash
}:

{ lib
, python3
, fetchFromGitHub
, pkgsStatic
}:

python3.pkgs.buildPythonApplication {
pname = "gns3-server";
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
Expand All @@ -47,6 +48,7 @@ python3.pkgs.buildPythonApplication {
py-cpuinfo
sentry-sdk
setuptools
truststore
yarl
zipstream
];
Expand All @@ -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
Expand Down
46 changes: 46 additions & 0 deletions pkgs/development/python-modules/truststore/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, flit-core
, aiohttp
, httpx
, pyopenssl
, requests
, trustme
}:

buildPythonPackage rec {
pname = "truststore";
version = "0.7.0";
format = "pyproject";

src = fetchFromGitHub {
owner = "sethmlarson";
repo = pname;
rev = "refs/tags/v${version}";
sha256 = "sha256-Q3HSHcqoG2DEXujL05lj3GLNu4jJ61i7VFxMou8c0cE=";
};

nativeBuildInputs = [
flit-core
];

propagatedBuildInputs = [
aiohttp
httpx
pyopenssl
requests
trustme
];

# tests requires networking
doCheck = false;

meta = with lib; {
homepage = "https://github.com/sethmlarson/truststore";
description = "Verify certificates using native system trust stores";
changelog = "https://github.com/sethmlarson/truststore/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ anthonyroussel ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12908,6 +12908,8 @@ self: super: with self; {

trustme = callPackage ../development/python-modules/trustme { };

truststore = callPackage ../development/python-modules/truststore { };

trytond = callPackage ../development/python-modules/trytond { };

tskit = callPackage ../development/python-modules/tskit { };
Expand Down

0 comments on commit 214c9de

Please sign in to comment.