Remove Glibc 2.14

-819
-54
pkgs/development/libraries/glibc/2.14/builder.sh
··· 1 - # Glibc cannot have itself in its RPATH. 2 - export NIX_NO_SELF_RPATH=1 3 - 4 - source $stdenv/setup 5 - 6 - postConfigure() { 7 - # Hack: get rid of the `-static' flag set by the bootstrap stdenv. 8 - # This has to be done *after* `configure' because it builds some 9 - # test binaries. 10 - export NIX_CFLAGS_LINK= 11 - export NIX_LDFLAGS_BEFORE= 12 - 13 - export NIX_DONT_SET_RPATH=1 14 - unset CFLAGS 15 - } 16 - 17 - 18 - postInstall() { 19 - if test -n "$installLocales"; then 20 - make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales 21 - fi 22 - 23 - test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache 24 - 25 - # FIXME: Use `test -n $linuxHeaders' when `kernelHeaders' has been 26 - # renamed. 27 - if test -z "$hurdHeaders"; then 28 - # Include the Linux kernel headers in Glibc, except the `scsi' 29 - # subdirectory, which Glibc provides itself. 30 - (cd $out/include && \ 31 - ln -sv $(ls -d $kernelHeaders/include/* | grep -v 'scsi$') .) 32 - fi 33 - 34 - if test -f "$out/lib/libhurduser.so"; then 35 - # libc.so, libhurduser.so, and libmachuser.so depend on each 36 - # other, so add them to libc.so (a RUNPATH on libc.so.0.3 37 - # would be ignored by the cross-linker.) 38 - echo "adding \`libhurduser.so' and \`libmachuser.so' to the \`libc.so' linker script..." 39 - sed -i "$out/lib/libc.so" \ 40 - -e"s|\(libc\.so\.[^ ]\+\>\)|\1 $out/lib/libhurduser.so $out/lib/libmachuser.so|g" 41 - fi 42 - 43 - # Fix for NIXOS-54 (ldd not working on x86_64). Make a symlink 44 - # "lib64" to "lib". 45 - if test -n "$is64bit"; then 46 - ln -s lib $out/lib64 47 - fi 48 - 49 - # This file, that should not remain in the glibc derivation, 50 - # may have not been created during the preInstall 51 - rm -f $out/lib/libgcc_s.so.1 52 - } 53 - 54 - genericBuild
-223
pkgs/development/libraries/glibc/2.14/common.nix
··· 1 - /* Build configuration used to build glibc, Info files, and locale 2 - information. */ 3 - 4 - cross : 5 - 6 - { name, fetchurl, stdenv, installLocales ? false 7 - , gccCross ? null, kernelHeaders ? null 8 - , machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null 9 - , mig ? null, fetchgit ? null 10 - , profilingLibraries ? false, meta 11 - , preConfigure ? "", ... }@args : 12 - 13 - let 14 - # For GNU/Hurd, see below. 15 - version = if hurdHeaders != null then "20111025" else "2.14.1"; 16 - 17 - needsPortsNative = stdenv.isMips || stdenv.isArm; 18 - needsPortsCross = cross.arch == "mips" || cross.arch == "arm"; 19 - needsPorts = if (stdenv ? cross) && stdenv.cross != null then true 20 - else if cross == null then needsPortsNative 21 - else needsPortsCross; 22 - 23 - srcPorts = fetchurl { 24 - url = "mirror://gnu/glibc/glibc-ports-2.14.1.tar.bz2"; 25 - sha256 = "1acs4sd5mjzmssmd0md6dfqwnziph2am7v09mbnnd8aadpxhm0qw"; 26 - }; 27 - 28 - in 29 - 30 - assert (cross != null) -> (gccCross != null); 31 - 32 - assert (mig != null) -> (machHeaders != null); 33 - assert (machHeaders != null) -> (hurdHeaders != null); 34 - assert (hurdHeaders != null) -> (libpthreadHeaders != null); 35 - assert (hurdHeaders != null) -> (fetchgit != null); 36 - 37 - stdenv.mkDerivation ({ 38 - inherit kernelHeaders installLocales; 39 - 40 - # The host/target system. 41 - crossConfig = if (cross != null) then cross.config else null; 42 - 43 - inherit (stdenv) is64bit; 44 - 45 - enableParallelBuilding = true; 46 - 47 - patches = 48 - stdenv.lib.optional (fetchgit == null) 49 - /* Fix for NIXPKGS-79: when doing host name lookups, when 50 - nsswitch.conf contains a line like 51 - 52 - hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 53 - 54 - don't return an error when mdns4_minimal can't be found. This 55 - is a bug in Glibc: when a service can't be found, NSS should 56 - continue to the next service unless "UNAVAIL=return" is set. 57 - ("NOTFOUND=return" refers to the service returning a NOTFOUND 58 - error, not the service itself not being found.) The reason is 59 - that the "status" variable (while initialised to UNAVAIL) is 60 - outside of the loop that iterates over the services, the 61 - "files" service sets status to NOTFOUND. So when the call to 62 - find "mdns4_minimal" fails, "status" will still be NOTFOUND, 63 - and it will return instead of continuing to "dns". Thus, the 64 - line 65 - 66 - hosts: mdns4_minimal [NOTFOUND=return] dns mdns4 67 - 68 - does work because "status" will contain UNAVAIL after the 69 - failure to find mdns4_minimal. */ 70 - ./nss-skip-unavail.patch 71 - ++ [ 72 - /* Have rpcgen(1) look for cpp(1) in $PATH. */ 73 - ./rpcgen-path.patch 74 - 75 - /* Allow nixos and nix handle the locale-archive. */ 76 - ./nix-locale-archive.patch 77 - 78 - /* don't use /etc/ld.so.cache, for non-nixos systems */ 79 - ./dont_use_system_ld_so_cache.patch 80 - 81 - /* Without this patch many KDE binaries crash. */ 82 - ./glibc-elf-localscope.patch 83 - ]; 84 - 85 - postPatch = '' 86 - # Needed for glibc to build with the gnumake 3.82 87 - # http://comments.gmane.org/gmane.linux.lfs.support/31227 88 - sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile 89 - 90 - # nscd needs libgcc, and we don't want it dynamically linked 91 - # because we don't want it to depend on bootstrap-tools libs. 92 - echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile 93 - ''; 94 - 95 - configureFlags = [ 96 - "-C" 97 - "--enable-add-ons" 98 - "--sysconfdir=/etc" 99 - "--localedir=/var/run/current-system/sw/lib/locale" 100 - "libc_cv_ssp=no" 101 - (if kernelHeaders != null 102 - then "--with-headers=${kernelHeaders}/include" 103 - else "--without-headers") 104 - (if profilingLibraries 105 - then "--enable-profile" 106 - else "--disable-profile") 107 - ] ++ stdenv.lib.optionals (cross != null) [ 108 - (if cross.withTLS then "--with-tls" else "--without-tls") 109 - (if cross.float == "soft" then "--without-fp" else "--with-fp") 110 - "--enable-kernel=2.6.0" 111 - "--with-__thread" 112 - ] ++ stdenv.lib.optionals stdenv.isArm [ 113 - "--host=arm-linux-gnueabi" 114 - "--build=arm-linux-gnueabi" 115 - "--without-fp" 116 - 117 - # To avoid linking with -lgcc_s (dynamic link) 118 - # so the glibc does not depend on its compiler store path 119 - "libc_cv_as_needed=no" 120 - ]; 121 - 122 - installFlags = [ "sysconfdir=$(out)/etc" ]; 123 - 124 - buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ] 125 - ++ stdenv.lib.optional (mig != null) mig; 126 - 127 - # Needed to install share/zoneinfo/zone.tab. Set to impure /bin/sh to 128 - # prevent a retained dependency on the bootstrap tools in the stdenv-linux 129 - # bootstrap. 130 - BASH_SHELL = "/bin/sh"; 131 - 132 - # Workaround for this bug: 133 - # http://sourceware.org/bugzilla/show_bug.cgi?id=411 134 - # I.e. when gcc is compiled with --with-arch=i686, then the 135 - # preprocessor symbol `__i686' will be defined to `1'. This causes 136 - # the symbol __i686.get_pc_thunk.dx to be mangled. 137 - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686"; 138 - } 139 - 140 - # Remove the `gccCross' attribute so that the *native* glibc store path 141 - # doesn't depend on whether `gccCross' is null or not. 142 - // (removeAttrs args [ "gccCross" ]) // 143 - 144 - { 145 - name = name + "-${version}" + 146 - stdenv.lib.optionalString (cross != null) "-${cross.config}"; 147 - 148 - src = 149 - if hurdHeaders != null 150 - then fetchgit { 151 - # Shamefully the "official" glibc won't build on GNU, so use the one 152 - # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch. 153 - # See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>. 154 - url = "git://git.sv.gnu.org/hurd/glibc.git"; 155 - sha256 = "3fb3dd7030a4b6d3e144fa94c32a0c4f46f17f94e2dfbc6bef41cfc3198725ca"; 156 - rev = "d740cf9d201dc9ecb0335b0a585828dea9cce793"; 157 - } 158 - else fetchurl { 159 - url = "mirror://gnu/glibc/glibc-${version}.tar.bz2"; 160 - sha256 = "0fsvf5d6sib483rp7asdy8hs0dysxqkrvw316c82hsxy7vxa51bf"; 161 - }; 162 - 163 - # `fetchurl' is a function and thus should not be passed to the 164 - # `derivation' primitive. 165 - fetchurl = null; 166 - 167 - # Remove absolute paths from `configure' & co.; build out-of-tree. 168 - preConfigure = '' 169 - export PWD_P=$(type -tP pwd) 170 - for i in configure io/ftwtest-sh; do 171 - # Can't use substituteInPlace here because replace hasn't been 172 - # built yet in the bootstrap. 173 - sed -i "$i" -e "s^/bin/pwd^$PWD_P^g" 174 - done 175 - 176 - ${if needsPorts then "tar xvf ${srcPorts}" else ""} 177 - 178 - mkdir ../build 179 - cd ../build 180 - 181 - configureScript="`pwd`/../$sourceRoot/configure" 182 - 183 - ${preConfigure} 184 - ''; 185 - 186 - meta = { 187 - homepage = http://www.gnu.org/software/libc/; 188 - description = "The GNU C Library"; 189 - 190 - longDescription = 191 - '' Any Unix-like operating system needs a C library: the library which 192 - defines the "system calls" and other basic facilities such as 193 - open, malloc, printf, exit... 194 - 195 - The GNU C library is used as the C library in the GNU system and 196 - most systems with the Linux kernel. 197 - ''; 198 - 199 - license = "LGPLv2+"; 200 - 201 - maintainers = [ stdenv.lib.maintainers.ludo ]; 202 - #platforms = stdenv.lib.platforms.linux; 203 - } // meta; 204 - } 205 - 206 - // 207 - 208 - (if hurdHeaders != null 209 - then { 210 - # Work around the fact that the configure snippet that looks for 211 - # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that 212 - # glibc expects Mach, Hurd, and pthread headers to be in the same place. 213 - CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include"; 214 - 215 - # `fetchgit' is a function and thus should not be passed to the 216 - # `derivation' primitive. 217 - fetchgit = null; 218 - 219 - # Install NSS stuff in the right place. 220 - # XXX: This will be needed for all new glibcs and isn't Hurd-specific. 221 - makeFlags = ''vardbdir="$out/var/db"''; 222 - } 223 - else { }))
-97
pkgs/development/libraries/glibc/2.14/default.nix
··· 1 - { stdenv, fetchurl, kernelHeaders 2 - , machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null 3 - , mig ? null, fetchgit ? null 4 - , installLocales ? true 5 - , profilingLibraries ? false 6 - , gccCross ? null 7 - , debugSymbols ? false 8 - }: 9 - 10 - assert stdenv.gcc.gcc != null; 11 - 12 - let 13 - build = import ./common.nix; 14 - cross = if gccCross != null then gccCross.target else null; 15 - in 16 - build cross ({ 17 - name = "glibc${if debugSymbols then "-debug" else ""}"; 18 - 19 - inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries 20 - gccCross; 21 - 22 - builder = ./builder.sh; 23 - 24 - # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for 25 - # any program we run, because the gcc will have been placed at a new 26 - # store path than that determined when built (as a source for the 27 - # bootstrap-tools tarball) 28 - # Building from a proper gcc staying in the path where it was installed, 29 - # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without 30 - # any special hack. 31 - preInstall = '' 32 - if [ -f ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 ]; then 33 - mkdir -p $out/lib 34 - ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 35 - fi 36 - ''; 37 - 38 - meta.description = "The GNU C Library"; 39 - } 40 - 41 - // 42 - 43 - (if debugSymbols 44 - then { 45 - # Build with debugging symbols, but leave optimizations on and don't 46 - # attempt to keep the build tree. 47 - dontStrip = true; 48 - dontCrossStrip = true; 49 - NIX_STRIP_DEBUG = 0; 50 - } 51 - else {}) 52 - 53 - // 54 - 55 - (if hurdHeaders != null 56 - then rec { 57 - inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit; 58 - 59 - propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ]; 60 - 61 - passthru = { 62 - # When building GCC itself `propagatedBuildInputs' above is not 63 - # honored, so we pass it here so that the GCC builder can do the right 64 - # thing. 65 - inherit propagatedBuildInputs; 66 - }; 67 - } 68 - else { }) 69 - 70 - // 71 - 72 - (if cross != null 73 - then { 74 - preConfigure = '' 75 - sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig" 76 - 77 - cat > config.cache << "EOF" 78 - libc_cv_forced_unwind=yes 79 - libc_cv_c_cleanup=yes 80 - libc_cv_gnu89_inline=yes 81 - # Only due to a problem in gcc configure scripts: 82 - libc_cv_sparc64_tls=${if cross.withTLS then "yes" else "no"} 83 - EOF 84 - export BUILD_CC=gcc 85 - export CC="$crossConfig-gcc" 86 - export AR="$crossConfig-ar" 87 - export RANLIB="$crossConfig-ranlib" 88 - 89 - dontStrip=1 90 - ''; 91 - 92 - # To avoid a dependency on the build system 'bash'. 93 - preFixup = '' 94 - rm $out/bin/{ldd,tzselect,catchsegv,xtrace} 95 - ''; 96 - } 97 - else {}))
-43
pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch
··· 1 - diff -Naur glibc-2.13-orig/elf/ldconfig.c glibc-2.13/elf/ldconfig.c 2 - --- glibc-2.13-orig/elf/ldconfig.c 2011-01-17 23:34:07.000000000 -0500 3 - +++ glibc-2.13/elf/ldconfig.c 2012-04-10 23:28:45.957492340 -0400 4 - @@ -51,7 +51,7 @@ 5 - #endif 6 - 7 - #ifndef LD_SO_CONF 8 - -# define LD_SO_CONF SYSCONFDIR "/ld.so.conf" 9 - +# define LD_SO_CONF PREFIX "/etc/ld.so.conf" 10 - #endif 11 - 12 - /* Get libc version number. */ 13 - diff -Naur glibc-2.13-orig/elf/Makefile glibc-2.13/elf/Makefile 14 - --- glibc-2.13-orig/elf/Makefile 2011-01-17 23:34:07.000000000 -0500 15 - +++ glibc-2.13/elf/Makefile 2012-04-10 23:27:05.666477442 -0400 16 - @@ -459,11 +459,11 @@ 17 - $(objpfx)sprof: $(libdl) 18 - 19 - $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o) 20 - -SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"' 21 - -CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \ 22 - +PREFIX-FLAGS := -D'PREFIX="$(prefix)"' 23 - +CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \ 24 - -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1 25 - -CFLAGS-dl-cache.c = $(SYSCONF-FLAGS) 26 - -CFLAGS-cache.c = $(SYSCONF-FLAGS) 27 - +CFLAGS-dl-cache.c = $(PREFIX-FLAGS) 28 - +CFLAGS-cache.c = $(PREFIX-FLAGS) 29 - 30 - CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1) 31 - 32 - diff -Naur glibc-2.13-orig/sysdeps/generic/dl-cache.h glibc-2.13/sysdeps/generic/dl-cache.h 33 - --- glibc-2.13-orig/sysdeps/generic/dl-cache.h 2011-01-17 23:34:07.000000000 -0500 34 - +++ glibc-2.13/sysdeps/generic/dl-cache.h 2012-04-10 23:28:20.077488815 -0400 35 - @@ -29,7 +29,7 @@ 36 - #endif 37 - 38 - #ifndef LD_SO_CACHE 39 - -# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache" 40 - +# define LD_SO_CACHE PREFIX "/etc/ld.so.cache" 41 - #endif 42 - 43 - #ifndef add_system_dir
-82
pkgs/development/libraries/glibc/2.14/glibc-elf-localscope.patch
··· 1 - diff -ru a/elf/dl-close.c b/elf/dl-close.c 2 - --- a/elf/dl-close.c 2011-02-04 00:35:03.000000000 +0100 3 - +++ b/elf/dl-close.c 2011-02-22 02:16:12.367883000 +0100 4 - @@ -180,24 +186,28 @@ 5 - /* Signal the object is still needed. */ 6 - l->l_idx = IDX_STILL_USED; 7 - 8 - +#define mark_used(dmap) \ 9 - + do { \ 10 - + if ((dmap)->l_idx != IDX_STILL_USED) \ 11 - + { \ 12 - + assert ((dmap)->l_idx >= 0 && (dmap)->l_idx < nloaded); \ 13 - + \ 14 - + if (!used[(dmap)->l_idx]) \ 15 - + { \ 16 - + used[(dmap)->l_idx] = 1; \ 17 - + if ((dmap)->l_idx - 1 < done_index) \ 18 - + done_index = (dmap)->l_idx - 1; \ 19 - + } \ 20 - + } \ 21 - + } while (0) 22 - + 23 - /* Mark all dependencies as used. */ 24 - if (l->l_initfini != NULL) 25 - { 26 - struct link_map **lp = &l->l_initfini[1]; 27 - while (*lp != NULL) 28 - { 29 - - if ((*lp)->l_idx != IDX_STILL_USED) 30 - - { 31 - - assert ((*lp)->l_idx >= 0 && (*lp)->l_idx < nloaded); 32 - - 33 - - if (!used[(*lp)->l_idx]) 34 - - { 35 - - used[(*lp)->l_idx] = 1; 36 - - if ((*lp)->l_idx - 1 < done_index) 37 - - done_index = (*lp)->l_idx - 1; 38 - - } 39 - - } 40 - - 41 - + mark_used(*lp); 42 - ++lp; 43 - } 44 - } 45 - @@ -206,19 +216,25 @@ 46 - for (unsigned int j = 0; j < l->l_reldeps->act; ++j) 47 - { 48 - struct link_map *jmap = l->l_reldeps->list[j]; 49 - - 50 - - if (jmap->l_idx != IDX_STILL_USED) 51 - - { 52 - - assert (jmap->l_idx >= 0 && jmap->l_idx < nloaded); 53 - - 54 - - if (!used[jmap->l_idx]) 55 - - { 56 - - used[jmap->l_idx] = 1; 57 - - if (jmap->l_idx - 1 < done_index) 58 - - done_index = jmap->l_idx - 1; 59 - - } 60 - - } 61 - + mark_used(jmap); 62 - } 63 - + /* And the same for owners of our scopes; normally, our last 64 - + scope provider would render us unused, but this can be 65 - + prevented by the NODELETE flag. */ 66 - + if (__builtin_expect(l->l_type == lt_loaded 67 - + && (l->l_flags_1 & DF_1_NODELETE), 0)) 68 - + for (size_t cnt = 0; l->l_scope[cnt] != NULL; ++cnt) 69 - + /* This relies on l_scope[] entries being always set either 70 - + to its own l_symbolic_searchlist address, or some map's 71 - + l_searchlist address. */ 72 - + if (l->l_scope[cnt] != &l->l_symbolic_searchlist) 73 - + { 74 - + struct link_map *ls = (struct link_map *) 75 - + ((char *) l->l_scope[cnt] 76 - + - offsetof (struct link_map, l_searchlist)); 77 - + assert (ls->l_ns == nsid); 78 - + mark_used(ls); 79 - + } 80 - } 81 - 82 - /* Sort the entries. */
-26
pkgs/development/libraries/glibc/2.14/info.nix
··· 1 - { stdenv, fetchurl, texinfo, perl }: 2 - 3 - let build = import ./common.nix; 4 - in 5 - /* null cross builder */ 6 - build null { 7 - name = "glibc-info"; 8 - 9 - inherit fetchurl stdenv; 10 - 11 - configureFlags = [ "--enable-add-ons" ]; 12 - 13 - buildInputs = [ texinfo perl ]; 14 - 15 - buildPhase = "make info"; 16 - 17 - # I don't know why the info is not generated in 'build' 18 - # Somehow building the info still does not work, because the final 19 - # libc.info hasn't a Top node. 20 - installPhase = '' 21 - mkdir -p "$out/share/info" 22 - cp -v "../$sourceRoot/manual/"*.info* "$out/share/info" 23 - ''; 24 - 25 - meta.description = "GNU Info manual of the GNU C Library"; 26 - }
-17
pkgs/development/libraries/glibc/2.14/locales-builder.sh
··· 1 - # Glibc cannot have itself in its RPATH. 2 - export NIX_NO_SELF_RPATH=1 3 - 4 - source $stdenv/setup 5 - 6 - postConfigure() { 7 - # Hack: get rid of the `-static' flag set by the bootstrap stdenv. 8 - # This has to be done *after* `configure' because it builds some 9 - # test binaries. 10 - export NIX_CFLAGS_LINK= 11 - export NIX_LDFLAGS_BEFORE= 12 - 13 - export NIX_DONT_SET_RPATH=1 14 - unset CFLAGS 15 - } 16 - 17 - genericBuild
-47
pkgs/development/libraries/glibc/2.14/locales.nix
··· 1 - /* This function builds just the `lib/locale/locale-archive' file from 2 - Glibc and nothing else. If `allLocales' is true, all supported 3 - locales are included; otherwise, just the locales listed in 4 - `locales'. See localedata/SUPPORTED in the Glibc source tree for 5 - the list of all supported locales: 6 - http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc 7 - */ 8 - 9 - { stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }: 10 - 11 - let build = import ./common.nix; 12 - in 13 - build null { 14 - name = "glibc-locales"; 15 - 16 - inherit fetchurl stdenv; 17 - installLocales = true; 18 - 19 - builder = ./locales-builder.sh; 20 - 21 - # Awful hack: `localedef' doesn't allow the path to `locale-archive' 22 - # to be overriden, but you *can* specify a prefix, i.e. it will use 23 - # <prefix>/<path-to-glibc>/lib/locale/locale-archive. So we use 24 - # $TMPDIR as a prefix, meaning that the locale-archive is placed in 25 - # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive. 26 - buildPhase = 27 - '' 28 - mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale" 29 - 30 - # Hack to allow building of the locales (needed since glibc-2.12) 31 - sed -i -e "s,^LOCALEDEF=.*,LOCALEDEF=localedef --prefix=$TMPDIR," -e \ 32 - /library-path/d ../glibc-2*/localedata/Makefile 33 - ${if allLocales then "" else 34 - "echo SUPPORTED-LOCALES=\"${toString locales}\" > ../glibc-2*/localedata/SUPPORTED"} 35 - 36 - make localedata/install-locales \ 37 - localedir=$out/lib/locale \ 38 - ''; 39 - 40 - installPhase = 41 - '' 42 - mkdir -p "$out/lib/locale" 43 - cp -v "$TMPDIR/nix/store/"*"/lib/locale/locale-archive" "$out/lib/locale" 44 - ''; 45 - 46 - meta.description = "Locale information for the GNU C Library"; 47 - }
-116
pkgs/development/libraries/glibc/2.14/nix-locale-archive.patch
··· 1 - diff --git a/locale/loadarchive.c b/locale/loadarchive.c 2 - index d545f17..0d8638a 100644 3 - --- a/locale/loadarchive.c 4 - +++ b/locale/loadarchive.c 5 - @@ -124,6 +124,25 @@ calculate_head_size (const struct locarhead *h) 6 - } 7 - 8 - 9 - +static int 10 - +open_locale_archive () 11 - +{ 12 - + int fd = -1; 13 - + char *path = getenv ("LOCALE_ARCHIVE_2_11"); 14 - + char *path2 = getenv ("LOCALE_ARCHIVE"); 15 - + const char *usualpath = "/usr/lib/locale/locale-archive"; 16 - + if (path) 17 - + fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE); 18 - + if (path2 && fd < 0) 19 - + fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE); 20 - + if (fd < 0) 21 - + fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); 22 - + if (fd < 0) 23 - + fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE); 24 - + return fd; 25 - +} 26 - + 27 - + 28 - /* Find the locale *NAMEP in the locale archive, and return the 29 - internalized data structure for its CATEGORY data. If this locale has 30 - already been loaded from the archive, just returns the existing data 31 - @@ -203,7 +222,7 @@ _nl_load_locale_from_archive (int category, const char **namep) 32 - archmapped = &headmap; 33 - 34 - /* The archive has never been opened. */ 35 - - fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); 36 - + fd = open_locale_archive (); 37 - if (fd < 0) 38 - /* Cannot open the archive, for whatever reason. */ 39 - return NULL; 40 - @@ -394,7 +413,7 @@ _nl_load_locale_from_archive (int category, const char **namep) 41 - if (fd == -1) 42 - { 43 - struct stat64 st; 44 - - fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE); 45 - + fd = open_locale_archive (); 46 - if (fd == -1) 47 - /* Cannot open the archive, for whatever reason. */ 48 - return NULL; 49 - diff --git a/locale/programs/locale.c b/locale/programs/locale.c 50 - index 77262b7..fddc00d 100644 51 - --- a/locale/programs/locale.c 52 - +++ b/locale/programs/locale.c 53 - @@ -628,6 +628,20 @@ nameentcmp (const void *a, const void *b) 54 - ((const struct nameent *) b)->name); 55 - } 56 - 57 - +static int 58 - +open_nix_locale_archive (const char * fname, int access) 59 - +{ 60 - + int fd = -1; 61 - + char *path = getenv ("LOCALE_ARCHIVE_2_11"); 62 - + char *path2 = getenv ("LOCALE_ARCHIVE"); 63 - + if (path) 64 - + fd = open64 (path, access); 65 - + if (path2 && fd < 0) 66 - + fd = open64 (path2, access); 67 - + if (fd < 0) 68 - + fd = open64 (fname, access); 69 - + return fd; 70 - +} 71 - 72 - static int 73 - write_archive_locales (void **all_datap, char *linebuf) 74 - @@ -641,7 +658,7 @@ write_archive_locales (void **all_datap, char *linebuf) 75 - int fd, ret = 0; 76 - uint32_t cnt; 77 - 78 - - fd = open64 (ARCHIVE_NAME, O_RDONLY); 79 - + fd = open_nix_locale_archive (ARCHIVE_NAME, O_RDONLY); 80 - if (fd < 0) 81 - return 0; 82 - 83 - diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c 84 - index 85ba77d..3ad2af8 100644 85 - --- a/locale/programs/locarchive.c 86 - +++ b/locale/programs/locarchive.c 87 - @@ -512,6 +512,20 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head) 88 - *ah = new_ah; 89 - } 90 - 91 - +static int 92 - +open_nix_locale_archive (const char * fname, int access) 93 - +{ 94 - + int fd = -1; 95 - + char *path = getenv ("LOCALE_ARCHIVE_2_11"); 96 - + char *path2 = getenv ("LOCALE_ARCHIVE"); 97 - + if (path) 98 - + fd = open64 (path, access); 99 - + if (path2 && fd < 0) 100 - + fd = open64 (path2, access); 101 - + if (fd < 0) 102 - + fd = open64 (fname, access); 103 - + return fd; 104 - +} 105 - 106 - void 107 - open_archive (struct locarhandle *ah, bool readonly) 108 - @@ -531,7 +548,7 @@ open_archive (struct locarhandle *ah, bool readonly) 109 - while (1) 110 - { 111 - /* Open the archive. We must have exclusive write access. */ 112 - - fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR); 113 - + fd = open_nix_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR); 114 - if (fd == -1) 115 - { 116 - /* Maybe the file does not yet exist. */
-21
pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch
··· 1 - diff -ru glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c glibc-2.11.2/sysdeps/posix/getaddrinfo.c 2 - --- glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c 2010-05-19 22:38:20.000000000 +0200 3 - +++ glibc-2.11.2/sysdeps/posix/getaddrinfo.c 2010-08-05 18:39:54.259556327 +0200 4 - @@ -505,8 +505,6 @@ 5 - int no_data = 0; 6 - int no_inet6_data = 0; 7 - service_user *nip = NULL; 8 - - enum nss_status inet6_status = NSS_STATUS_UNAVAIL; 9 - - enum nss_status status = NSS_STATUS_UNAVAIL; 10 - int no_more; 11 - int old_res_options; 12 - 13 - @@ -702,6 +700,8 @@ 14 - 15 - while (!no_more) 16 - { 17 - + enum nss_status inet6_status = NSS_STATUS_UNAVAIL; 18 - + enum nss_status status = NSS_STATUS_UNAVAIL; 19 - no_data = 0; 20 - nss_gethostbyname4_r fct4 21 - = __nss_lookup_function (nip, "gethostbyname4_r");
-72
pkgs/development/libraries/glibc/2.14/rpcgen-path.patch
··· 1 - By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths 2 - (`/lib/cpp', etc.), which may only be overrided with the `-Y' option. This 3 - patch makes it run any `cpp' command found in $PATH. 4 - 5 - --- glibc-2.7/sunrpc/rpc_main.c 2006-11-10 21:54:46.000000000 +0100 6 - +++ glibc-2.7/sunrpc/rpc_main.c 2009-04-22 14:32:10.000000000 +0200 7 - @@ -79,7 +79,7 @@ static const char *cmdname; 8 - 9 - static const char *svcclosetime = "120"; 10 - static int cppDefined; /* explicit path for C preprocessor */ 11 - -static const char *CPP = SUNOS_CPP; 12 - +static const char *CPP = "cpp"; 13 - static const char CPPFLAGS[] = "-C"; 14 - static char *pathbuf; 15 - static int cpp_pid; 16 - @@ -108,7 +108,6 @@ static char *extendfile (const char *fil 17 - static void open_output (const char *infile, const char *outfile); 18 - static void add_warning (void); 19 - static void clear_args (void); 20 - -static void find_cpp (void); 21 - static void open_input (const char *infile, const char *define); 22 - static int check_nettype (const char *name, const char *list_to_check[]); 23 - static void c_output (const char *infile, const char *define, 24 - @@ -327,31 +326,6 @@ clear_args (void) 25 - argcount = FIXEDARGS; 26 - } 27 - 28 - -/* make sure that a CPP exists */ 29 - -static void 30 - -find_cpp (void) 31 - -{ 32 - - struct stat buf; 33 - - 34 - - if (stat (CPP, &buf) < 0) 35 - - { /* /lib/cpp or explicit cpp does not exist */ 36 - - if (cppDefined) 37 - - { 38 - - fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP); 39 - - crash (); 40 - - } 41 - - else 42 - - { /* try the other one */ 43 - - CPP = SVR4_CPP; 44 - - if (stat (CPP, &buf) < 0) 45 - - { /* can't find any cpp */ 46 - - fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout); 47 - - crash (); 48 - - } 49 - - } 50 - - } 51 - -} 52 - - 53 - /* 54 - * Open input file with given define for C-preprocessor 55 - */ 56 - @@ -370,7 +344,6 @@ open_input (const char *infile, const ch 57 - switch (cpp_pid) 58 - { 59 - case 0: 60 - - find_cpp (); 61 - putarg (0, CPP); 62 - putarg (1, CPPFLAGS); 63 - addarg (define); 64 - @@ -380,7 +353,7 @@ open_input (const char *infile, const ch 65 - close (1); 66 - dup2 (pd[1], 1); 67 - close (pd[0]); 68 - - execv (arglist[0], (char **) arglist); 69 - + execvp (arglist[0], (char **) arglist); 70 - perror ("execv"); 71 - exit (1); 72 - case -1:
-21
pkgs/top-level/all-packages.nix
··· 3608 3608 inherit fetchgit; 3609 3609 })); 3610 3610 3611 - glibc214 = (callPackage ../development/libraries/glibc/2.14 { 3612 - kernelHeaders = linuxHeaders; 3613 - installLocales = getConfig [ "glibc" "locales" ] false; 3614 - machHeaders = null; 3615 - hurdHeaders = null; 3616 - gccCross = null; 3617 - }) // (lib.optionalAttrs (crossSystem != null) { hostDrv = glibc214Cross; }); 3618 - 3619 - glibc214Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.14) 3620 - (let crossGNU = (crossSystem != null && crossSystem.config == "i586-pc-gnu"); 3621 - in { 3622 - inherit stdenv fetchurl; 3623 - gccCross = gccCrossStageStatic; 3624 - kernelHeaders = if crossGNU then gnu.hurdHeaders else linuxHeadersCross; 3625 - installLocales = getConfig [ "glibc" "locales" ] false; 3626 - } 3627 - // lib.optionalAttrs crossGNU { 3628 - inherit (gnu) machHeaders hurdHeaders libpthreadHeaders mig; 3629 - inherit fetchgit; 3630 - })); 3631 - 3632 3611 glibc216 = callPackage ../development/libraries/glibc/2.16 { 3633 3612 kernelHeaders = linuxHeaders; 3634 3613 installLocales = config.glibc.locales or false;