Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glibc: allow overriding common.nix #210325

Merged
merged 1 commit into from Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions pkgs/development/libraries/glibc/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
, profilingLibraries ? false
, withGd ? false
, withLibcrypt ? false
, meta
This conversation was marked as resolved.
Show resolved Hide resolved
, extraBuildInputs ? []
, extraNativeBuildInputs ? []
, ...
Expand Down Expand Up @@ -264,9 +263,5 @@ stdenv.mkDerivation ({

maintainers = with maintainers; [ eelco ma27 ];
platforms = platforms.linux;
} // meta;
}

// lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
preInstall = null; # clobber the native hook
} // (args.meta or {});
})
18 changes: 10 additions & 8 deletions pkgs/development/libraries/glibc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ let
];
in

callPackage ./common.nix { inherit stdenv; } {
pname = "glibc" + lib.optionalString withGd "-gd";

inherit withLinuxHeaders profilingLibraries withGd withLibcrypt;
(callPackage ./common.nix { inherit stdenv; } {
inherit withLinuxHeaders withGd profilingLibraries withLibcrypt;
pname = "glibc" + lib.optionalString withGd "-gd";
}).overrideAttrs(previousAttrs: {

# Note:
# Things you write here override, and do not add to,
# the values in `common.nix`.
# (For example, if you define `patches = [...]` here, it will
# override the patches in `common.nix`.)
# override the patches in `common.nix` -- so instead you should
# write `patches = (previousAttrs.patches or []) ++ [ ... ]`.

NIX_NO_SELF_RPATH = true;

Expand Down Expand Up @@ -74,7 +75,7 @@ callPackage ./common.nix { inherit stdenv; } {
# - dejagnu: during linux bootstrap tcl SIGSEGVs
# - clang-wrapper in cross-compilation
# Last attempt: https://github.com/NixOS/nixpkgs/pull/36948
preInstall = ''
preInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
mkdir -p $out/lib
cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
Expand Down Expand Up @@ -153,5 +154,6 @@ callPackage ./common.nix { inherit stdenv; } {

This conversation was marked as resolved.
Show resolved Hide resolved
separateDebugInfo = true;

meta.description = "The GNU C Library";
}
meta = (previousAttrs.meta or {}) // { description = "The GNU C Library"; };
})