Compare commits

...

4 Commits

Author SHA1 Message Date
Eelco Dolstra
5995f80395 * Doh.
svn path=/nixpkgs/branches/purity-test/; revision=11312
2008-03-27 18:03:39 +00:00
Eelco Dolstra
bac950f333 svn path=/nixpkgs/branches/purity-test/; revision=11311 2008-03-27 17:54:49 +00:00
Eelco Dolstra
70f75fcf4b * Set timestamps, uids and gids in .a archives to 0 during Nix builds
so that multiple builds of the same derivation yield the same
  result.

svn path=/nixpkgs/branches/purity-test/; revision=11309
2008-03-27 17:35:19 +00:00
Eelco Dolstra
88dd14103e svn path=/nixpkgs/branches/purity-test/; revision=11306 2008-03-27 14:06:44 +00:00
5 changed files with 37 additions and 5 deletions

View File

@ -0,0 +1,19 @@
diff -rc binutils-2.18/bfd/archive.c binutils-2.18-new/bfd/archive.c
*** binutils-2.18/bfd/archive.c 2007-08-06 21:59:14.000000000 +0200
--- binutils-2.18-new/bfd/archive.c 2008-03-27 13:17:55.000000000 +0100
***************
*** 1383,1388 ****
--- 1383,1395 ----
return NULL;
}
+ char * envvar = getenv("NIX_AR_FORCE_PURITY");
+ if (envvar && strcmp(envvar, "1") == 0) {
+ status.st_mtime = 0;
+ status.st_uid = 0;
+ status.st_gid = 0;
+ }
+
amt = sizeof (struct ar_hdr) + sizeof (struct areltdata);
ared = bfd_zalloc (abfd, amt);
if (ared == NULL)

View File

@ -2,12 +2,23 @@
stdenv.mkDerivation { stdenv.mkDerivation {
name = "binutils-2.18"; name = "binutils-2.18";
builder = ./builder.sh; builder = ./builder.sh;
src = fetchurl { src = fetchurl {
url = mirror://gnu/binutils/binutils-2.18.tar.bz2; url = mirror://gnu/binutils/binutils-2.18.tar.bz2;
sha256 = "16zfc7llbjdn69bbdy7kqgg2xa67ypgj7z5qicgwzvghaaj36yj8"; sha256 = "16zfc7llbjdn69bbdy7kqgg2xa67ypgj7z5qicgwzvghaaj36yj8";
}; };
patches = [
# Set timestamps, uids and gids in .a archives to 0 during Nix
# builds so that multiple builds of the same derivation yield the
# same result.
./ar-purity.patch
];
inherit noSysDirs; inherit noSysDirs;
configureFlags = "--disable-werror"; # needed for dietlibc build configureFlags = "--disable-werror"; # needed for dietlibc build
meta = { meta = {

View File

@ -50,6 +50,7 @@ rec {
tarball = download {inherit url sha1 pkgname;}; tarball = download {inherit url sha1 pkgname;};
inherit system; inherit system;
allowedReferences = []; allowedReferences = [];
dummy = "2";
}; };
# The various statically linked components that make up the standard # The various statically linked components that make up the standard

View File

@ -1,4 +1,5 @@
export NIX_ENFORCE_PURITY=1 export NIX_ENFORCE_PURITY=1
export NIX_AR_FORCE_PURITY=1
if test "$param1" = "static"; then if test "$param1" = "static"; then
export NIX_CFLAGS_LINK="-static" export NIX_CFLAGS_LINK="-static"

View File

@ -296,9 +296,9 @@ let
in [ in [
i686LinuxPkgs i686LinuxPkgs
x86_64LinuxPkgs #x86_64LinuxPkgs
i686FreeBSDPkgs #i686FreeBSDPkgs
powerpcDarwinPkgs #powerpcDarwinPkgs
i686DarwinPkgs #i686DarwinPkgs
cygwinPkgs #cygwinPkgs
] ]