Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/build-helpers/special/checkpoint-build.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ let
helloCheckpoint = prepareCheckpointBuild pkgs.hello;
changedHello = pkgs.hello.overrideAttrs (_: {
doCheck = false;
patchPhase = ''
postPatch = ''
sed -i 's/Hello, world!/Hello, Nix!/g' src/hello.c
'';
});
Expand Down
4 changes: 4 additions & 0 deletions doc/doc-support/lib-function-docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ stdenvNoCC.mkDerivation {
];

installPhase = ''
runHook preInstall

cd ..

export NIX_STATE_DIR=$(mktemp -d)
Expand Down Expand Up @@ -143,5 +145,7 @@ stdenvNoCC.mkDerivation {
) libsets}

echo '```' >> "$out/index.md"

runHook postInstall
'';
}
8 changes: 7 additions & 1 deletion doc/languages-frameworks/bower.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ pkgs.stdenv.mkDerivation {
runHook postBuild
'';

installPhase = "mv gulpdist $out";
installPhase = ''
runHook preInstall

mv gulpdist $out

runHook postInstall
'';
}
```

Expand Down
1 change: 1 addition & 0 deletions doc/languages-frameworks/emscripten.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ pkgs.buildEmscriptenPackage {
cp *.json $out/share
cp *.rng $out/share
cp README.md $doc/share/${name}

runHook postInstall
'';

Expand Down
4 changes: 4 additions & 0 deletions doc/languages-frameworks/java.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ script to run it using a JRE. You can use `makeWrapper` for this:
nativeBuildInputs = [ makeWrapper ];

installPhase = ''
runHook preInstall

mkdir -p $out/bin
makeWrapper ${jre}/bin/java $out/bin/foo \
--add-flags "-cp $out/share/java/foo.jar org.foo.Main"

runHook postInstall
'';
}
```
Expand Down
8 changes: 8 additions & 0 deletions doc/languages-frameworks/javascript.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,11 @@ The configure phase can sometimes fail because it makes many assumptions which m
```nix
{
configurePhase = ''
runHook preConfigure

ln -s $node_modules node_modules

runHook postConfigure
'';
}
```
Expand All @@ -700,8 +704,12 @@ or if you need a writeable node_modules directory:
```nix
{
configurePhase = ''
runHook preConfigure

cp -r $node_modules node_modules
chmod +w node_modules

runHook postConfigure
'';
}
```
Expand Down
4 changes: 4 additions & 0 deletions doc/languages-frameworks/lisp.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ Such a Lisp can be now used e.g. to compile your sources:
```nix
{
buildPhase = ''
runHook preBuild

${sbcl'}/bin/sbcl --load my-build-file.lisp

runHook postBuild
'';
}
```
Expand Down
16 changes: 14 additions & 2 deletions doc/languages-frameworks/swift.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ stdenv.mkDerivation (finalAttrs: {

# The helper provides a configure snippet that will prepare all dependencies
# in the correct place, where SwiftPM expects them.
configurePhase = generated.configure;
configurePhase = ''
runHook preConfigure

${generated.configure}

runHook postConfigure
'';

installPhase = ''
runHook preInstall
Expand Down Expand Up @@ -168,11 +174,17 @@ with a writable copy:

```nix
{
configurePhase = generated.configure ++ ''
configurePhase = ''
runHook preConfigure

${generated.configure}

# Replace the dependency symlink with a writable copy.
swiftpmMakeMutable swift-crypto
# Now apply a patch.
patch -p1 -d .build/checkouts/swift-crypto -i ${./some-fix.patch}

runHook postConfigure
'';
}
```
Expand Down
4 changes: 4 additions & 0 deletions doc/packages/weechat.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,13 @@ stdenv.mkDerivation {
"bar.lua"
];
installPhase = ''
runHook preInstall

mkdir $out/share
cp foo.py $out/share
cp bar.lua $out/share

runHook postInstall
'';
}
```
2 changes: 1 addition & 1 deletion doc/stdenv/stdenv.chapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ stdenv.mkDerivation (finalAttrs: {
util-linux
qemu
];
checkPhase = ''[elided]'';
# `checkPhase` elided
})
```

Expand Down
Loading