mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
reliable (if somewhat inefficient): make the current time an attribute of the derivation. Thus, every call to `nix-build' will cause the find-includes derivation to be re-done (but not the actual compilations if that's not necessary!). I added a `curTime' primop to do this.
36 lines
806 B
Nix
36 lines
806 B
Nix
rec {
|
|
|
|
inherit (import /home/eelco/nixpkgs/pkgs/system/i686-linux.nix) stdenv;
|
|
|
|
compileC = {main, localIncludes ? []}: stdenv.mkDerivation {
|
|
name = "compile-c";
|
|
builder = ./compile-c.sh;
|
|
localIncludes =
|
|
if localIncludes == "auto" then
|
|
import (findIncludes {main = toString main; hack = curTime;})
|
|
else
|
|
localIncludes;
|
|
inherit main;
|
|
};
|
|
|
|
/*
|
|
runCommand = {command}: {
|
|
name = "run-command";
|
|
builder = ./run-command.sh;
|
|
inherit command;
|
|
};
|
|
*/
|
|
|
|
findIncludes = {main, hack}: stdenv.mkDerivation {
|
|
name = "find-includes";
|
|
builder = ./find-includes.sh;
|
|
inherit main hack;
|
|
};
|
|
|
|
link = {objects, programName ? "program"}: stdenv.mkDerivation {
|
|
name = "link";
|
|
builder = ./link.sh;
|
|
inherit objects programName;
|
|
};
|
|
|
|
}
|