1{ lib, stdenv, cosmopolitan, unzip, bintools-unwrapped }: 2 3stdenv.mkDerivation rec { 4 pname = "python-cosmopolitan"; 5 version = "3.6.14"; 6 7 src = cosmopolitan.dist; 8 9 nativeBuildInputs = [ bintools-unwrapped unzip ]; 10 11 # slashes are significant because upstream uses o/$(MODE)/foo.o 12 buildFlags = [ "o//third_party/python" ]; 13 checkTarget = "o//third_party/python/test"; 14 enableParallelBuilding = true; 15 16 doCheck = true; 17 dontConfigure = true; 18 dontFixup = true; 19 20 installPhase = '' 21 runHook preInstall 22 install o/third_party/python/*.com -Dt $out/bin 23 runHook postInstall 24 ''; 25 26 meta = with lib; { 27 homepage = "https://justine.lol/cosmopolitan/"; 28 description = "Actually Portable Python using Cosmopolitan"; 29 platforms = platforms.x86_64; 30 badPlatforms = platforms.darwin; 31 license = licenses.isc; 32 maintainers = teams.cosmopolitan.members; 33 mainProgram = "python.com"; 34 }; 35}