summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2025-04-19 21:37:21 +0200
committerPol Dellaiera <pol.dellaiera@protonmail.com>2025-04-21 07:02:46 +0200
commit540ddbcf2ff3d194d190bab59ecadf14b1532681 (patch)
treefbfd3f110c921c71c1715711e8b28cdfdacd959c /doc
parentactual-server: 25.3.1 -> 25.4.0 (#396421) (diff)
downloadnixpkgs-540ddbcf2ff3d194d190bab59ecadf14b1532681.tar.gz
doc: use `writableTmpDirAsHomeHook`
Diffstat (limited to 'doc')
-rw-r--r--doc/languages-frameworks/bower.section.md5
-rw-r--r--doc/languages-frameworks/emscripten.section.md2
-rw-r--r--doc/languages-frameworks/javascript.section.md5
-rw-r--r--doc/languages-frameworks/python.section.md5
-rw-r--r--doc/languages-frameworks/texlive.section.md2
5 files changed, 13 insertions, 6 deletions
diff --git a/doc/languages-frameworks/bower.section.md b/doc/languages-frameworks/bower.section.md
index 9e12afc68273..c22fa2febaf2 100644
--- a/doc/languages-frameworks/bower.section.md
+++ b/doc/languages-frameworks/bower.section.md
@@ -105,9 +105,12 @@ pkgs.stdenv.mkDerivation {
src = myWebApp;
};
+ nativeBuildInputs = [
+ writableTmpDirAsHomeHook # note 3
+ ];
+
buildPhase = ''
cp --reflink=auto --no-preserve=mode -R $bowerComponents/bower_components . # note 2
- export HOME=$PWD # note 3
${pkgs.nodePackages.gulp}/bin/gulp build # note 4
'';
diff --git a/doc/languages-frameworks/emscripten.section.md b/doc/languages-frameworks/emscripten.section.md
index ce0956c51b02..ea9ddf5c6d71 100644
--- a/doc/languages-frameworks/emscripten.section.md
+++ b/doc/languages-frameworks/emscripten.section.md
@@ -118,6 +118,7 @@ pkgs.buildEmscriptenPackage rec {
];
nativeBuildInputs = [
pkg-config
+ writableTmpDirAsHomeHook
zlib
];
@@ -140,7 +141,6 @@ pkgs.buildEmscriptenPackage rec {
'';
buildPhase = ''
- HOME=$TMPDIR
make -f Makefile.emEnv
'';
diff --git a/doc/languages-frameworks/javascript.section.md b/doc/languages-frameworks/javascript.section.md
index 440e8c62adaa..31bb51d0dde9 100644
--- a/doc/languages-frameworks/javascript.section.md
+++ b/doc/languages-frameworks/javascript.section.md
@@ -646,8 +646,11 @@ It's important to use the `--offline` flag. For example if you script is `"build
```nix
{
+ nativeBuildInputs = [
+ writableTmpDirAsHomeHook
+ ];
+
buildPhase = ''
- export HOME=$(mktemp -d)
yarn --offline build
'';
}
diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md
index 119e19f71877..6594254a0387 100644
--- a/doc/languages-frameworks/python.section.md
+++ b/doc/languages-frameworks/python.section.md
@@ -2135,8 +2135,9 @@ Occasionally packages don't make use of a common test framework, which may then
#### Common issues {#common-issues}
-* Tests that attempt to access `$HOME` can be fixed by using the following
- work-around before running tests (e.g. `preCheck`): `export HOME=$(mktemp -d)`
+* Tests that attempt to access `$HOME` can be fixed by using `writableTmpDirAsHomeHook` in
+ `nativeCheckInputs`, which sets up a writable temporary directory as the home directory. Alternatively,
+ you can achieve the same effect manually (e.g. in `preCheck`) with: `export HOME=$(mktemp -d)`.
* Compiling with Cython causes tests to fail with a `ModuleNotLoadedError`.
This can be fixed with two changes in the derivation: 1) replacing `pytest` with
`pytestCheckHook` and 2) adding a `preCheck` containing `cd $out` to run
diff --git a/doc/languages-frameworks/texlive.section.md b/doc/languages-frameworks/texlive.section.md
index 9256c9c38ce7..2a945827a487 100644
--- a/doc/languages-frameworks/texlive.section.md
+++ b/doc/languages-frameworks/texlive.section.md
@@ -173,6 +173,7 @@ let
(writeShellScript "force-tex-output.sh" ''
out="''${tex-}"
'')
+ writableTmpDirAsHomeHook # Need a writable $HOME for latexmk
];
dontConfigure = true;
@@ -184,7 +185,6 @@ let
latex foiltex.ins
# Generate the documentation
- export HOME=.
latexmk -pdf foiltex.dtx
runHook postBuild