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