Merge pull request #258705 from tie/fix-ca-derivations-disallowed

{ruby,neovim}: fix build with content-addressed derivations

Fixes https://github.com/NixOS/nixpkgs/issues/278334
This commit is contained in:
Mario Rodas 2024-03-24 09:00:12 -05:00 committed by GitHub
commit 28e51c9d10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, gettext, msgpack-c, libtermkey, libiconv
{ lib, stdenv, fetchFromGitHub, removeReferencesTo, cmake, gettext, msgpack-c, libtermkey, libiconv
, libuv, lua, ncurses, pkg-config
, unibilium, gperf
, libvterm-neovim
@ -121,6 +121,7 @@ in {
cmake
gettext
pkg-config
removeReferencesTo
];
# extra programs test via `make functionaltest`
@ -141,8 +142,11 @@ in {
sed -i src/nvim/po/CMakeLists.txt \
-e "s|\$<TARGET_FILE:nvim|\${stdenv.hostPlatform.emulator buildPackages} &|g"
'';
postInstall = ''
find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
'';
# check that the above patching actually works
disallowedReferences = [ stdenv.cc ] ++ lib.optional (lua != codegenLua) codegenLua;
disallowedRequisites = [ stdenv.cc ] ++ lib.optional (lua != codegenLua) codegenLua;
cmakeFlags = [
# Don't use downloaded dependencies. At the end of the configurePhase one

View file

@ -74,7 +74,7 @@ let
strictDeps = true;
nativeBuildInputs = [ autoreconfHook bison ]
nativeBuildInputs = [ autoreconfHook bison removeReferencesTo ]
++ (op docSupport groff)
++ (ops (dtraceSupport && stdenv.isLinux) [ systemtap libsystemtap ])
++ ops yjitSupport [ rustPlatform.cargoSetupHook cargo rustc ]
@ -190,10 +190,10 @@ let
${
lib.optionalString (!jitSupport) ''
# Get rid of the CC runtime dependency
${removeReferencesTo}/bin/remove-references-to \
remove-references-to \
-t ${stdenv.cc} \
$out/lib/libruby*
${removeReferencesTo}/bin/remove-references-to \
remove-references-to \
-t ${stdenv.cc} \
$rbConfig
sed -i '/CC_VERSION_MESSAGE/d' $rbConfig
@ -237,7 +237,7 @@ let
cp ${./rbconfig.rb} $devdoc/lib/ruby/site_ruby/rbconfig.rb
'' + opString useBaseRuby ''
# Prevent the baseruby from being included in the closure.
${removeReferencesTo}/bin/remove-references-to \
remove-references-to \
-t ${baseRuby} \
$rbConfig $out/lib/libruby*
'';
@ -257,7 +257,7 @@ let
'';
doInstallCheck = true;
disallowedRequisites = op (!jitSupport) stdenv.cc.cc
disallowedRequisites = op (!jitSupport) stdenv.cc
++ op useBaseRuby baseRuby;
meta = with lib; {