doc: use `writableTmpDirAsHomeHook`

+4 -1
doc/languages-frameworks/bower.section.md
···
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
'';
+1 -1
doc/languages-frameworks/emscripten.section.md
···
];
nativeBuildInputs = [
pkg-config
+
writableTmpDirAsHomeHook
zlib
];
···
'';
buildPhase = ''
-
HOME=$TMPDIR
make -f Makefile.emEnv
'';
+4 -1
doc/languages-frameworks/javascript.section.md
···
```nix
{
+
nativeBuildInputs = [
+
writableTmpDirAsHomeHook
+
];
+
buildPhase = ''
-
export HOME=$(mktemp -d)
yarn --offline build
'';
}
+3 -2
doc/languages-frameworks/python.section.md
···
#### 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
+1 -1
doc/languages-frameworks/texlive.section.md
···
(writeShellScript "force-tex-output.sh" ''
out="''${tex-}"
'')
+
writableTmpDirAsHomeHook # Need a writable $HOME for latexmk
];
dontConfigure = true;
···
latex foiltex.ins
# Generate the documentation
-
export HOME=.
latexmk -pdf foiltex.dtx
runHook postBuild