Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 87 lines 2.0 kB view raw
1{ 2 channel, 3 version, 4 hash, 5}: 6 7{ 8 fetchFromGitHub, 9 gns3-gui, 10 lib, 11 python3Packages, 12 qt5, 13 testers, 14 wrapQtAppsHook, 15}: 16 17python3Packages.buildPythonApplication rec { 18 pname = "gns3-gui"; 19 inherit version; 20 format = "setuptools"; 21 22 src = fetchFromGitHub { 23 inherit hash; 24 owner = "GNS3"; 25 repo = "gns3-gui"; 26 rev = "refs/tags/v${version}"; 27 }; 28 29 nativeBuildInputs = with python3Packages; [ wrapQtAppsHook ]; 30 31 build-system = with python3Packages; [ setuptools ]; 32 33 propagatedBuildInputs = [ qt5.qtwayland ]; 34 35 dependencies = 36 with python3Packages; 37 [ 38 distro 39 jsonschema 40 psutil 41 sentry-sdk 42 setuptools 43 sip 44 (pyqt5.override { withWebSockets = true; }) 45 truststore 46 ] 47 ++ lib.optionals (pythonOlder "3.9") [ 48 importlib-resources 49 ]; 50 51 dontWrapQtApps = true; 52 53 preFixup = '' 54 wrapQtApp "$out/bin/gns3" 55 ''; 56 57 doCheck = true; 58 59 checkInputs = with python3Packages; [ pytestCheckHook ]; 60 61 preCheck = '' 62 export HOME=$(mktemp -d) 63 export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}" 64 export QT_QPA_PLATFORM_PLUGIN_PATH="${qt5.qtbase.bin}/lib/qt-${qt5.qtbase.version}/plugins"; 65 export QT_QPA_PLATFORM=offscreen 66 ''; 67 68 passthru.tests.version = testers.testVersion { 69 package = gns3-gui; 70 command = "${lib.getExe gns3-gui} --version"; 71 }; 72 73 meta = { 74 description = "Graphical Network Simulator 3 GUI (${channel} release)"; 75 longDescription = '' 76 Graphical user interface for controlling the GNS3 network simulator. This 77 requires access to a local or remote GNS3 server (it's recommended to 78 download the official GNS3 VM). 79 ''; 80 homepage = "https://www.gns3.com/"; 81 changelog = "https://github.com/GNS3/gns3-gui/releases/tag/v${version}"; 82 license = lib.licenses.gpl3Plus; 83 platforms = lib.platforms.linux; 84 maintainers = with lib.maintainers; [ anthonyroussel ]; 85 mainProgram = "gns3"; 86 }; 87}