2023-08-22 20:05:09 +00:00
|
|
|
{ channel
|
2022-04-27 09:35:20 +00:00
|
|
|
, version
|
2023-08-22 20:05:09 +00:00
|
|
|
, hash
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
2023-08-22 20:05:09 +00:00
|
|
|
, pkgsStatic
|
2023-10-09 19:29:22 +00:00
|
|
|
, stdenv
|
2024-01-02 11:29:13 +00:00
|
|
|
, nixosTests
|
2023-11-16 04:20:00 +00:00
|
|
|
, testers
|
|
|
|
, gns3-server
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
python3.pkgs.buildPythonApplication {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gns3-server";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-08-22 20:05:09 +00:00
|
|
|
inherit hash;
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "GNS3";
|
|
|
|
repo = "gns3-server";
|
2023-03-30 22:05:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
# GNS3 2.3.26 requires a static BusyBox for the Docker integration
|
|
|
|
prePatch = ''
|
|
|
|
cp ${pkgsStatic.busybox}/bin/busybox gns3server/compute/docker/resources/bin/busybox
|
|
|
|
'';
|
2023-03-30 22:05:00 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2022-04-27 09:35:20 +00:00
|
|
|
aiofiles
|
|
|
|
aiohttp
|
|
|
|
aiohttp-cors
|
2023-08-10 07:59:29 +00:00
|
|
|
async-generator
|
2022-04-27 09:35:20 +00:00
|
|
|
distro
|
|
|
|
jinja2
|
|
|
|
jsonschema
|
|
|
|
multidict
|
2023-10-09 19:29:22 +00:00
|
|
|
platformdirs
|
2022-04-27 09:35:20 +00:00
|
|
|
prompt-toolkit
|
|
|
|
psutil
|
|
|
|
py-cpuinfo
|
|
|
|
sentry-sdk
|
|
|
|
setuptools
|
2023-08-22 20:05:09 +00:00
|
|
|
truststore
|
2022-04-27 09:35:20 +00:00
|
|
|
yarl
|
|
|
|
zipstream
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.9") [
|
|
|
|
importlib-resources
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postInstall = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
|
|
|
|
rm $out/bin/gns3loopback
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# Otherwise tests will fail to create directory
|
|
|
|
# Permission denied: '/homeless-shelter'
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
checkInputs = with python3.pkgs; [
|
|
|
|
pytest-aiohttp
|
|
|
|
pytest-rerunfailures
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
# fails on ofborg because of lack of cpu vendor information
|
|
|
|
"--deselect=tests/controller/gns3vm/test_virtualbox_gns3_vm.py::test_cpu_vendor_id"
|
|
|
|
# Rerun failed tests up to three times (flaky tests)
|
|
|
|
"--reruns 3"
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) gns3-server;
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = gns3-server;
|
|
|
|
command = "${lib.getExe gns3-server} --version";
|
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-08-22 20:05:09 +00:00
|
|
|
description = "Graphical Network Simulator 3 server (${channel} release)";
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
API.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.gns3.com/";
|
|
|
|
changelog = "https://github.com/GNS3/gns3-server/releases/tag/v${version}";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ anthonyroussel ];
|
2023-11-16 04:20:00 +00:00
|
|
|
mainProgram = "gns3server";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|