feat: C templates
This commit is contained in:
parent
e5faf58ba8
commit
f5427d28a9
15 changed files with 236 additions and 0 deletions
23
c/basic/nixpkgs/package.nix
Normal file
23
c/basic/nixpkgs/package.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
stdenv
|
||||
}:
|
||||
let
|
||||
source = "src/hello.c";
|
||||
exec = "hello";
|
||||
in stdenv.mkDerivation {
|
||||
pname = "hello";
|
||||
version = "0.1";
|
||||
src = ./.;
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
gcc ${source} -o ${exec}.bin
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/bin
|
||||
install ${exec}.bin $out/bin/${exec}
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue