1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 14:32:42 +01:00
nix/lib/default.nix
Eelco Dolstra 17e20716c0 * A function to build libraries.
* The linker can link against libraries.
* C flags can be passed to the C compiler.
2004-07-06 17:25:10 +00:00

46 lines
1.1 KiB
Nix

rec {
inherit (import /home/eelco/nixpkgs/pkgs/system/i686-linux.nix) stdenv;
compileC = {main, localIncludes ? [], cFlags ? ""}: stdenv.mkDerivation {
name = "compile-c";
builder = ./compile-c.sh;
localIncludes =
if localIncludes == "auto" then
import (findIncludes {
main = toString main;
hack = curTime;
inherit cFlags;
})
else
localIncludes;
inherit main cFlags;
};
/*
runCommand = {command}: {
name = "run-command";
builder = ./run-command.sh;
inherit command;
};
*/
findIncludes = {main, hack, cFlags ? ""}: stdenv.mkDerivation {
name = "find-includes";
builder = ./find-includes.sh;
inherit main hack cFlags;
};
link = {objects, programName ? "program", libraries ? []}: stdenv.mkDerivation {
name = "link";
builder = ./link.sh;
inherit objects programName libraries;
};
makeLibrary = {objects, libraryName ? []}: stdenv.mkDerivation {
name = "library";
builder = ./make-library.sh;
inherit objects libraryName;
};
}