emacs: replace ad hoc implementation with writableTmpDirAsHomeHook (#379262)

This commit is contained in:
Lin Jian
2025-02-05 03:32:57 +08:00
committed by GitHub
3 changed files with 11 additions and 13 deletions
@@ -85,14 +85,11 @@ rec {
pkg: predicate:
pkg.overrideAttrs (
finalAttrs: previousAttrs: {
preInstall =
nativeBuildInputs =
if predicate finalAttrs previousAttrs then
''
HOME=$(mktemp -d)
''
+ previousAttrs.preInstall or ""
previousAttrs.nativeBuildInputs or [ ] ++ [ pkgs.writableTmpDirAsHomeHook ]
else
previousAttrs.preInstall or null;
previousAttrs.nativeBuildInputs or null;
}
);
}
@@ -12,6 +12,7 @@
gopls,
tempel,
unstableGitUpdater,
writableTmpDirAsHomeHook,
}:
let
@@ -65,6 +66,10 @@ melpaBuild {
python
];
nativeCheckInputs = [
writableTmpDirAsHomeHook
];
files = ''
("*.el"
"lsp_bridge.py"
@@ -80,7 +85,7 @@ melpaBuild {
mkfifo test.log
cat < test.log &
HOME=$(mktemp -d) python -m test.test
python -m test.test
runHook postCheck
'';
@@ -316,9 +316,7 @@ let
});
# tries to write a log file to $HOME
insert-shebang = super.insert-shebang.overrideAttrs (attrs: {
HOME = "/tmp";
});
insert-shebang = mkHome super.insert-shebang;
ivy-rtags = ignoreCompilationError (fix-rtags super.ivy-rtags); # elisp error
@@ -665,9 +663,7 @@ let
helm-rtags = ignoreCompilationError (fix-rtags super.helm-rtags); # elisp error
# tries to write to $HOME
php-auto-yasnippets = super.php-auto-yasnippets.overrideAttrs (attrs: {
HOME = "/tmp";
});
php-auto-yasnippets = mkHome super.php-auto-yasnippets;
racer = super.racer.overrideAttrs (attrs: {
postPatch = attrs.postPatch or "" + ''