gdb: configure a safe path instead of wrapping
This commit is contained in:
parent
6cff4ce58b
commit
a3e008420e
|
@ -70,6 +70,7 @@ stdenv.mkDerivation rec {
|
||||||
"--with-gmp=${gmp.dev}"
|
"--with-gmp=${gmp.dev}"
|
||||||
"--with-mpfr=${mpfr.dev}"
|
"--with-mpfr=${mpfr.dev}"
|
||||||
"--with-expat" "--with-libexpat-prefix=${expat.dev}"
|
"--with-expat" "--with-libexpat-prefix=${expat.dev}"
|
||||||
|
"--with-auto-load-safe-path=${stdenv.cc.cc.lib}"
|
||||||
] ++ stdenv.lib.optional (!pythonSupport) "--without-python";
|
] ++ stdenv.lib.optional (!pythonSupport) "--without-python";
|
||||||
|
|
||||||
postInstall =
|
postInstall =
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
{ stdenv, lib, makeWrapper, gdb-unwrapped, safePaths }:
|
|
||||||
|
|
||||||
let
|
|
||||||
gdb = gdb-unwrapped;
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation {
|
|
||||||
name = gdb.name;
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
|
||||||
propagatedUserEnvPkgs = [ gdb ];
|
|
||||||
phases = "installPhase fixupPhase";
|
|
||||||
|
|
||||||
# Find all gdb plugins in `safePaths` and
|
|
||||||
# mark these files as safe to load.
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/share/gdb
|
|
||||||
initScript=$out/share/gdb/gdbinit
|
|
||||||
touch $initScript
|
|
||||||
|
|
||||||
for safePath in ${lib.concatStringsSep " " safePaths}; do
|
|
||||||
for plugin in $(find $safePath | grep -- '.*-gdb.*'); do
|
|
||||||
echo add-auto-load-safe-path $plugin >> $initScript
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
makeWrapper "${gdb}/bin/gdb" \
|
|
||||||
"$out/bin/gdb" \
|
|
||||||
--add-flags "-x $initScript"
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = gdb.meta;
|
|
||||||
}
|
|
|
@ -10471,9 +10471,7 @@ in
|
||||||
|
|
||||||
bashdb = callPackage ../development/tools/misc/bashdb { };
|
bashdb = callPackage ../development/tools/misc/bashdb { };
|
||||||
|
|
||||||
gdb = callPackage ../development/tools/misc/gdb/wrapper.nix { safePaths = [ stdenv.cc.cc.lib ]; };
|
gdb = callPackage ../development/tools/misc/gdb {
|
||||||
|
|
||||||
gdb-unwrapped = callPackage ../development/tools/misc/gdb {
|
|
||||||
guile = null;
|
guile = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue