Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 19.03 156 lines 4.1 kB view raw
1{ pkgs, lib }: 2 3with pkgs; 4 5(let 6 7 # Common passthru for all Python interpreters. 8 passthruFun = 9 { implementation 10 , libPrefix 11 , executable 12 , sourceVersion 13 , pythonVersion 14 , packageOverrides 15 , sitePackages 16 , pythonForBuild 17 , self 18 }: let 19 pythonPackages = callPackage ../../../top-level/python-packages.nix { 20 python = self; 21 overrides = packageOverrides; 22 }; 23 in rec { 24 isPy27 = pythonVersion == "2.7"; 25 isPy33 = pythonVersion == "3.3"; # TODO: remove 26 isPy34 = pythonVersion == "3.4"; # TODO: remove 27 isPy35 = pythonVersion == "3.5"; 28 isPy36 = pythonVersion == "3.6"; 29 isPy37 = pythonVersion == "3.7"; 30 isPy2 = lib.strings.substring 0 1 pythonVersion == "2"; 31 isPy3 = lib.strings.substring 0 1 pythonVersion == "3"; 32 isPy3k = isPy3; 33 isPyPy = interpreter == "pypy"; 34 35 buildEnv = callPackage ./wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; }; 36 withPackages = import ./with-packages.nix { inherit buildEnv pythonPackages;}; 37 pkgs = pythonPackages; 38 interpreter = "${self}/bin/${executable}"; 39 inherit executable implementation libPrefix pythonVersion sitePackages; 40 inherit sourceVersion; 41 pythonAtLeast = lib.versionAtLeast pythonVersion; 42 pythonOlder = lib.versionOlder pythonVersion; 43 inherit pythonForBuild; 44 }; 45 46in { 47 48 python27 = callPackage ./cpython/2.7 { 49 self = python27; 50 sourceVersion = { 51 major = "2"; 52 minor = "7"; 53 patch = "16"; 54 suffix = ""; 55 }; 56 sha256 = "1mqfcqp5y8r0bfyr7ppl74n0lig45p9mc4b8adlcpvj74rhfy8pj"; 57 inherit (darwin) CF configd; 58 inherit passthruFun; 59 }; 60 61 python35 = callPackage ./cpython { 62 self = python35; 63 sourceVersion = { 64 major = "3"; 65 minor = "5"; 66 patch = "7"; 67 suffix = ""; 68 }; 69 sha256 = "1p67pnp2ca5przx2s45r8m55dcn6f5hsm0l4s1zp7mglkf4r4n18"; 70 inherit (darwin) CF configd; 71 inherit passthruFun; 72 }; 73 74 python36 = callPackage ./cpython { 75 self = python36; 76 sourceVersion = { 77 major = "3"; 78 minor = "6"; 79 patch = "8"; 80 suffix = ""; 81 }; 82 sha256 = "14qi6n5gpcjnwy165wi9hkfcmbadc95ny6bxxldknxwmx50n4i1m"; 83 inherit (darwin) CF configd; 84 inherit passthruFun; 85 }; 86 87 python37 = callPackage ./cpython { 88 self = python37; 89 sourceVersion = { 90 major = "3"; 91 minor = "7"; 92 patch = "3"; 93 suffix = ""; 94 }; 95 sha256 = "066ka8csjwkycqpgyv424d8hhqhfd7r6svsp4sfcvkylci0baq6s"; 96 inherit (darwin) CF configd; 97 inherit passthruFun; 98 }; 99 100 pypy27 = callPackage ./pypy { 101 self = pypy27; 102 sourceVersion = { 103 major = "6"; 104 minor = "0"; 105 patch = "0"; 106 }; 107 sha256 = "1qjwpc8n68sxxlfg36s5vn1h2gdfvvd6lxvr4lzbvfwhzrgqahsw"; 108 pythonVersion = "2.7"; 109 db = db.override { dbmSupport = true; }; 110 python = python27; 111 inherit passthruFun; 112 }; 113 114 pypy35 = callPackage ./pypy { 115 self = pypy35; 116 sourceVersion = { 117 major = "6"; 118 minor = "0"; 119 patch = "0"; 120 }; 121 sha256 = "0lwq8nn0r5yj01bwmkk5p7xvvrp4s550l8184mkmn74d3gphrlwg"; 122 pythonVersion = "3.5"; 123 db = db.override { dbmSupport = true; }; 124 python = python27; 125 inherit passthruFun; 126 }; 127 128 pypy27_prebuilt = callPackage ./pypy/prebuilt.nix { 129 # Not included at top-level 130 self = pythonInterpreters.pypy27_prebuilt; 131 sourceVersion = { 132 major = "6"; 133 minor = "0"; 134 patch = "0"; 135 }; 136 sha256 = "0rxgnp3fm18b87ln8bbjr13g2fsf4ka4abkaim6m03y9lwmr9gvc"; # linux64 137 pythonVersion = "2.7"; 138 inherit passthruFun; 139 ncurses = ncurses5; 140 }; 141 142 pypy35_prebuilt = callPackage ./pypy/prebuilt.nix { 143 # Not included at top-level 144 self = pythonInterpreters.pypy35_prebuilt; 145 sourceVersion = { 146 major = "6"; 147 minor = "0"; 148 patch = "0"; 149 }; 150 sha256 = "0j3h08s7wpglghasmym3baycpif5jshvmk9rpav4pwwy5clzmzsc"; # linux64 151 pythonVersion = "3.5"; 152 inherit passthruFun; 153 ncurses = ncurses5; 154 }; 155 156})