11 stdenv.mkDerivation (finalAttrs: {
12 pname = "cosmopolitan";
15 src = fetchFromGitHub {
17 repo = "cosmopolitan";
18 rev = finalAttrs.version;
19 hash = "sha256-DTL1dXH+LhaxWpiCrsNjV74Bw5+kPbhEAA2Z1NKiPDk=";
23 # make sure tests set PATH correctly
25 src = ./fix-paths.patch;
37 outputs = [ "out" "dist" ];
39 # slashes are significant because upstream uses o/$(MODE)/foo.o
48 checkTarget = "o//test";
50 enableParallelBuilding = true;
58 # some syscall tests fail because we're in a sandbox
59 "test/libc/calls/sched_setscheduler_test.c"
60 "test/libc/thread/pthread_create_test.c"
61 "test/libc/calls/getgroups_test.c"
63 "test/libc/stdio/posix_spawn_test.c"
65 in lib.concatStringsSep ";\n" (map (t: "rm -v ${t}") failingTests);
70 mkdir -p $out/{include,lib}
71 install o/cosmopolitan.h $out/include
72 install o/cosmopolitan.a o/libc/crt/crt.o o/ape/ape.{o,lds} o/ape/ape-no-modify-self.o $out/lib
79 cosmocc = callPackage ./cosmocc.nix {
80 cosmopolitan = finalAttrs.finalPackage;
85 homepage = "https://justine.lol/cosmopolitan/";
86 description = "Your build-once run-anywhere c library";
87 license = lib.licenses.isc;
88 maintainers = lib.teams.cosmopolitan.members;
89 platforms = lib.platforms.x86_64;
90 badPlatforms = lib.platforms.darwin;