mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
cosmocc: init at 2.2
This commit is contained in:
parent
afbdf8c54d
commit
e9be28ebac
2 changed files with 37 additions and 0 deletions
35
pkgs/development/tools/cosmocc/default.nix
Normal file
35
pkgs/development/tools/cosmocc/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ runCommand, lib, cosmopolitan }:
|
||||
|
||||
let
|
||||
cosmocc =
|
||||
runCommand "cosmocc"
|
||||
{
|
||||
pname = "cosmocc";
|
||||
inherit (cosmopolitan) version;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://justine.lol/cosmopolitan/";
|
||||
description = "compilers for Cosmopolitan C/C++ programs";
|
||||
license = licenses.mit;
|
||||
maintainers = teams.cosmopolitan.members;
|
||||
};
|
||||
passthru.tests = {
|
||||
cc = runCommand "c-test" { } ''
|
||||
cat > hello.c << END
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
printf("Hello world!\n");
|
||||
return 0;
|
||||
}
|
||||
END
|
||||
${cosmocc}/bin/cosmocc hello.c
|
||||
./a.out > $out
|
||||
'';
|
||||
};
|
||||
} ''
|
||||
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
|
|
@ -19293,6 +19293,8 @@ with pkgs;
|
|||
|
||||
cog = callPackage ../development/web/cog { };
|
||||
|
||||
cosmocc = callPackage ../development/tools/cosmocc { };
|
||||
|
||||
cosmopolitan = callPackage ../development/libraries/cosmopolitan { };
|
||||
|
||||
python-cosmopolitan = callPackage ../development/interpreters/python-cosmopolitan { };
|
||||
|
|
Loading…
Reference in a new issue