nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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 patches = [
10 ./ioctl.patch # required /dev/tty
11 ];
12
13 nativeBuildInputs = [ bintools-unwrapped unzip ];
14
15 # slashes are significant because upstream uses o/$(MODE)/foo.o
16 buildFlags = "o//third_party/python";
17 checkTarget = "o//third_party/python/test";
18 enableParallelBuilding = true;
19
20 doCheck = true;
21 dontConfigure = true;
22 dontFixup = true;
23
24 installPhase = ''
25 runHook preInstall
26 install o/third_party/python/*.com -Dt $out/bin
27 runHook postInstall
28 '';
29
30 meta = with lib; {
31 homepage = "https://justine.lol/cosmopolitan/";
32 description = "Actually Portable Python using Cosmopolitan";
33 platforms = platforms.x86_64;
34 badPlatforms = platforms.darwin;
35 license = licenses.isc;
36 maintainers = teams.cosmopolitan.members;
37 mainProgram = "python.com";
38 };
39}