mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-01 03:12:51 +00:00
3666c314f8
Also, a refactor.
26 lines
640 B
Nix
26 lines
640 B
Nix
{ runCommand, cosmopolitan }:
|
|
|
|
let
|
|
cosmocc = runCommand "cosmocc-${cosmopolitan.version}"
|
|
{
|
|
pname = "cosmocc";
|
|
inherit (cosmopolitan) version;
|
|
|
|
passthru.tests = {
|
|
cc = runCommand "c-test" { } ''
|
|
${cosmocc}/bin/cosmocc ${./hello.c}
|
|
./a.out > $out
|
|
'';
|
|
};
|
|
|
|
meta = cosmopolitan.meta // {
|
|
description = "compilers for Cosmopolitan C/C++ programs";
|
|
};
|
|
} ''
|
|
mkdir -p $out/bin
|
|
install ${cosmopolitan.dist}/tool/scripts/{cosmocc,cosmoc++} $out/bin
|
|
sed 's|/opt/cosmo\([ /]\)|${cosmopolitan.dist}\1|g' -i $out/bin/*
|
|
'';
|
|
in
|
|
cosmocc
|