tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
doc: Fix missing pre/post hooks everywhere
Niklas Hambüchen
11 months ago
ee6c2bd2
2795c506
+51
-4
10 changed files
expand all
collapse all
unified
split
doc
build-helpers
special
checkpoint-build.section.md
doc-support
lib-function-docs.nix
languages-frameworks
bower.section.md
emscripten.section.md
java.section.md
javascript.section.md
lisp.section.md
swift.section.md
packages
weechat.section.md
stdenv
stdenv.chapter.md
+4
doc/build-helpers/special/checkpoint-build.section.md
reviewed
···
38
38
changedHello = pkgs.hello.overrideAttrs (_: {
39
39
doCheck = false;
40
40
patchPhase = ''
41
41
+
runHook prePatch
42
42
+
41
43
sed -i 's/Hello, world!/Hello, Nix!/g' src/hello.c
44
44
+
45
45
+
runHook postPatch
42
46
'';
43
47
});
44
48
in
+4
doc/doc-support/lib-function-docs.nix
reviewed
···
102
102
];
103
103
104
104
installPhase = ''
105
105
+
runHook preInstall
106
106
+
105
107
cd ..
106
108
107
109
export NIX_STATE_DIR=$(mktemp -d)
···
143
145
) libsets}
144
146
145
147
echo '```' >> "$out/index.md"
148
148
+
149
149
+
runHook postInstall
146
150
'';
147
151
}
+7
-1
doc/languages-frameworks/bower.section.md
reviewed
···
118
118
runHook postBuild
119
119
'';
120
120
121
121
-
installPhase = "mv gulpdist $out";
121
121
+
installPhase = ''
122
122
+
runHook preInstall
123
123
+
124
124
+
mv gulpdist $out
125
125
+
126
126
+
runHook postInstall
127
127
+
'';
122
128
}
123
129
```
124
130
+1
doc/languages-frameworks/emscripten.section.md
reviewed
···
192
192
cp *.json $out/share
193
193
cp *.rng $out/share
194
194
cp README.md $doc/share/${name}
195
195
+
195
196
runHook postInstall
196
197
'';
197
198
+4
doc/languages-frameworks/java.section.md
reviewed
···
69
69
nativeBuildInputs = [ makeWrapper ];
70
70
71
71
installPhase = ''
72
72
+
runHook preInstall
73
73
+
72
74
mkdir -p $out/bin
73
75
makeWrapper ${jre}/bin/java $out/bin/foo \
74
76
--add-flags "-cp $out/share/java/foo.jar org.foo.Main"
77
77
+
78
78
+
runHook postInstall
75
79
'';
76
80
}
77
81
```
+8
doc/languages-frameworks/javascript.section.md
reviewed
···
690
690
```nix
691
691
{
692
692
configurePhase = ''
693
693
+
runHook preConfigure
694
694
+
693
695
ln -s $node_modules node_modules
696
696
+
697
697
+
runHook postConfigure
694
698
'';
695
699
}
696
700
```
···
700
704
```nix
701
705
{
702
706
configurePhase = ''
707
707
+
runHook preConfigure
708
708
+
703
709
cp -r $node_modules node_modules
704
710
chmod +w node_modules
711
711
+
712
712
+
runHook postConfigure
705
713
'';
706
714
}
707
715
```
+4
doc/languages-frameworks/lisp.section.md
reviewed
···
59
59
```nix
60
60
{
61
61
buildPhase = ''
62
62
+
runHook preBuild
63
63
+
62
64
${sbcl'}/bin/sbcl --load my-build-file.lisp
65
65
+
66
66
+
runHook postBuild
63
67
'';
64
68
}
65
69
```
+14
-2
doc/languages-frameworks/swift.section.md
reviewed
···
103
103
104
104
# The helper provides a configure snippet that will prepare all dependencies
105
105
# in the correct place, where SwiftPM expects them.
106
106
-
configurePhase = generated.configure;
106
106
+
configurePhase = ''
107
107
+
runHook preConfigure
108
108
+
109
109
+
${generated.configure}
110
110
+
111
111
+
runHook postConfigure
112
112
+
'';
107
113
108
114
installPhase = ''
109
115
runHook preInstall
···
168
174
169
175
```nix
170
176
{
171
171
-
configurePhase = generated.configure ++ ''
177
177
+
configurePhase = ''
178
178
+
runHook preConfigure
179
179
+
180
180
+
${generated.configure}
181
181
+
172
182
# Replace the dependency symlink with a writable copy.
173
183
swiftpmMakeMutable swift-crypto
174
184
# Now apply a patch.
175
185
patch -p1 -d .build/checkouts/swift-crypto -i ${./some-fix.patch}
186
186
+
187
187
+
runHook postConfigure
176
188
'';
177
189
}
178
190
```
+4
doc/packages/weechat.section.md
reviewed
···
113
113
"bar.lua"
114
114
];
115
115
installPhase = ''
116
116
+
runHook preInstall
117
117
+
116
118
mkdir $out/share
117
119
cp foo.py $out/share
118
120
cp bar.lua $out/share
121
121
+
122
122
+
runHook postInstall
119
123
'';
120
124
}
121
125
```
+1
-1
doc/stdenv/stdenv.chapter.md
reviewed
···
261
261
util-linux
262
262
qemu
263
263
];
264
264
-
checkPhase = ''[elided]'';
264
264
+
# `checkPhase` elided
265
265
})
266
266
```
267
267