diff options
author | Vladimír Čunát <v@cunat.cz> | 2019-08-18 20:58:56 +0200 |
---|---|---|
committer | Luka Blaskovic <lblasc@tvbeat.com> | 2020-01-14 08:27:00 +0000 |
commit | 2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6 (patch) | |
tree | ee705428ab467709d238996c9929b3e4912fa8c3 /pkgs/stdenv | |
parent | 0c75f513045cdccadd53d08c8027815b9b5b3e6b (diff) | |
download | nixpkgs-2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6.tar nixpkgs-2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6.tar.gz nixpkgs-2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6.tar.bz2 nixpkgs-2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6.tar.lz nixpkgs-2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6.tar.xz nixpkgs-2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6.tar.zst nixpkgs-2aea16c4d6ee1fa4985ad94d04f2046b2e2b6df6.zip |
glibc: depend on libidn2 (and libunistring, transitively)
It's a bit hacky, but ATM I can't see any better way for glibc >= 2.28. Signed-off-by: Luka Blaskovic <lblasc@tvbeat.com>
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index f73a297281e..60c0730dce1 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -227,6 +227,27 @@ in gcc-unwrapped coreutils gnugrep perl gnum4 bison; dejagnu = super.dejagnu.overrideAttrs (a: { doCheck = false; } ); + + # We need libidn2 and its dependency libunistring as glibc dependency. + # To avoid the cycle, we build against bootstrap libc, nuke references, + # and use the result as input for our final glibc. We also pass this pair + # through, so the final package-set uses exactly the same builds. + libunistring = super.libunistring.overrideAttrs (attrs: { + postFixup = attrs.postFixup or "" + '' + ${self.nukeReferences}/bin/nuke-refs "$out"/lib/lib*.so.*.* + ''; + # Apparently iconv won't work with bootstrap glibc, but it will be used + # with glibc built later where we keep *this* build of libunistring, + # so we need to trick it into supporting libiconv. + am_cv_func_iconv_works = "yes"; + }); + libidn2 = super.libidn2.overrideAttrs (attrs: { + postFixup = attrs.postFixup or "" + '' + ${self.nukeReferences}/bin/nuke-refs -e '${lib.getLib self.libunistring}' \ + "$out"/lib/lib*.so.*.* + ''; + }); + # This also contains the full, dynamically linked, final Glibc. binutils = prevStage.binutils.override { # Rewrap the binutils with the new glibc, so both the next @@ -247,7 +268,7 @@ in inherit (prevStage) ccWrapperStdenv binutils coreutils gnugrep - perl patchelf linuxHeaders gnum4 bison; + perl patchelf linuxHeaders gnum4 bison libidn2 libunistring; ${localSystem.libc} = getLibc prevStage; # Link GCC statically against GMP etc. This makes sense because # these builds of the libraries are only used by GCC, so it @@ -277,7 +298,7 @@ in # because gcc (since JAR support) already depends on zlib, and # then if we already have a zlib we want to use that for the # other purposes (binutils and top-level pkgs) too. - inherit (prevStage) gettext gnum4 bison gmp perl texinfo zlib linuxHeaders; + inherit (prevStage) gettext gnum4 bison gmp perl texinfo zlib linuxHeaders libidn2 libunistring; ${localSystem.libc} = getLibc prevStage; binutils = super.binutils.override { # Don't use stdenv's shell but our own @@ -363,7 +384,7 @@ in ] # Library dependencies ++ map getLib ( - [ attr acl zlib pcre ] + [ attr acl zlib pcre libidn2 libunistring ] ++ lib.optional (gawk.libsigsegv != null) gawk.libsigsegv ) # More complicated cases @@ -378,7 +399,7 @@ in inherit (prevStage) gzip bzip2 xz bash coreutils diffutils findutils gawk gnumake gnused gnutar gnugrep gnupatch patchelf - attr acl zlib pcre; + attr acl zlib pcre libunistring libidn2; ${localSystem.libc} = getLibc prevStage; } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { # Need to get rid of these when cross-compiling. |