at 24.11-pre 55 lines 1.8 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 python, 6 fetchPypi, 7}: 8 9let 10 format = "wheel"; 11 pyShortVersion = "cp" + builtins.replaceStrings [ "." ] [ "" ] python.pythonVersion; 12 platforms = rec { 13 aarch64-darwin = "macosx_10_9_universal2"; 14 aarch64-linux = "manylinux2014_aarch64.manylinux_2_17_aarch64"; 15 x86_64-darwin = aarch64-darwin; 16 x86_64-linux = "manylinux2014_x86_64.manylinux_2_17_x86_64"; 17 }; 18 platform = platforms.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); 19 hashes = rec { 20 cp311-aarch64-darwin = "sha256-jODaasqXupII5JDE1QLUK+Jd07WJfAtxB3NIHCeuDa4="; 21 cp311-aarch64-linux = "sha256-hx6BgCbI8ojXRA/NS4Qr7N8QBvQ0lfxPbj7G2bi6PXo="; 22 cp311-x86_64-darwin = cp311-aarch64-darwin; 23 cp311-x86_64-linux = "sha256-hiZbepqPPlMcG77m5hwefQtoJk6XZ5W0z3rsaLnmbrg="; 24 cp312-aarch64-darwin = "sha256-H5J44n2CUqOo8jzn2G6gZPehWsbPnZtHXi4Iygx2RRM="; 25 cp312-aarch64-linux = "sha256-xFUR7yizqSsytyfStRigKlZ7q8uY+VgRR/j29DKPWp0="; 26 cp312-x86_64-darwin = cp312-aarch64-darwin; 27 cp312-x86_64-linux = "sha256-giNHTNfLX1hIiWOPQlLOnqjrbPWkKQrA4KXug6ujYxI="; 28 }; 29 hash = 30 hashes."${pyShortVersion}-${stdenv.system}" 31 or (throw "Unsupported Python version: ${python.pythonVersion}"); 32in 33buildPythonPackage rec { 34 pname = "gurobipy"; 35 version = "11.0.2"; 36 inherit format; 37 38 src = fetchPypi { 39 inherit pname version; 40 python = pyShortVersion; 41 abi = pyShortVersion; 42 dist = pyShortVersion; 43 inherit format platform hash; 44 }; 45 46 pythonImportsCheck = [ "gurobipy" ]; 47 48 meta = { 49 description = "Python interface to Gurobi"; 50 homepage = "https://www.gurobi.com"; 51 license = lib.licenses.unfree; 52 maintainers = with lib.maintainers; [ wegank ]; 53 platforms = builtins.attrNames platforms; 54 }; 55}