1
- { stdenv , python3Packages , fetchFromGitHub } :
1
+ { stable , branch , version , sha256Hash } :
2
2
3
- python3Packages . buildPythonPackage rec {
3
+ { stdenv , python3Packages , fetchFromGitHub , fetchurl } :
4
+
5
+ let
6
+ pythonPackages = python3Packages ;
7
+ yarl = if ( ! stable ) then pythonPackages . yarl
8
+ else ( stdenv . lib . overrideDerivation pythonPackages . yarl ( oldAttrs :
9
+ rec {
10
+ pname = "yarl" ;
11
+ version = "0.9.8" ;
12
+ name = "${ pname } -${ version } " ;
13
+ src = pythonPackages . fetchPypi {
14
+ inherit pname version ;
15
+ sha256 = "1v2dsmr7bqp0yx51pwhbxyvzza8m2f88prsnbd926mi6ah38p0d7" ;
16
+ } ;
17
+ } ) ) ;
18
+ aiohttp = if ( ! stable ) then pythonPackages . aiohttp
19
+ else ( stdenv . lib . overrideDerivation pythonPackages . aiohttp ( oldAttrs :
20
+ rec {
21
+ pname = "aiohttp" ;
22
+ version = "1.3.5" ;
23
+ name = "${ pname } -${ version } " ;
24
+ src = pythonPackages . fetchPypi {
25
+ inherit pname version ;
26
+ sha256 = "0hpqdiaifgyfqmxkyzwypwvrnvz5rqzgzylzhihfidc5ldfs856d" ;
27
+ } ;
28
+ propagatedBuildInputs = [ yarl ]
29
+ ++ ( with pythonPackages ; [ async-timeout chardet multidict ] ) ;
30
+ } ) ) ;
31
+ aiohttp-cors = if ( ! stable ) then pythonPackages . aiohttp-cors
32
+ else ( stdenv . lib . overrideDerivation pythonPackages . aiohttp-cors ( oldAttrs :
33
+ rec {
34
+ pname = "aiohttp-cors" ;
35
+ version = "0.5.1" ;
36
+ name = "${ pname } -${ version } " ;
37
+ src = pythonPackages . fetchPypi {
38
+ inherit pname version ;
39
+ sha256 = "0szma27ri25fq4nwwvs36myddggw3jz4pyzmq63yz4xpw0jjdxck" ;
40
+ } ;
41
+ propagatedBuildInputs = [ aiohttp ] ;
42
+ } ) ) ;
43
+ in pythonPackages . buildPythonPackage rec {
4
44
name = "${ pname } -${ version } " ;
5
45
pname = "gns3-server" ;
6
- version = "2.1.0rc1" ;
7
46
8
47
src = fetchFromGitHub {
9
48
owner = "GNS3" ;
10
49
repo = pname ;
11
50
rev = "v${ version } " ;
12
- sha256 = "181689fpjxq4hy2lyxk4zciqhgnhj5srvb4xsxdlbf68n89fj2zf" ;
51
+ sha256 = sha256Hash ;
13
52
} ;
14
53
15
- propagatedBuildInputs = with python3Packages ; [
16
- aiohttp jinja2 psutil zipstream aiohttp-cors raven jsonschema yarl typing
17
- prompt_toolkit
18
- ] ;
54
+ propagatedBuildInputs = [ yarl aiohttp aiohttp-cors ]
55
+ ++ ( with pythonPackages ; [
56
+ jinja2 psutil zipstream raven jsonschema typing
57
+ prompt_toolkit
58
+ ] ) ;
19
59
20
- postPatch = ''
60
+ postPatch = stdenv . lib . optionalString ( ! stable ) ''
21
61
sed -i 's/yarl>=0.11,<0.12/yarl/g' requirements.txt
22
62
'' ;
23
63
@@ -28,13 +68,13 @@ python3Packages.buildPythonPackage rec {
28
68
rm $out/bin/gns3loopback # For windows only
29
69
'' ;
30
70
meta = with stdenv . lib ; {
31
- description = "Graphical Network Simulator 3 server" ;
71
+ description = "Graphical Network Simulator 3 server ( ${ branch } release) " ;
32
72
longDescription = ''
33
73
The GNS3 server manages emulators such as Dynamips, VirtualBox or
34
74
Qemu/KVM. Clients like the GNS3 GUI control the server using a HTTP REST
35
75
API.
36
76
'' ;
37
- homepage = " https://www.gns3.com/" ;
77
+ homepage = https://www.gns3.com/ ;
38
78
license = licenses . gpl3Plus ;
39
79
platforms = platforms . linux ;
40
80
maintainers = with maintainers ; [ primeos ] ;
0 commit comments