Skip to content

Commit

Permalink
GNU libc: Backport Hurd-related changes from glibc 2.12 in trunk.
Browse files Browse the repository at this point in the history
svn path=/nixpkgs/branches/stdenv-updates/; revision=32374
  • Loading branch information
civodul committed Feb 17, 2012
1 parent 0811db0 commit 5481e67
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 20 deletions.
18 changes: 12 additions & 6 deletions pkgs/development/libraries/glibc/2.13/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ cross :

{ name, fetchurl, stdenv, installLocales ? false
, gccCross ? null, kernelHeaders ? null
, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
, mig ? null, fetchgit ? null
, profilingLibraries ? false, meta
, preConfigure ? "", ... }@args :

let
# For GNU/Hurd, see below.
version = if hurdHeaders != null then "20100512" else "2.13";
version = if hurdHeaders != null then "20111025" else "2.13";

needsPortsNative = stdenv.isMips || stdenv.isArm;
needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
Expand All @@ -30,6 +31,7 @@ assert (cross != null) -> (gccCross != null);

assert (mig != null) -> (machHeaders != null);
assert (machHeaders != null) -> (hurdHeaders != null);
assert (hurdHeaders != null) -> (libpthreadHeaders != null);
assert (hurdHeaders != null) -> (fetchgit != null);

stdenv.mkDerivation ({
Expand Down Expand Up @@ -146,8 +148,8 @@ stdenv.mkDerivation ({
# maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
# See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
url = "git://git.sv.gnu.org/hurd/glibc.git";
sha256 = "f3590a54a9d897d121f91113949edbaaf3e30cdeacbb8d0a44de7b6564f6643e";
rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f";
sha256 = "3fb3dd7030a4b6d3e144fa94c32a0c4f46f17f94e2dfbc6bef41cfc3198725ca";
rev = "d740cf9d201dc9ecb0335b0a585828dea9cce793";
}
else fetchurl {
url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
Expand Down Expand Up @@ -203,11 +205,15 @@ stdenv.mkDerivation ({
then {
# Work around the fact that the configure snippet that looks for
# <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
# glibc expects both Mach and Hurd headers to be in the same place.
CPATH = "${hurdHeaders}/include:${machHeaders}/include";
# glibc expects Mach, Hurd, and pthread headers to be in the same place.
CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";

# `fetchgit' is a function and thus should not be passed to the
# `derivation' primitive.
fetchgit = null;

# Install NSS stuff in the right place.
# XXX: This will be needed for all new glibcs and isn't Hurd-specific.
makeFlags = ''vardbdir="$out/var/db"'';
}
else { }))
22 changes: 18 additions & 4 deletions pkgs/development/libraries/glibc/2.13/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ stdenv, fetchurl, kernelHeaders
, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
, mig ? null, fetchgit ? null
, installLocales ? true
, profilingLibraries ? false
, gccCross ? null
, debugSymbols ? false
}:

assert stdenv.gcc.gcc != null;
Expand All @@ -12,7 +14,7 @@ let
cross = if gccCross != null then gccCross.target else null;
in
build cross ({
name = "glibc";
name = "glibc${if debugSymbols then "-debug" else ""}";

inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
gccCross;
Expand All @@ -38,11 +40,23 @@ in

//

(if debugSymbols
then {
# Build with debugging symbols, but leave optimizations on and don't
# attempt to keep the build tree.
dontStrip = true;
dontCrossStrip = true;
NIX_STRIP_DEBUG = 0;
}
else {})

//

(if hurdHeaders != null
then rec {
inherit machHeaders hurdHeaders mig fetchgit;
inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit;

propagatedBuildInputs = [ machHeaders hurdHeaders ];
propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ];

passthru = {
# When building GCC itself `propagatedBuildInputs' above is not
Expand Down
18 changes: 12 additions & 6 deletions pkgs/development/libraries/glibc/2.14/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ cross :

{ name, fetchurl, stdenv, installLocales ? false
, gccCross ? null, kernelHeaders ? null
, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
, mig ? null, fetchgit ? null
, profilingLibraries ? false, meta
, preConfigure ? "", ... }@args :

let
# For GNU/Hurd, see below.
version = if hurdHeaders != null then "20100512" else "2.14.1";
version = if hurdHeaders != null then "20111025" else "2.14.1";

needsPortsNative = stdenv.isMips || stdenv.isArm;
needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
Expand All @@ -30,6 +31,7 @@ assert (cross != null) -> (gccCross != null);

assert (mig != null) -> (machHeaders != null);
assert (machHeaders != null) -> (hurdHeaders != null);
assert (hurdHeaders != null) -> (libpthreadHeaders != null);
assert (hurdHeaders != null) -> (fetchgit != null);

stdenv.mkDerivation ({
Expand Down Expand Up @@ -146,8 +148,8 @@ stdenv.mkDerivation ({
# maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
# See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
url = "git://git.sv.gnu.org/hurd/glibc.git";
sha256 = "f3590a54a9d897d121f91113949edbaaf3e30cdeacbb8d0a44de7b6564f6643e";
rev = "df4c3faf0ccc848b5a8086c222bdb42679a9798f";
sha256 = "3fb3dd7030a4b6d3e144fa94c32a0c4f46f17f94e2dfbc6bef41cfc3198725ca";
rev = "d740cf9d201dc9ecb0335b0a585828dea9cce793";
}
else fetchurl {
url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
Expand Down Expand Up @@ -203,11 +205,15 @@ stdenv.mkDerivation ({
then {
# Work around the fact that the configure snippet that looks for
# <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
# glibc expects both Mach and Hurd headers to be in the same place.
CPATH = "${hurdHeaders}/include:${machHeaders}/include";
# glibc expects Mach, Hurd, and pthread headers to be in the same place.
CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";

# `fetchgit' is a function and thus should not be passed to the
# `derivation' primitive.
fetchgit = null;

# Install NSS stuff in the right place.
# XXX: This will be needed for all new glibcs and isn't Hurd-specific.
makeFlags = ''vardbdir="$out/var/db"'';
}
else { }))
22 changes: 18 additions & 4 deletions pkgs/development/libraries/glibc/2.14/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{ stdenv, fetchurl, kernelHeaders
, machHeaders ? null, hurdHeaders ? null, mig ? null, fetchgit ? null
, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
, mig ? null, fetchgit ? null
, installLocales ? true
, profilingLibraries ? false
, gccCross ? null
, debugSymbols ? false
}:

assert stdenv.gcc.gcc != null;
Expand All @@ -12,7 +14,7 @@ let
cross = if gccCross != null then gccCross.target else null;
in
build cross ({
name = "glibc";
name = "glibc${if debugSymbols then "-debug" else ""}";

inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
gccCross;
Expand All @@ -38,11 +40,23 @@ in

//

(if debugSymbols
then {
# Build with debugging symbols, but leave optimizations on and don't
# attempt to keep the build tree.
dontStrip = true;
dontCrossStrip = true;
NIX_STRIP_DEBUG = 0;
}
else {})

//

(if hurdHeaders != null
then rec {
inherit machHeaders hurdHeaders mig fetchgit;
inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit;

propagatedBuildInputs = [ machHeaders hurdHeaders ];
propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ];

passthru = {
# When building GCC itself `propagatedBuildInputs' above is not
Expand Down

0 comments on commit 5481e67

Please sign in to comment.