openvswitch: generalize builder

+127 -227
+2 -111
pkgs/os-specific/linux/openvswitch/default.nix
··· 1 - { lib 2 - , stdenv 3 - , fetchurl 4 - , installShellFiles 5 - , iproute2 6 - , kernel ? null 7 - , libcap_ng 8 - , openssl 9 - , perl 10 - , pkg-config 11 - , procps 12 - , python3 13 - , sphinxHook 14 - , util-linux 15 - , which 16 - }: 17 - 18 - let 19 - _kernel = kernel; 20 - in stdenv.mkDerivation rec { 21 version = "3.0.1"; 22 - pname = "openvswitch"; 23 - 24 - kernel = lib.optional (_kernel != null) _kernel.dev; 25 - 26 - src = fetchurl { 27 - url = "https://www.openvswitch.org/releases/${pname}-${version}.tar.gz"; 28 - hash = "sha256-5KEXFtCRn1syOSKLMrrcEJtWGl/maLlUfhQ7CxlbvWg="; 29 - }; 30 - 31 - outputs = [ 32 - "out" 33 - "man" 34 - ]; 35 - 36 - patches = [ 37 - # 8: vsctl-bashcomp - argument completion FAILED (completion.at:664) 38 - ./patches/disable-bash-arg-completion-test.patch 39 - ]; 40 - 41 - nativeBuildInputs = [ 42 - installShellFiles 43 - pkg-config 44 - sphinxHook 45 - ]; 46 - 47 - sphinxBuilders = [ 48 - "man" 49 - ]; 50 - 51 - sphinxRoot = "./Documentation"; 52 - 53 - buildInputs = [ 54 - libcap_ng 55 - openssl 56 - perl 57 - procps 58 - python3 59 - util-linux 60 - which 61 - ]; 62 - 63 - preConfigure = "./boot.sh"; 64 - 65 - configureFlags = [ 66 - "--localstatedir=/var" 67 - "--sharedstatedir=/var" 68 - "--sbindir=$(out)/bin" 69 - ] ++ (lib.optionals (_kernel != null) ["--with-linux"]); 70 - 71 - # Leave /var out of this! 72 - installFlags = [ 73 - "LOGDIR=$(TMPDIR)/dummy" 74 - "RUNDIR=$(TMPDIR)/dummy" 75 - "PKIDIR=$(TMPDIR)/dummy" 76 - ]; 77 - 78 - enableParallelBuilding = true; 79 - 80 - postInstall = '' 81 - installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash 82 - installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash 83 - ''; 84 - 85 - doCheck = true; 86 - 87 - checkInputs = [ 88 - iproute2 89 - ] ++ (with python3.pkgs; [ 90 - netaddr 91 - pyparsing 92 - pytest 93 - ]); 94 - 95 - meta = with lib; { 96 - changelog = "https://www.openvswitch.org/releases/NEWS-${version}.txt"; 97 - description = "A multilayer virtual switch"; 98 - longDescription = '' 99 - Open vSwitch is a production quality, multilayer virtual switch 100 - licensed under the open source Apache 2.0 license. It is 101 - designed to enable massive network automation through 102 - programmatic extension, while still supporting standard 103 - management interfaces and protocols (e.g. NetFlow, sFlow, SPAN, 104 - RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to 105 - support distribution across multiple physical servers similar 106 - to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. 107 - ''; 108 - homepage = "https://www.openvswitch.org/"; 109 - license = licenses.asl20; 110 - maintainers = with maintainers; [ netixx kmcopper ]; 111 - platforms = platforms.linux; 112 - }; 113 }
··· 1 + import ./generic.nix { 2 version = "3.0.1"; 3 + hash = "sha256-5KEXFtCRn1syOSKLMrrcEJtWGl/maLlUfhQ7CxlbvWg="; 4 }
+123
pkgs/os-specific/linux/openvswitch/generic.nix
···
··· 1 + { version 2 + , hash 3 + }: 4 + 5 + { lib 6 + , stdenv 7 + , fetchurl 8 + , autoconf 9 + , automake 10 + , installShellFiles 11 + , iproute2 12 + , kernel ? null 13 + , libcap_ng 14 + , libtool 15 + , openssl 16 + , perl 17 + , pkg-config 18 + , procps 19 + , python3 20 + , sphinxHook 21 + , util-linux 22 + , which 23 + }: 24 + 25 + let 26 + _kernel = kernel; 27 + in stdenv.mkDerivation rec { 28 + pname = "openvswitch"; 29 + inherit version; 30 + 31 + kernel = lib.optional (_kernel != null) _kernel.dev; 32 + 33 + src = fetchurl { 34 + url = "https://www.openvswitch.org/releases/${pname}-${version}.tar.gz"; 35 + inherit hash; 36 + }; 37 + 38 + outputs = [ 39 + "out" 40 + "man" 41 + ]; 42 + 43 + patches = [ 44 + # 8: vsctl-bashcomp - argument completion FAILED (completion.at:664) 45 + ./patches/disable-bash-arg-completion-test.patch 46 + ]; 47 + 48 + nativeBuildInputs = [ 49 + autoconf 50 + automake 51 + installShellFiles 52 + libtool 53 + pkg-config 54 + sphinxHook 55 + ]; 56 + 57 + sphinxBuilders = [ 58 + "man" 59 + ]; 60 + 61 + sphinxRoot = "./Documentation"; 62 + 63 + buildInputs = [ 64 + libcap_ng 65 + openssl 66 + perl 67 + procps 68 + python3 69 + util-linux 70 + which 71 + ]; 72 + 73 + preConfigure = "./boot.sh"; 74 + 75 + configureFlags = [ 76 + "--localstatedir=/var" 77 + "--sharedstatedir=/var" 78 + "--sbindir=$(out)/bin" 79 + ] ++ (lib.optionals (_kernel != null) ["--with-linux"]); 80 + 81 + # Leave /var out of this! 82 + installFlags = [ 83 + "LOGDIR=$(TMPDIR)/dummy" 84 + "RUNDIR=$(TMPDIR)/dummy" 85 + "PKIDIR=$(TMPDIR)/dummy" 86 + ]; 87 + 88 + enableParallelBuilding = true; 89 + 90 + postInstall = '' 91 + installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash 92 + installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash 93 + ''; 94 + 95 + doCheck = true; 96 + 97 + checkInputs = [ 98 + iproute2 99 + ] ++ (with python3.pkgs; [ 100 + netaddr 101 + pyparsing 102 + pytest 103 + ]); 104 + 105 + meta = with lib; { 106 + changelog = "https://www.openvswitch.org/releases/NEWS-${version}.txt"; 107 + description = "A multilayer virtual switch"; 108 + longDescription = '' 109 + Open vSwitch is a production quality, multilayer virtual switch 110 + licensed under the open source Apache 2.0 license. It is 111 + designed to enable massive network automation through 112 + programmatic extension, while still supporting standard 113 + management interfaces and protocols (e.g. NetFlow, sFlow, SPAN, 114 + RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to 115 + support distribution across multiple physical servers similar 116 + to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. 117 + ''; 118 + homepage = "https://www.openvswitch.org/"; 119 + license = licenses.asl20; 120 + maintainers = with maintainers; [ netixx kmcopper ]; 121 + platforms = platforms.linux; 122 + }; 123 + }
+2 -116
pkgs/os-specific/linux/openvswitch/lts.nix
··· 1 - { lib 2 - , stdenv 3 - , fetchurl 4 - , autoconf 5 - , automake 6 - , installShellFiles 7 - , iproute2 8 - , kernel ? null 9 - , libcap_ng 10 - , libtool 11 - , openssl 12 - , perl 13 - , pkg-config 14 - , procps 15 - , python3 16 - , sphinxHook 17 - , util-linux 18 - , which 19 - }: 20 - 21 - let 22 - _kernel = kernel; 23 - in stdenv.mkDerivation rec { 24 version = "2.17.3"; 25 - pname = "openvswitch"; 26 - 27 - kernel = lib.optional (_kernel != null) _kernel.dev; 28 - 29 - src = fetchurl { 30 - url = "https://www.openvswitch.org/releases/${pname}-${version}.tar.gz"; 31 - hash = "sha256-RGgR/JGuJFzDGQSmk3H7C/BEb3sk6yOaA320ADUwEcA="; 32 - }; 33 - 34 - outputs = [ 35 - "out" 36 - "man" 37 - ]; 38 - 39 - patches = [ 40 - # 8: vsctl-bashcomp - argument completion FAILED (completion.at:664) 41 - ./patches/disable-bash-arg-completion-test.patch 42 - ]; 43 - 44 - nativeBuildInputs = [ 45 - autoconf 46 - automake 47 - installShellFiles 48 - libtool 49 - pkg-config 50 - sphinxHook 51 - ]; 52 - 53 - sphinxBuilders = [ 54 - "man" 55 - ]; 56 - 57 - sphinxRoot = "./Documentation"; 58 - 59 - buildInputs = [ 60 - libcap_ng 61 - openssl 62 - perl 63 - procps 64 - python3 65 - util-linux 66 - which 67 - ]; 68 - 69 - preConfigure = "./boot.sh"; 70 - 71 - configureFlags = [ 72 - "--localstatedir=/var" 73 - "--sharedstatedir=/var" 74 - "--sbindir=$(out)/bin" 75 - ] ++ (lib.optionals (_kernel != null) ["--with-linux"]); 76 - 77 - # Leave /var out of this! 78 - installFlags = [ 79 - "LOGDIR=$(TMPDIR)/dummy" 80 - "RUNDIR=$(TMPDIR)/dummy" 81 - "PKIDIR=$(TMPDIR)/dummy" 82 - ]; 83 - 84 - enableParallelBuilding = true; 85 - 86 - postInstall = '' 87 - installShellCompletion --bash utilities/ovs-appctl-bashcomp.bash 88 - installShellCompletion --bash utilities/ovs-vsctl-bashcomp.bash 89 - ''; 90 - 91 - doCheck = true; 92 - checkInputs = [ 93 - iproute2 94 - ] ++ (with python3.pkgs; [ 95 - netaddr 96 - pyparsing 97 - pytest 98 - ]); 99 - 100 - meta = with lib; { 101 - changelog = "https://www.openvswitch.org/releases/NEWS-${version}.txt"; 102 - description = "A multilayer virtual switch"; 103 - longDescription = '' 104 - Open vSwitch is a production quality, multilayer virtual switch 105 - licensed under the open source Apache 2.0 license. It is 106 - designed to enable massive network automation through 107 - programmatic extension, while still supporting standard 108 - management interfaces and protocols (e.g. NetFlow, sFlow, SPAN, 109 - RSPAN, CLI, LACP, 802.1ag). In addition, it is designed to 110 - support distribution across multiple physical servers similar 111 - to VMware's vNetwork distributed vswitch or Cisco's Nexus 1000V. 112 - ''; 113 - homepage = "https://www.openvswitch.org/"; 114 - license = licenses.asl20; 115 - maintainers = with maintainers; [ netixx kmcopper ]; 116 - platforms = platforms.linux; 117 - }; 118 }
··· 1 + import ./generic.nix { 2 version = "2.17.3"; 3 + hash = "sha256-RGgR/JGuJFzDGQSmk3H7C/BEb3sk6yOaA320ADUwEcA="; 4 }