feat(hmpl): render simple placeholder with memory leak of course
This commit is contained in:
37
package/c/chectic/default.nix
Normal file
37
package/c/chectic/default.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ stdenv, gcc, lib }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
pname = "chectic";
|
||||
version = "1.0";
|
||||
src = ./.;
|
||||
doCheck = true;
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p target
|
||||
${gcc}/bin/cc -Wall -Wextra -g \
|
||||
-std=c99 \
|
||||
-pedantic -fsanitize=address \
|
||||
-c chectic.c -o target/chectic.o
|
||||
${gcc}/bin/ar rcs target/libchectic.a target/chectic.o
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
mkdir -p target/test
|
||||
for test_file in test/*.c; do
|
||||
exe="target/test/$(basename ''${test_file%.c})"
|
||||
${gcc}/bin/cc -Wall -Wextra -g -pedantic -fsanitize=address -I. "$test_file" -Ltarget -lchectic -o "$exe"
|
||||
"$exe"
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib $out/include
|
||||
cp target/libchectic.a $out/lib/
|
||||
cp chectic.h $out/include/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "libhectic";
|
||||
license = lib.licenses.mit;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user