at 25.11-pre 56 lines 1.9 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 = 14 if pyShortVersion == "cp313" then "macosx_10_13_universal2" else "macosx_10_9_universal2"; 15 aarch64-linux = "manylinux2014_aarch64.manylinux_2_17_aarch64"; 16 x86_64-darwin = aarch64-darwin; 17 x86_64-linux = "manylinux2014_x86_64.manylinux_2_17_x86_64"; 18 }; 19 platform = platforms.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); 20 hashes = rec { 21 cp312-aarch64-darwin = "sha256-i/0ygF6PxOotAlO1vq7yx2NXAxbyah9PLIbLqg6zqNc="; 22 cp312-aarch64-linux = "sha256-WvK9RiY4T/xwDCmvDh3WnK/m9tvW78045eMoc6RvPRI="; 23 cp312-x86_64-darwin = cp312-aarch64-darwin; 24 cp312-x86_64-linux = "sha256-ER0yOTo5o+Ld1erRdScx04izxoW3NVDGsMqaRdlUw2Q="; 25 cp313-aarch64-darwin = "sha256-V5HcmwKfBrMY1U4N+gf1yWiMJ+XHH3pUvNqv20wJBek="; 26 cp313-aarch64-linux = "sha256-s8rr72p8a6I1WYcqtz3NgEDHFW74DN4LWRGLvf0k53k="; 27 cp313-x86_64-darwin = cp313-aarch64-darwin; 28 cp313-x86_64-linux = "sha256-JAqrYPz7/lhvRW1uy8yOyjtapf/nF+agjEHIKWQCYTc="; 29 }; 30 hash = 31 hashes."${pyShortVersion}-${stdenv.system}" 32 or (throw "Unsupported Python version: ${python.pythonVersion}"); 33in 34buildPythonPackage rec { 35 pname = "gurobipy"; 36 version = "12.0.2"; 37 inherit format; 38 39 src = fetchPypi { 40 inherit pname version; 41 python = pyShortVersion; 42 abi = pyShortVersion; 43 dist = pyShortVersion; 44 inherit format platform hash; 45 }; 46 47 pythonImportsCheck = [ "gurobipy" ]; 48 49 meta = { 50 description = "Python interface to Gurobi"; 51 homepage = "https://www.gurobi.com"; 52 license = lib.licenses.unfree; 53 maintainers = with lib.maintainers; [ wegank ]; 54 platforms = builtins.attrNames platforms; 55 }; 56}