joplin-plugin-inline-todo 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1871 @@
1
+ unset shellHook
2
+ PATH=${PATH:-}
3
+ nix_saved_PATH="$PATH"
4
+ XDG_DATA_DIRS=${XDG_DATA_DIRS:-}
5
+ nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS"
6
+ AR='ar'
7
+ export AR
8
+ AS='as'
9
+ export AS
10
+ BASH='/nix/store/r9h133c9m8f6jnlsqzwf89zg9w0w78s8-bash-5.2-p15/bin/bash'
11
+ CC='gcc'
12
+ export CC
13
+ CONFIG_SHELL='/nix/store/r9h133c9m8f6jnlsqzwf89zg9w0w78s8-bash-5.2-p15/bin/bash'
14
+ export CONFIG_SHELL
15
+ CXX='g++'
16
+ export CXX
17
+ HOSTTYPE='x86_64'
18
+ HOST_PATH='/nix/store/wnbxah2y943l73hdmq5r7lb92lsa5f8z-nodejs-18.19.1/bin:/nix/store/y6qmvzv799sfrrcllpdsbsxxlx6lxrwd-webpack-5.89.0/bin:/nix/store/2lrishrbb8y6ghr9rqndaxmfpwr125y1-webpack-cli-5.1.4/bin:/nix/store/rk067yylvhyb7a360n8k1ps4lb4xsbl3-coreutils-9.3/bin:/nix/store/q7x6rjg6ya1gsg068fxj1sgf1k2n144n-findutils-4.9.0/bin:/nix/store/r9jlsp2szh2c1ns2milpc0qynqq28hq8-diffutils-3.10/bin:/nix/store/29w8hg0fis0pl3j4d3v0p02aicyw10lv-gnused-4.9/bin:/nix/store/r1lp9kxlrc6h7vrba90gm6i94s31xvvx-gnugrep-3.11/bin:/nix/store/r9w7hwj3ahip499dlr3zzk6601x2v9kf-gawk-5.2.2/bin:/nix/store/0ybz4c399fq3wiqc1ni0yylcxhs1x1hc-gnutar-1.35/bin:/nix/store/hcrf95x3r60kw71wgwbdybjfcq0ipkpj-gzip-1.13/bin:/nix/store/gfs0a87fzs9msav9ckdnciw3fappzgg2-bzip2-1.0.8-bin/bin:/nix/store/5vyb54sgl2x1ihrdfvj46vi2w1acv9nn-gnumake-4.4.1/bin:/nix/store/r9h133c9m8f6jnlsqzwf89zg9w0w78s8-bash-5.2-p15/bin:/nix/store/dp0pd2rljai6jlp7jb254vmbmyzik4nc-patch-2.7.6/bin:/nix/store/gvdfpnyr6smc7g9wy9fjp44j41j73f4b-xz-5.4.4-bin/bin:/nix/store/g0kc0z0wzs2s4kl377zssyxmmk5z9vim-file-5.45/bin'
19
+ export HOST_PATH
20
+ IFS='
21
+ '
22
+ IN_NIX_SHELL='impure'
23
+ export IN_NIX_SHELL
24
+ LD='ld'
25
+ export LD
26
+ LINENO='76'
27
+ MACHTYPE='x86_64-pc-linux-gnu'
28
+ NIX_BINTOOLS='/nix/store/0fp4c5pbk6lmlk59bv4hhxch3py2dq6h-binutils-wrapper-2.40'
29
+ export NIX_BINTOOLS
30
+ NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1'
31
+ export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
32
+ NIX_BUILD_CORES='16'
33
+ export NIX_BUILD_CORES
34
+ NIX_CC='/nix/store/ihhhd1r1a2wb4ndm24rnm83rfnjw5n0z-gcc-wrapper-12.3.0'
35
+ export NIX_CC
36
+ NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1'
37
+ export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
38
+ NIX_CFLAGS_COMPILE=' -frandom-seed=h87aicg9ws -isystem /nix/store/wnbxah2y943l73hdmq5r7lb92lsa5f8z-nodejs-18.19.1/include -isystem /nix/store/wnbxah2y943l73hdmq5r7lb92lsa5f8z-nodejs-18.19.1/include'
39
+ export NIX_CFLAGS_COMPILE
40
+ NIX_ENFORCE_NO_NATIVE='1'
41
+ export NIX_ENFORCE_NO_NATIVE
42
+ NIX_HARDENING_ENABLE='fortify fortify3 stackprotector pic strictoverflow format relro bindnow'
43
+ export NIX_HARDENING_ENABLE
44
+ NIX_LDFLAGS='-rpath /home/caleb/programming/joplin-inline-todo/outputs/out/lib '
45
+ export NIX_LDFLAGS
46
+ NIX_NO_SELF_RPATH='1'
47
+ NIX_STORE='/nix/store'
48
+ export NIX_STORE
49
+ NM='nm'
50
+ export NM
51
+ NODE_OPTIONS='--openssl-legacy-provider'
52
+ export NODE_OPTIONS
53
+ NODE_PATH='/nix/store/wnbxah2y943l73hdmq5r7lb92lsa5f8z-nodejs-18.19.1/lib/node_modules:/nix/store/y6qmvzv799sfrrcllpdsbsxxlx6lxrwd-webpack-5.89.0/lib/node_modules:/nix/store/2lrishrbb8y6ghr9rqndaxmfpwr125y1-webpack-cli-5.1.4/lib/node_modules'
54
+ export NODE_PATH
55
+ OBJCOPY='objcopy'
56
+ export OBJCOPY
57
+ OBJDUMP='objdump'
58
+ export OBJDUMP
59
+ OLDPWD=''
60
+ export OLDPWD
61
+ OPTERR='1'
62
+ OSTYPE='linux-gnu'
63
+ PATH='/nix/store/7ywggws38m4788rm8fvbcsmyddnq0q3m-patchelf-0.15.0/bin:/nix/store/ihhhd1r1a2wb4ndm24rnm83rfnjw5n0z-gcc-wrapper-12.3.0/bin:/nix/store/fdiknsmnnczx6brsbppyljcs9hqckawk-gcc-12.3.0/bin:/nix/store/vzkw8fka84r02bawr1c7jhw0j1lhzq85-glibc-2.38-44-bin/bin:/nix/store/rk067yylvhyb7a360n8k1ps4lb4xsbl3-coreutils-9.3/bin:/nix/store/0fp4c5pbk6lmlk59bv4hhxch3py2dq6h-binutils-wrapper-2.40/bin:/nix/store/3z013mdl9cvpgvavpj19rbilihz4clvi-binutils-2.40/bin:/nix/store/wnbxah2y943l73hdmq5r7lb92lsa5f8z-nodejs-18.19.1/bin:/nix/store/y6qmvzv799sfrrcllpdsbsxxlx6lxrwd-webpack-5.89.0/bin:/nix/store/2lrishrbb8y6ghr9rqndaxmfpwr125y1-webpack-cli-5.1.4/bin:/nix/store/rk067yylvhyb7a360n8k1ps4lb4xsbl3-coreutils-9.3/bin:/nix/store/q7x6rjg6ya1gsg068fxj1sgf1k2n144n-findutils-4.9.0/bin:/nix/store/r9jlsp2szh2c1ns2milpc0qynqq28hq8-diffutils-3.10/bin:/nix/store/29w8hg0fis0pl3j4d3v0p02aicyw10lv-gnused-4.9/bin:/nix/store/r1lp9kxlrc6h7vrba90gm6i94s31xvvx-gnugrep-3.11/bin:/nix/store/r9w7hwj3ahip499dlr3zzk6601x2v9kf-gawk-5.2.2/bin:/nix/store/0ybz4c399fq3wiqc1ni0yylcxhs1x1hc-gnutar-1.35/bin:/nix/store/hcrf95x3r60kw71wgwbdybjfcq0ipkpj-gzip-1.13/bin:/nix/store/gfs0a87fzs9msav9ckdnciw3fappzgg2-bzip2-1.0.8-bin/bin:/nix/store/5vyb54sgl2x1ihrdfvj46vi2w1acv9nn-gnumake-4.4.1/bin:/nix/store/r9h133c9m8f6jnlsqzwf89zg9w0w78s8-bash-5.2-p15/bin:/nix/store/dp0pd2rljai6jlp7jb254vmbmyzik4nc-patch-2.7.6/bin:/nix/store/gvdfpnyr6smc7g9wy9fjp44j41j73f4b-xz-5.4.4-bin/bin:/nix/store/g0kc0z0wzs2s4kl377zssyxmmk5z9vim-file-5.45/bin'
64
+ export PATH
65
+ PS4='+ '
66
+ RANLIB='ranlib'
67
+ export RANLIB
68
+ READELF='readelf'
69
+ export READELF
70
+ SIZE='size'
71
+ export SIZE
72
+ SOURCE_DATE_EPOCH='315532800'
73
+ export SOURCE_DATE_EPOCH
74
+ STRINGS='strings'
75
+ export STRINGS
76
+ STRIP='strip'
77
+ export STRIP
78
+ XDG_DATA_DIRS='/nix/store/7ywggws38m4788rm8fvbcsmyddnq0q3m-patchelf-0.15.0/share'
79
+ export XDG_DATA_DIRS
80
+ __structuredAttrs=''
81
+ export __structuredAttrs
82
+ buildInputs='/nix/store/wnbxah2y943l73hdmq5r7lb92lsa5f8z-nodejs-18.19.1 /nix/store/y6qmvzv799sfrrcllpdsbsxxlx6lxrwd-webpack-5.89.0 /nix/store/2lrishrbb8y6ghr9rqndaxmfpwr125y1-webpack-cli-5.1.4'
83
+ export buildInputs
84
+ buildPhase='{ echo "------------------------------------------------------------";
85
+ echo " WARNING: the existence of this path is not guaranteed.";
86
+ echo " It is an internal implementation detail for pkgs.mkShell.";
87
+ echo "------------------------------------------------------------";
88
+ echo;
89
+ # Record all build inputs as runtime dependencies
90
+ export;
91
+ } >> "$out"
92
+ '
93
+ export buildPhase
94
+ builder='/nix/store/r9h133c9m8f6jnlsqzwf89zg9w0w78s8-bash-5.2-p15/bin/bash'
95
+ export builder
96
+ cmakeFlags=''
97
+ export cmakeFlags
98
+ configureFlags=''
99
+ export configureFlags
100
+ defaultBuildInputs=''
101
+ defaultNativeBuildInputs='/nix/store/7ywggws38m4788rm8fvbcsmyddnq0q3m-patchelf-0.15.0 /nix/store/lfldnv3apxsd59g1jl65kw6xfkmv5w27-update-autotools-gnu-config-scripts-hook /nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh /nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh /nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh /nix/store/wzdsbnv2ba3nj91aql8jjdddfmkkdh7h-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh /nix/store/wmknncrif06fqxa16hpdldhixk95nds0-strip.sh /nix/store/ihhhd1r1a2wb4ndm24rnm83rfnjw5n0z-gcc-wrapper-12.3.0'
102
+ depsBuildBuild=''
103
+ export depsBuildBuild
104
+ depsBuildBuildPropagated=''
105
+ export depsBuildBuildPropagated
106
+ depsBuildTarget=''
107
+ export depsBuildTarget
108
+ depsBuildTargetPropagated=''
109
+ export depsBuildTargetPropagated
110
+ depsHostHost=''
111
+ export depsHostHost
112
+ depsHostHostPropagated=''
113
+ export depsHostHostPropagated
114
+ depsTargetTarget=''
115
+ export depsTargetTarget
116
+ depsTargetTargetPropagated=''
117
+ export depsTargetTargetPropagated
118
+ doCheck=''
119
+ export doCheck
120
+ doInstallCheck=''
121
+ export doInstallCheck
122
+ dontAddDisableDepTrack='1'
123
+ export dontAddDisableDepTrack
124
+ declare -a envBuildBuildHooks=()
125
+ declare -a envBuildHostHooks=()
126
+ declare -a envBuildTargetHooks=()
127
+ declare -a envHostHostHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' 'addNodePath' )
128
+ declare -a envHostTargetHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' 'addNodePath' )
129
+ declare -a envTargetTargetHooks=()
130
+ declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' )
131
+ guess='16'
132
+ initialPath='/nix/store/rk067yylvhyb7a360n8k1ps4lb4xsbl3-coreutils-9.3 /nix/store/q7x6rjg6ya1gsg068fxj1sgf1k2n144n-findutils-4.9.0 /nix/store/r9jlsp2szh2c1ns2milpc0qynqq28hq8-diffutils-3.10 /nix/store/29w8hg0fis0pl3j4d3v0p02aicyw10lv-gnused-4.9 /nix/store/r1lp9kxlrc6h7vrba90gm6i94s31xvvx-gnugrep-3.11 /nix/store/r9w7hwj3ahip499dlr3zzk6601x2v9kf-gawk-5.2.2 /nix/store/0ybz4c399fq3wiqc1ni0yylcxhs1x1hc-gnutar-1.35 /nix/store/hcrf95x3r60kw71wgwbdybjfcq0ipkpj-gzip-1.13 /nix/store/gfs0a87fzs9msav9ckdnciw3fappzgg2-bzip2-1.0.8-bin /nix/store/5vyb54sgl2x1ihrdfvj46vi2w1acv9nn-gnumake-4.4.1 /nix/store/r9h133c9m8f6jnlsqzwf89zg9w0w78s8-bash-5.2-p15 /nix/store/dp0pd2rljai6jlp7jb254vmbmyzik4nc-patch-2.7.6 /nix/store/gvdfpnyr6smc7g9wy9fjp44j41j73f4b-xz-5.4.4-bin /nix/store/g0kc0z0wzs2s4kl377zssyxmmk5z9vim-file-5.45'
133
+ mesonFlags=''
134
+ export mesonFlags
135
+ name='nodejs-env'
136
+ export name
137
+ nativeBuildInputs=''
138
+ export nativeBuildInputs
139
+ out='/home/caleb/programming/joplin-inline-todo/outputs/out'
140
+ export out
141
+ outputBin='out'
142
+ outputDev='out'
143
+ outputDevdoc='REMOVE'
144
+ outputDevman='out'
145
+ outputDoc='out'
146
+ outputInclude='out'
147
+ outputInfo='out'
148
+ outputLib='out'
149
+ outputMan='out'
150
+ outputs='out'
151
+ export outputs
152
+ patches=''
153
+ export patches
154
+ phases='buildPhase'
155
+ export phases
156
+ pkg='/nix/store/ihhhd1r1a2wb4ndm24rnm83rfnjw5n0z-gcc-wrapper-12.3.0'
157
+ declare -a pkgsBuildBuild=()
158
+ declare -a pkgsBuildHost=('/nix/store/7ywggws38m4788rm8fvbcsmyddnq0q3m-patchelf-0.15.0' '/nix/store/lfldnv3apxsd59g1jl65kw6xfkmv5w27-update-autotools-gnu-config-scripts-hook' '/nix/store/h9lc1dpi14z7is86ffhl3ld569138595-audit-tmpdir.sh' '/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh' '/nix/store/wgrbkkaldkrlrni33ccvm3b6vbxzb656-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/jivxp510zxakaaic7qkrb7v1dd2rdbw9-multiple-outputs.sh' '/nix/store/wzdsbnv2ba3nj91aql8jjdddfmkkdh7h-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh' '/nix/store/wmknncrif06fqxa16hpdldhixk95nds0-strip.sh' '/nix/store/ihhhd1r1a2wb4ndm24rnm83rfnjw5n0z-gcc-wrapper-12.3.0' '/nix/store/0fp4c5pbk6lmlk59bv4hhxch3py2dq6h-binutils-wrapper-2.40' )
159
+ declare -a pkgsBuildTarget=()
160
+ declare -a pkgsHostHost=()
161
+ declare -a pkgsHostTarget=('/nix/store/wnbxah2y943l73hdmq5r7lb92lsa5f8z-nodejs-18.19.1' '/nix/store/y6qmvzv799sfrrcllpdsbsxxlx6lxrwd-webpack-5.89.0' '/nix/store/2lrishrbb8y6ghr9rqndaxmfpwr125y1-webpack-cli-5.1.4' )
162
+ declare -a pkgsTargetTarget=()
163
+ declare -a postFixupHooks=('_makeSymlinksRelativeInAllOutputs' '_multioutPropagateDev' )
164
+ declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' )
165
+ declare -a preConfigureHooks=('_multioutConfig' )
166
+ preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase'
167
+ declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' )
168
+ preferLocalBuild='1'
169
+ export preferLocalBuild
170
+ prefix='/home/caleb/programming/joplin-inline-todo/outputs/out'
171
+ declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' )
172
+ propagatedBuildInputs=''
173
+ export propagatedBuildInputs
174
+ declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' )
175
+ propagatedNativeBuildInputs=''
176
+ export propagatedNativeBuildInputs
177
+ declare -a propagatedTargetDepFiles=('propagated-target-target-deps' )
178
+ shell='/nix/store/r9h133c9m8f6jnlsqzwf89zg9w0w78s8-bash-5.2-p15/bin/bash'
179
+ export shell
180
+ shellHook=''
181
+ export shellHook
182
+ stdenv='/nix/store/10i1kjjq5szjn1gp6418x8bc1hswqc90-stdenv-linux'
183
+ export stdenv
184
+ strictDeps=''
185
+ export strictDeps
186
+ system='x86_64-linux'
187
+ export system
188
+ declare -a unpackCmdHooks=('_defaultUnpack' )
189
+ _accumFlagsArray ()
190
+ {
191
+
192
+ local name;
193
+ if [ -n "$__structuredAttrs" ]; then
194
+ for name in "$@";
195
+ do
196
+ local -n nameref="$name";
197
+ flagsArray+=(${nameref+"${nameref[@]}"});
198
+ done;
199
+ else
200
+ for name in "$@";
201
+ do
202
+ local -n nameref="$name";
203
+ case "$name" in
204
+ *Array)
205
+ flagsArray+=(${nameref+"${nameref[@]}"})
206
+ ;;
207
+ *)
208
+ flagsArray+=(${nameref-})
209
+ ;;
210
+ esac;
211
+ done;
212
+ fi
213
+ }
214
+ _activatePkgs ()
215
+ {
216
+
217
+ local hostOffset targetOffset;
218
+ local pkg;
219
+ for hostOffset in "${allPlatOffsets[@]}";
220
+ do
221
+ local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}";
222
+ for targetOffset in "${allPlatOffsets[@]}";
223
+ do
224
+ (( hostOffset <= targetOffset )) || continue;
225
+ local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]";
226
+ local pkgsSlice="${!pkgsRef}[@]";
227
+ for pkg in ${!pkgsSlice+"${!pkgsSlice}"};
228
+ do
229
+ activatePackage "$pkg" "$hostOffset" "$targetOffset";
230
+ done;
231
+ done;
232
+ done
233
+ }
234
+ _addRpathPrefix ()
235
+ {
236
+
237
+ if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then
238
+ export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}";
239
+ fi
240
+ }
241
+ _addToEnv ()
242
+ {
243
+
244
+ local depHostOffset depTargetOffset;
245
+ local pkg;
246
+ for depHostOffset in "${allPlatOffsets[@]}";
247
+ do
248
+ local hookVar="${pkgHookVarVars[depHostOffset + 1]}";
249
+ local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}";
250
+ for depTargetOffset in "${allPlatOffsets[@]}";
251
+ do
252
+ (( depHostOffset <= depTargetOffset )) || continue;
253
+ local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]";
254
+ if [[ -z "${strictDeps-}" ]]; then
255
+ local visitedPkgs="";
256
+ for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}";
257
+ do
258
+ if [[ "$visitedPkgs" = *"$pkg"* ]]; then
259
+ continue;
260
+ fi;
261
+ runHook "${!hookRef}" "$pkg";
262
+ visitedPkgs+=" $pkg";
263
+ done;
264
+ else
265
+ local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]";
266
+ local pkgsSlice="${!pkgsRef}[@]";
267
+ for pkg in ${!pkgsSlice+"${!pkgsSlice}"};
268
+ do
269
+ runHook "${!hookRef}" "$pkg";
270
+ done;
271
+ fi;
272
+ done;
273
+ done
274
+ }
275
+ _allFlags ()
276
+ {
277
+
278
+ export system pname name version;
279
+ for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }');
280
+ do
281
+ if (( "${NIX_DEBUG:-0}" >= 1 )); then
282
+ printf "@%s@ -> %q\n" "${varName}" "${!varName}" 1>&2;
283
+ fi;
284
+ args+=("--subst-var" "$varName");
285
+ done
286
+ }
287
+ _assignFirst ()
288
+ {
289
+
290
+ local varName="$1";
291
+ local _var;
292
+ local REMOVE=REMOVE;
293
+ shift;
294
+ for _var in "$@";
295
+ do
296
+ if [ -n "${!_var-}" ]; then
297
+ eval "${varName}"="${_var}";
298
+ return;
299
+ fi;
300
+ done;
301
+ echo;
302
+ echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}.";
303
+ echo " The following variables were all unset or empty:";
304
+ echo " $*";
305
+ if [ -z "${out:-}" ]; then
306
+ echo ' If you do not want an "out" output in your derivation, make sure to define';
307
+ echo ' the other specific required outputs. This can be achieved by picking one';
308
+ echo " of the above as an output.";
309
+ echo ' You do not have to remove "out" if you want to have a different default';
310
+ echo ' output, because the first output is taken as a default.';
311
+ echo;
312
+ fi;
313
+ return 1
314
+ }
315
+ _callImplicitHook ()
316
+ {
317
+
318
+ local def="$1";
319
+ local hookName="$2";
320
+ if declare -F "$hookName" > /dev/null; then
321
+ "$hookName";
322
+ else
323
+ if type -p "$hookName" > /dev/null; then
324
+ source "$hookName";
325
+ else
326
+ if [ -n "${!hookName:-}" ]; then
327
+ eval "${!hookName}";
328
+ else
329
+ return "$def";
330
+ fi;
331
+ fi;
332
+ fi
333
+ }
334
+ _defaultUnpack ()
335
+ {
336
+
337
+ local fn="$1";
338
+ local destination;
339
+ if [ -d "$fn" ]; then
340
+ destination="$(stripHash "$fn")";
341
+ if [ -e "$destination" ]; then
342
+ echo "Cannot copy $fn to $destination: destination already exists!";
343
+ echo "Did you specify two \"srcs\" with the same \"name\"?";
344
+ return 1;
345
+ fi;
346
+ cp -pr --reflink=auto -- "$fn" "$destination";
347
+ else
348
+ case "$fn" in
349
+ *.tar.xz | *.tar.lzma | *.txz)
350
+ ( xz -d < "$fn";
351
+ true ) | tar xf - --warning=no-timestamp
352
+ ;;
353
+ *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz)
354
+ tar xf "$fn" --warning=no-timestamp
355
+ ;;
356
+ *)
357
+ return 1
358
+ ;;
359
+ esac;
360
+ fi
361
+ }
362
+ _doStrip ()
363
+ {
364
+
365
+ local -ra flags=(dontStripHost dontStripTarget);
366
+ local -ra debugDirs=(stripDebugList stripDebugListTarget);
367
+ local -ra allDirs=(stripAllList stripAllListTarget);
368
+ local -ra stripCmds=(STRIP STRIP_FOR_TARGET);
369
+ local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET);
370
+ stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin};
371
+ stripDebugListTarget=${stripDebugListTarget[*]:-};
372
+ stripAllList=${stripAllList[*]:-};
373
+ stripAllListTarget=${stripAllListTarget[*]:-};
374
+ local i;
375
+ for i in ${!stripCmds[@]};
376
+ do
377
+ local -n flag="${flags[$i]}";
378
+ local -n debugDirList="${debugDirs[$i]}";
379
+ local -n allDirList="${allDirs[$i]}";
380
+ local -n stripCmd="${stripCmds[$i]}";
381
+ local -n ranlibCmd="${ranlibCmds[$i]}";
382
+ if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then
383
+ continue;
384
+ fi;
385
+ stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}";
386
+ stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}";
387
+ done
388
+ }
389
+ _eval ()
390
+ {
391
+
392
+ if declare -F "$1" > /dev/null 2>&1; then
393
+ "$@";
394
+ else
395
+ eval "$1";
396
+ fi
397
+ }
398
+ _makeSymlinksRelative ()
399
+ {
400
+
401
+ local symlinkTarget;
402
+ if [ "${dontRewriteSymlinks-}" ] || [ ! -e "$prefix" ]; then
403
+ return;
404
+ fi;
405
+ while IFS= read -r -d '' f; do
406
+ symlinkTarget=$(readlink "$f");
407
+ if [[ "$symlinkTarget"/ != "$prefix"/* ]]; then
408
+ continue;
409
+ fi;
410
+ if [ ! -e "$symlinkTarget" ]; then
411
+ echo "the symlink $f is broken, it points to $symlinkTarget (which is missing)";
412
+ fi;
413
+ echo "rewriting symlink $f to be relative to $prefix";
414
+ ln -snrf "$symlinkTarget" "$f";
415
+ done < <(find $prefix -type l -print0)
416
+ }
417
+ _makeSymlinksRelativeInAllOutputs ()
418
+ {
419
+
420
+ local output;
421
+ for output in $(getAllOutputNames);
422
+ do
423
+ prefix="${!output}" _makeSymlinksRelative;
424
+ done
425
+ }
426
+ _moveLib64 ()
427
+ {
428
+
429
+ if [ "${dontMoveLib64-}" = 1 ]; then
430
+ return;
431
+ fi;
432
+ if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then
433
+ return;
434
+ fi;
435
+ echo "moving $prefix/lib64/* to $prefix/lib";
436
+ mkdir -p $prefix/lib;
437
+ shopt -s dotglob;
438
+ for i in $prefix/lib64/*;
439
+ do
440
+ mv --no-clobber "$i" $prefix/lib;
441
+ done;
442
+ shopt -u dotglob;
443
+ rmdir $prefix/lib64;
444
+ ln -s lib $prefix/lib64
445
+ }
446
+ _moveSbin ()
447
+ {
448
+
449
+ if [ "${dontMoveSbin-}" = 1 ]; then
450
+ return;
451
+ fi;
452
+ if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then
453
+ return;
454
+ fi;
455
+ echo "moving $prefix/sbin/* to $prefix/bin";
456
+ mkdir -p $prefix/bin;
457
+ shopt -s dotglob;
458
+ for i in $prefix/sbin/*;
459
+ do
460
+ mv "$i" $prefix/bin;
461
+ done;
462
+ shopt -u dotglob;
463
+ rmdir $prefix/sbin;
464
+ ln -s bin $prefix/sbin
465
+ }
466
+ _moveSystemdUserUnits ()
467
+ {
468
+
469
+ if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then
470
+ return;
471
+ fi;
472
+ if [ ! -e "${prefix:?}/lib/systemd/user" ]; then
473
+ return;
474
+ fi;
475
+ local source="$prefix/lib/systemd/user";
476
+ local target="$prefix/share/systemd/user";
477
+ echo "moving $source/* to $target";
478
+ mkdir -p "$target";
479
+ ( shopt -s dotglob;
480
+ for i in "$source"/*;
481
+ do
482
+ mv "$i" "$target";
483
+ done );
484
+ rmdir "$source";
485
+ ln -s "$target" "$source"
486
+ }
487
+ _moveToShare ()
488
+ {
489
+
490
+ if [ -n "$__structuredAttrs" ]; then
491
+ if [ -z "${forceShare-}" ]; then
492
+ forceShare=(man doc info);
493
+ fi;
494
+ else
495
+ forceShare=(${forceShare:-man doc info});
496
+ fi;
497
+ if [[ -z "$out" ]]; then
498
+ return;
499
+ fi;
500
+ for d in "${forceShare[@]}";
501
+ do
502
+ if [ -d "$out/$d" ]; then
503
+ if [ -d "$out/share/$d" ]; then
504
+ echo "both $d/ and share/$d/ exist!";
505
+ else
506
+ echo "moving $out/$d to $out/share/$d";
507
+ mkdir -p $out/share;
508
+ mv $out/$d $out/share/;
509
+ fi;
510
+ fi;
511
+ done
512
+ }
513
+ _multioutConfig ()
514
+ {
515
+
516
+ if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then
517
+ return;
518
+ fi;
519
+ if [ -z "${shareDocName:-}" ]; then
520
+ local confScript="${configureScript:-}";
521
+ if [ -z "$confScript" ] && [ -x ./configure ]; then
522
+ confScript=./configure;
523
+ fi;
524
+ if [ -f "$confScript" ]; then
525
+ local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")";
526
+ fi;
527
+ if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then
528
+ shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')";
529
+ fi;
530
+ fi;
531
+ prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --oldincludedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale;
532
+ prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal
533
+ }
534
+ _multioutDevs ()
535
+ {
536
+
537
+ if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then
538
+ return;
539
+ fi;
540
+ moveToOutput include "${!outputInclude}";
541
+ moveToOutput lib/pkgconfig "${!outputDev}";
542
+ moveToOutput share/pkgconfig "${!outputDev}";
543
+ moveToOutput lib/cmake "${!outputDev}";
544
+ moveToOutput share/aclocal "${!outputDev}";
545
+ for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc;
546
+ do
547
+ echo "Patching '$f' includedir to output ${!outputInclude}";
548
+ sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f";
549
+ done
550
+ }
551
+ _multioutDocs ()
552
+ {
553
+
554
+ local REMOVE=REMOVE;
555
+ moveToOutput share/info "${!outputInfo}";
556
+ moveToOutput share/doc "${!outputDoc}";
557
+ moveToOutput share/gtk-doc "${!outputDevdoc}";
558
+ moveToOutput share/devhelp/books "${!outputDevdoc}";
559
+ moveToOutput share/man "${!outputMan}";
560
+ moveToOutput share/man/man3 "${!outputDevman}"
561
+ }
562
+ _multioutPropagateDev ()
563
+ {
564
+
565
+ if [ "$(getAllOutputNames)" = "out" ]; then
566
+ return;
567
+ fi;
568
+ local outputFirst;
569
+ for outputFirst in $(getAllOutputNames);
570
+ do
571
+ break;
572
+ done;
573
+ local propagaterOutput="$outputDev";
574
+ if [ -z "$propagaterOutput" ]; then
575
+ propagaterOutput="$outputFirst";
576
+ fi;
577
+ if [ -z "${propagatedBuildOutputs+1}" ]; then
578
+ local po_dirty="$outputBin $outputInclude $outputLib";
579
+ set +o pipefail;
580
+ propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `;
581
+ set -o pipefail;
582
+ fi;
583
+ if [ -z "$propagatedBuildOutputs" ]; then
584
+ return;
585
+ fi;
586
+ mkdir -p "${!propagaterOutput}"/nix-support;
587
+ for output in $propagatedBuildOutputs;
588
+ do
589
+ echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs;
590
+ done
591
+ }
592
+ _overrideFirst ()
593
+ {
594
+
595
+ if [ -z "${!1-}" ]; then
596
+ _assignFirst "$@";
597
+ fi
598
+ }
599
+ _pruneLibtoolFiles ()
600
+ {
601
+
602
+ if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then
603
+ return;
604
+ fi;
605
+ find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \;
606
+ }
607
+ _updateSourceDateEpochFromSourceRoot ()
608
+ {
609
+
610
+ if [ -n "$sourceRoot" ]; then
611
+ updateSourceDateEpoch "$sourceRoot";
612
+ fi
613
+ }
614
+ activatePackage ()
615
+ {
616
+
617
+ local pkg="$1";
618
+ local -r hostOffset="$2";
619
+ local -r targetOffset="$3";
620
+ (( hostOffset <= targetOffset )) || exit 1;
621
+ if [ -f "$pkg" ]; then
622
+ source "$pkg";
623
+ fi;
624
+ if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then
625
+ addToSearchPath _PATH "$pkg/bin";
626
+ fi;
627
+ if (( hostOffset <= -1 )); then
628
+ addToSearchPath _XDG_DATA_DIRS "$pkg/share";
629
+ fi;
630
+ if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then
631
+ addToSearchPath _HOST_PATH "$pkg/bin";
632
+ fi;
633
+ if [[ -f "$pkg/nix-support/setup-hook" ]]; then
634
+ source "$pkg/nix-support/setup-hook";
635
+ fi
636
+ }
637
+ addEnvHooks ()
638
+ {
639
+
640
+ local depHostOffset="$1";
641
+ shift;
642
+ local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]";
643
+ local pkgHookVar;
644
+ for pkgHookVar in "${!pkgHookVarsSlice}";
645
+ do
646
+ eval "${pkgHookVar}s"'+=("$@")';
647
+ done
648
+ }
649
+ addNodePath ()
650
+ {
651
+
652
+ addToSearchPath NODE_PATH "$1/lib/node_modules"
653
+ }
654
+ addToSearchPath ()
655
+ {
656
+
657
+ addToSearchPathWithCustomDelimiter ":" "$@"
658
+ }
659
+ addToSearchPathWithCustomDelimiter ()
660
+ {
661
+
662
+ local delimiter="$1";
663
+ local varName="$2";
664
+ local dir="$3";
665
+ if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then
666
+ export "${varName}=${!varName:+${!varName}${delimiter}}${dir}";
667
+ fi
668
+ }
669
+ appendToVar ()
670
+ {
671
+
672
+ local -n nameref="$1";
673
+ local useArray type;
674
+ if [ -n "$__structuredAttrs" ]; then
675
+ useArray=true;
676
+ else
677
+ useArray=false;
678
+ fi;
679
+ if declare -p "$1" 2> /dev/null | grep -q '^'; then
680
+ type="$(declare -p "$1")";
681
+ if [[ "$type" =~ "declare -A" ]]; then
682
+ echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2;
683
+ return 1;
684
+ else
685
+ if [[ "$type" =~ "declare -a" ]]; then
686
+ useArray=true;
687
+ else
688
+ useArray=false;
689
+ fi;
690
+ fi;
691
+ fi;
692
+ shift;
693
+ if $useArray; then
694
+ nameref=(${nameref+"${nameref[@]}"} "$@");
695
+ else
696
+ nameref="${nameref-} $*";
697
+ fi
698
+ }
699
+ auditTmpdir ()
700
+ {
701
+
702
+ local dir="$1";
703
+ [ -e "$dir" ] || return 0;
704
+ echo "checking for references to $TMPDIR/ in $dir...";
705
+ local i;
706
+ find "$dir" -type f -print0 | while IFS= read -r -d '' i; do
707
+ if [[ "$i" =~ .build-id ]]; then
708
+ continue;
709
+ fi;
710
+ if isELF "$i"; then
711
+ if {
712
+ printf :;
713
+ patchelf --print-rpath "$i"
714
+ } | grep -q -F ":$TMPDIR/"; then
715
+ echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/";
716
+ exit 1;
717
+ fi;
718
+ fi;
719
+ if isScript "$i"; then
720
+ if [ -e "$(dirname "$i")/.$(basename "$i")-wrapped" ]; then
721
+ if grep -q -F "$TMPDIR/" "$i"; then
722
+ echo "wrapper script $i contains a forbidden reference to $TMPDIR/";
723
+ exit 1;
724
+ fi;
725
+ fi;
726
+ fi;
727
+ done
728
+ }
729
+ bintoolsWrapper_addLDVars ()
730
+ {
731
+
732
+ local role_post;
733
+ getHostRoleEnvHook;
734
+ if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then
735
+ export NIX_LDFLAGS${role_post}+=" -L$1/lib64";
736
+ fi;
737
+ if [[ -d "$1/lib" ]]; then
738
+ local -a glob=($1/lib/lib*);
739
+ if [ "${#glob[*]}" -gt 0 ]; then
740
+ export NIX_LDFLAGS${role_post}+=" -L$1/lib";
741
+ fi;
742
+ fi
743
+ }
744
+ buildPhase ()
745
+ {
746
+
747
+ runHook preBuild;
748
+ if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then
749
+ echo "no Makefile or custom buildPhase, doing nothing";
750
+ else
751
+ foundMakefile=1;
752
+ local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
753
+ _accumFlagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray;
754
+ echoCmd 'build flags' "${flagsArray[@]}";
755
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
756
+ unset flagsArray;
757
+ fi;
758
+ runHook postBuild
759
+ }
760
+ ccWrapper_addCVars ()
761
+ {
762
+
763
+ local role_post;
764
+ getHostRoleEnvHook;
765
+ if [ -d "$1/include" ]; then
766
+ export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include";
767
+ fi;
768
+ if [ -d "$1/Library/Frameworks" ]; then
769
+ export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks";
770
+ fi
771
+ }
772
+ checkPhase ()
773
+ {
774
+
775
+ runHook preCheck;
776
+ if [[ -z "${foundMakefile:-}" ]]; then
777
+ echo "no Makefile or custom checkPhase, doing nothing";
778
+ runHook postCheck;
779
+ return;
780
+ fi;
781
+ if [[ -z "${checkTarget:-}" ]]; then
782
+ if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then
783
+ checkTarget=check;
784
+ else
785
+ if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then
786
+ checkTarget=test;
787
+ fi;
788
+ fi;
789
+ fi;
790
+ if [[ -z "${checkTarget:-}" ]]; then
791
+ echo "no check/test target in ${makefile:-Makefile}, doing nothing";
792
+ else
793
+ local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
794
+ _accumFlagsArray makeFlags makeFlagsArray;
795
+ if [ -n "$__structuredAttrs" ]; then
796
+ flagsArray+=("${checkFlags[@]:-VERBOSE=y}");
797
+ else
798
+ flagsArray+=(${checkFlags:-VERBOSE=y});
799
+ fi;
800
+ _accumFlagsArray checkFlagsArray;
801
+ flagsArray+=(${checkTarget});
802
+ echoCmd 'check flags' "${flagsArray[@]}";
803
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
804
+ unset flagsArray;
805
+ fi;
806
+ runHook postCheck
807
+ }
808
+ compressManPages ()
809
+ {
810
+
811
+ local dir="$1";
812
+ if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then
813
+ return;
814
+ fi;
815
+ echo "gzipping man pages under $dir/share/man/";
816
+ find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | while IFS= read -r -d '' f; do
817
+ if gzip -c -n "$f" > "$f".gz; then
818
+ rm "$f";
819
+ else
820
+ rm "$f".gz;
821
+ fi;
822
+ done;
823
+ find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do
824
+ local target;
825
+ target="$(readlink -f "$f")";
826
+ if [ -f "$target".gz ]; then
827
+ ln -sf "$target".gz "$f".gz && rm "$f";
828
+ fi;
829
+ done
830
+ }
831
+ configurePhase ()
832
+ {
833
+
834
+ runHook preConfigure;
835
+ : "${configureScript=}";
836
+ if [[ -z "$configureScript" && -x ./configure ]]; then
837
+ configureScript=./configure;
838
+ fi;
839
+ if [ -z "${dontFixLibtool:-}" ]; then
840
+ export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}";
841
+ local i;
842
+ find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do
843
+ echo "fixing libtool script $i";
844
+ fixLibtool "$i";
845
+ done;
846
+ CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX);
847
+ find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;;
848
+ rm -f "$CONFIGURE_MTIME_REFERENCE";
849
+ fi;
850
+ if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then
851
+ prependToVar configureFlags "${prefixKey:---prefix=}$prefix";
852
+ fi;
853
+ if [[ -f "$configureScript" ]]; then
854
+ if [ -z "${dontAddDisableDepTrack:-}" ]; then
855
+ if grep -q dependency-tracking "$configureScript"; then
856
+ prependToVar configureFlags --disable-dependency-tracking;
857
+ fi;
858
+ fi;
859
+ if [ -z "${dontDisableStatic:-}" ]; then
860
+ if grep -q enable-static "$configureScript"; then
861
+ prependToVar configureFlags --disable-static;
862
+ fi;
863
+ fi;
864
+ fi;
865
+ if [ -n "$configureScript" ]; then
866
+ local -a flagsArray;
867
+ _accumFlagsArray configureFlags configureFlagsArray;
868
+ echoCmd 'configure flags' "${flagsArray[@]}";
869
+ $configureScript "${flagsArray[@]}";
870
+ unset flagsArray;
871
+ else
872
+ echo "no configure script, doing nothing";
873
+ fi;
874
+ runHook postConfigure
875
+ }
876
+ consumeEntire ()
877
+ {
878
+
879
+ if IFS='' read -r -d '' "$1"; then
880
+ echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2;
881
+ return 1;
882
+ fi
883
+ }
884
+ distPhase ()
885
+ {
886
+
887
+ runHook preDist;
888
+ local flagsArray=();
889
+ _accumFlagsArray distFlags distFlagsArray;
890
+ flagsArray+=(${distTarget:-dist});
891
+ echo 'dist flags: %q' "${flagsArray[@]}";
892
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
893
+ if [ "${dontCopyDist:-0}" != 1 ]; then
894
+ mkdir -p "$out/tarballs";
895
+ cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs";
896
+ fi;
897
+ runHook postDist
898
+ }
899
+ dumpVars ()
900
+ {
901
+
902
+ if [ "${noDumpEnvVars:-0}" != 1 ]; then
903
+ export 2> /dev/null >| "$NIX_BUILD_TOP/env-vars" || true;
904
+ fi
905
+ }
906
+ echoCmd ()
907
+ {
908
+
909
+ printf "%s:" "$1";
910
+ shift;
911
+ printf ' %q' "$@";
912
+ echo
913
+ }
914
+ exitHandler ()
915
+ {
916
+
917
+ exitCode="$?";
918
+ set +e;
919
+ if [ -n "${showBuildStats:-}" ]; then
920
+ read -r -d '' -a buildTimes < <(times);
921
+ echo "build times:";
922
+ echo "user time for the shell ${buildTimes[0]}";
923
+ echo "system time for the shell ${buildTimes[1]}";
924
+ echo "user time for all child processes ${buildTimes[2]}";
925
+ echo "system time for all child processes ${buildTimes[3]}";
926
+ fi;
927
+ if (( "$exitCode" != 0 )); then
928
+ runHook failureHook;
929
+ if [ -n "${succeedOnFailure:-}" ]; then
930
+ echo "build failed with exit code $exitCode (ignored)";
931
+ mkdir -p "$out/nix-support";
932
+ printf "%s" "$exitCode" > "$out/nix-support/failed";
933
+ exit 0;
934
+ fi;
935
+ else
936
+ runHook exitHook;
937
+ fi;
938
+ return "$exitCode"
939
+ }
940
+ findInputs ()
941
+ {
942
+
943
+ local -r pkg="$1";
944
+ local -r hostOffset="$2";
945
+ local -r targetOffset="$3";
946
+ (( hostOffset <= targetOffset )) || exit 1;
947
+ local varVar="${pkgAccumVarVars[hostOffset + 1]}";
948
+ local varRef="$varVar[$((targetOffset - hostOffset))]";
949
+ local var="${!varRef}";
950
+ unset -v varVar varRef;
951
+ local varSlice="$var[*]";
952
+ case "${!varSlice-}" in
953
+ *" $pkg "*)
954
+ return 0
955
+ ;;
956
+ esac;
957
+ unset -v varSlice;
958
+ eval "$var"'+=("$pkg")';
959
+ if ! [ -e "$pkg" ]; then
960
+ echo "build input $pkg does not exist" 1>&2;
961
+ exit 1;
962
+ fi;
963
+ function mapOffset ()
964
+ {
965
+ local -r inputOffset="$1";
966
+ local -n outputOffset="$2";
967
+ if (( inputOffset <= 0 )); then
968
+ outputOffset=$((inputOffset + hostOffset));
969
+ else
970
+ outputOffset=$((inputOffset - 1 + targetOffset));
971
+ fi
972
+ };
973
+ local relHostOffset;
974
+ for relHostOffset in "${allPlatOffsets[@]}";
975
+ do
976
+ local files="${propagatedDepFilesVars[relHostOffset + 1]}";
977
+ local hostOffsetNext;
978
+ mapOffset "$relHostOffset" hostOffsetNext;
979
+ (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue;
980
+ local relTargetOffset;
981
+ for relTargetOffset in "${allPlatOffsets[@]}";
982
+ do
983
+ (( "$relHostOffset" <= "$relTargetOffset" )) || continue;
984
+ local fileRef="${files}[$relTargetOffset - $relHostOffset]";
985
+ local file="${!fileRef}";
986
+ unset -v fileRef;
987
+ local targetOffsetNext;
988
+ mapOffset "$relTargetOffset" targetOffsetNext;
989
+ (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue;
990
+ [[ -f "$pkg/nix-support/$file" ]] || continue;
991
+ local pkgNext;
992
+ read -r -d '' pkgNext < "$pkg/nix-support/$file" || true;
993
+ for pkgNext in $pkgNext;
994
+ do
995
+ findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext";
996
+ done;
997
+ done;
998
+ done
999
+ }
1000
+ fixLibtool ()
1001
+ {
1002
+
1003
+ local search_path;
1004
+ for flag in $NIX_LDFLAGS;
1005
+ do
1006
+ case $flag in
1007
+ -L*)
1008
+ search_path+=" ${flag#-L}"
1009
+ ;;
1010
+ esac;
1011
+ done;
1012
+ sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^'
1013
+ }
1014
+ fixupPhase ()
1015
+ {
1016
+
1017
+ local output;
1018
+ for output in $(getAllOutputNames);
1019
+ do
1020
+ if [ -e "${!output}" ]; then
1021
+ chmod -R u+w "${!output}";
1022
+ fi;
1023
+ done;
1024
+ runHook preFixup;
1025
+ local output;
1026
+ for output in $(getAllOutputNames);
1027
+ do
1028
+ prefix="${!output}" runHook fixupOutput;
1029
+ done;
1030
+ recordPropagatedDependencies;
1031
+ if [ -n "${setupHook:-}" ]; then
1032
+ mkdir -p "${!outputDev}/nix-support";
1033
+ substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook";
1034
+ fi;
1035
+ if [ -n "${setupHooks:-}" ]; then
1036
+ mkdir -p "${!outputDev}/nix-support";
1037
+ local hook;
1038
+ for hook in ${setupHooks[@]};
1039
+ do
1040
+ local content;
1041
+ consumeEntire content < "$hook";
1042
+ substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook";
1043
+ unset -v content;
1044
+ done;
1045
+ unset -v hook;
1046
+ fi;
1047
+ if [ -n "${propagatedUserEnvPkgs:-}" ]; then
1048
+ mkdir -p "${!outputBin}/nix-support";
1049
+ printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages";
1050
+ fi;
1051
+ runHook postFixup
1052
+ }
1053
+ genericBuild ()
1054
+ {
1055
+
1056
+ export GZIP_NO_TIMESTAMPS=1;
1057
+ if [ -f "${buildCommandPath:-}" ]; then
1058
+ source "$buildCommandPath";
1059
+ return;
1060
+ fi;
1061
+ if [ -n "${buildCommand:-}" ]; then
1062
+ eval "$buildCommand";
1063
+ return;
1064
+ fi;
1065
+ if [ -z "${phases[*]:-}" ]; then
1066
+ phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}";
1067
+ fi;
1068
+ for curPhase in ${phases[*]};
1069
+ do
1070
+ runPhase "$curPhase";
1071
+ done
1072
+ }
1073
+ getAllOutputNames ()
1074
+ {
1075
+
1076
+ if [ -n "$__structuredAttrs" ]; then
1077
+ echo "${!outputs[*]}";
1078
+ else
1079
+ echo "$outputs";
1080
+ fi
1081
+ }
1082
+ getHostRole ()
1083
+ {
1084
+
1085
+ getRole "$hostOffset"
1086
+ }
1087
+ getHostRoleEnvHook ()
1088
+ {
1089
+
1090
+ getRole "$depHostOffset"
1091
+ }
1092
+ getRole ()
1093
+ {
1094
+
1095
+ case $1 in
1096
+ -1)
1097
+ role_post='_FOR_BUILD'
1098
+ ;;
1099
+ 0)
1100
+ role_post=''
1101
+ ;;
1102
+ 1)
1103
+ role_post='_FOR_TARGET'
1104
+ ;;
1105
+ *)
1106
+ echo "binutils-wrapper-2.40: used as improper sort of dependency" 1>&2;
1107
+ return 1
1108
+ ;;
1109
+ esac
1110
+ }
1111
+ getTargetRole ()
1112
+ {
1113
+
1114
+ getRole "$targetOffset"
1115
+ }
1116
+ getTargetRoleEnvHook ()
1117
+ {
1118
+
1119
+ getRole "$depTargetOffset"
1120
+ }
1121
+ getTargetRoleWrapper ()
1122
+ {
1123
+
1124
+ case $targetOffset in
1125
+ -1)
1126
+ export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1
1127
+ ;;
1128
+ 0)
1129
+ export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1
1130
+ ;;
1131
+ 1)
1132
+ export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1
1133
+ ;;
1134
+ *)
1135
+ echo "binutils-wrapper-2.40: used as improper sort of dependency" 1>&2;
1136
+ return 1
1137
+ ;;
1138
+ esac
1139
+ }
1140
+ installCheckPhase ()
1141
+ {
1142
+
1143
+ runHook preInstallCheck;
1144
+ if [[ -z "${foundMakefile:-}" ]]; then
1145
+ echo "no Makefile or custom installCheckPhase, doing nothing";
1146
+ else
1147
+ if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then
1148
+ echo "no installcheck target in ${makefile:-Makefile}, doing nothing";
1149
+ else
1150
+ local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
1151
+ _accumFlagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray;
1152
+ flagsArray+=(${installCheckTarget:-installcheck});
1153
+ echoCmd 'installcheck flags' "${flagsArray[@]}";
1154
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
1155
+ unset flagsArray;
1156
+ fi;
1157
+ fi;
1158
+ runHook postInstallCheck
1159
+ }
1160
+ installPhase ()
1161
+ {
1162
+
1163
+ runHook preInstall;
1164
+ if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then
1165
+ echo "no Makefile or custom installPhase, doing nothing";
1166
+ runHook postInstall;
1167
+ return;
1168
+ else
1169
+ foundMakefile=1;
1170
+ fi;
1171
+ if [ -n "$prefix" ]; then
1172
+ mkdir -p "$prefix";
1173
+ fi;
1174
+ local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL=$SHELL);
1175
+ _accumFlagsArray makeFlags makeFlagsArray installFlags installFlagsArray;
1176
+ if [ -n "$__structuredAttrs" ]; then
1177
+ flagsArray+=("${installTargets[@]:-install}");
1178
+ else
1179
+ flagsArray+=(${installTargets:-install});
1180
+ fi;
1181
+ echoCmd 'install flags' "${flagsArray[@]}";
1182
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
1183
+ unset flagsArray;
1184
+ runHook postInstall
1185
+ }
1186
+ isELF ()
1187
+ {
1188
+
1189
+ local fn="$1";
1190
+ local fd;
1191
+ local magic;
1192
+ exec {fd}< "$fn";
1193
+ read -r -n 4 -u "$fd" magic;
1194
+ exec {fd}>&-;
1195
+ if [ "$magic" = 'ELF' ]; then
1196
+ return 0;
1197
+ else
1198
+ return 1;
1199
+ fi
1200
+ }
1201
+ isMachO ()
1202
+ {
1203
+
1204
+ local fn="$1";
1205
+ local fd;
1206
+ local magic;
1207
+ exec {fd}< "$fn";
1208
+ read -r -n 4 -u "$fd" magic;
1209
+ exec {fd}>&-;
1210
+ if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then
1211
+ return 0;
1212
+ else
1213
+ if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then
1214
+ return 0;
1215
+ else
1216
+ if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then
1217
+ return 0;
1218
+ else
1219
+ return 1;
1220
+ fi;
1221
+ fi;
1222
+ fi
1223
+ }
1224
+ isScript ()
1225
+ {
1226
+
1227
+ local fn="$1";
1228
+ local fd;
1229
+ local magic;
1230
+ exec {fd}< "$fn";
1231
+ read -r -n 2 -u "$fd" magic;
1232
+ exec {fd}>&-;
1233
+ if [[ "$magic" =~ \#! ]]; then
1234
+ return 0;
1235
+ else
1236
+ return 1;
1237
+ fi
1238
+ }
1239
+ mapOffset ()
1240
+ {
1241
+
1242
+ local -r inputOffset="$1";
1243
+ local -n outputOffset="$2";
1244
+ if (( inputOffset <= 0 )); then
1245
+ outputOffset=$((inputOffset + hostOffset));
1246
+ else
1247
+ outputOffset=$((inputOffset - 1 + targetOffset));
1248
+ fi
1249
+ }
1250
+ moveToOutput ()
1251
+ {
1252
+
1253
+ local patt="$1";
1254
+ local dstOut="$2";
1255
+ local output;
1256
+ for output in $(getAllOutputNames);
1257
+ do
1258
+ if [ "${!output}" = "$dstOut" ]; then
1259
+ continue;
1260
+ fi;
1261
+ local srcPath;
1262
+ for srcPath in "${!output}"/$patt;
1263
+ do
1264
+ if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then
1265
+ continue;
1266
+ fi;
1267
+ if [ "$dstOut" = REMOVE ]; then
1268
+ echo "Removing $srcPath";
1269
+ rm -r "$srcPath";
1270
+ else
1271
+ local dstPath="$dstOut${srcPath#${!output}}";
1272
+ echo "Moving $srcPath to $dstPath";
1273
+ if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then
1274
+ rmdir "$srcPath" --ignore-fail-on-non-empty;
1275
+ if [ -d "$srcPath" ]; then
1276
+ mv -t "$dstPath" "$srcPath"/*;
1277
+ rmdir "$srcPath";
1278
+ fi;
1279
+ else
1280
+ mkdir -p "$(readlink -m "$dstPath/..")";
1281
+ mv "$srcPath" "$dstPath";
1282
+ fi;
1283
+ fi;
1284
+ local srcParent="$(readlink -m "$srcPath/..")";
1285
+ if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then
1286
+ echo "Removing empty $srcParent/ and (possibly) its parents";
1287
+ rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true;
1288
+ fi;
1289
+ done;
1290
+ done
1291
+ }
1292
+ patchELF ()
1293
+ {
1294
+
1295
+ local dir="$1";
1296
+ [ -e "$dir" ] || return 0;
1297
+ echo "shrinking RPATHs of ELF executables and libraries in $dir";
1298
+ local i;
1299
+ while IFS= read -r -d '' i; do
1300
+ if [[ "$i" =~ .build-id ]]; then
1301
+ continue;
1302
+ fi;
1303
+ if ! isELF "$i"; then
1304
+ continue;
1305
+ fi;
1306
+ echo "shrinking $i";
1307
+ patchelf --shrink-rpath "$i" || true;
1308
+ done < <(find "$dir" -type f -print0)
1309
+ }
1310
+ patchPhase ()
1311
+ {
1312
+
1313
+ runHook prePatch;
1314
+ local -a patchesArray;
1315
+ if [ -n "$__structuredAttrs" ]; then
1316
+ patchesArray=(${patches:+"${patches[@]}"});
1317
+ else
1318
+ patchesArray=(${patches:-});
1319
+ fi;
1320
+ for i in "${patchesArray[@]}";
1321
+ do
1322
+ echo "applying patch $i";
1323
+ local uncompress=cat;
1324
+ case "$i" in
1325
+ *.gz)
1326
+ uncompress="gzip -d"
1327
+ ;;
1328
+ *.bz2)
1329
+ uncompress="bzip2 -d"
1330
+ ;;
1331
+ *.xz)
1332
+ uncompress="xz -d"
1333
+ ;;
1334
+ *.lzma)
1335
+ uncompress="lzma -d"
1336
+ ;;
1337
+ esac;
1338
+ local -a flagsArray;
1339
+ if [ -n "$__structuredAttrs" ]; then
1340
+ flagsArray=("${patchFlags[@]:--p1}");
1341
+ else
1342
+ flagsArray=(${patchFlags:--p1});
1343
+ fi;
1344
+ $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}";
1345
+ done;
1346
+ runHook postPatch
1347
+ }
1348
+ patchShebangs ()
1349
+ {
1350
+
1351
+ local pathName;
1352
+ local update;
1353
+ while [[ $# -gt 0 ]]; do
1354
+ case "$1" in
1355
+ --host)
1356
+ pathName=HOST_PATH;
1357
+ shift
1358
+ ;;
1359
+ --build)
1360
+ pathName=PATH;
1361
+ shift
1362
+ ;;
1363
+ --update)
1364
+ update=true;
1365
+ shift
1366
+ ;;
1367
+ --)
1368
+ shift;
1369
+ break
1370
+ ;;
1371
+ -* | --*)
1372
+ echo "Unknown option $1 supplied to patchShebangs" 1>&2;
1373
+ return 1
1374
+ ;;
1375
+ *)
1376
+ break
1377
+ ;;
1378
+ esac;
1379
+ done;
1380
+ echo "patching script interpreter paths in $@";
1381
+ local f;
1382
+ local oldPath;
1383
+ local newPath;
1384
+ local arg0;
1385
+ local args;
1386
+ local oldInterpreterLine;
1387
+ local newInterpreterLine;
1388
+ if [[ $# -eq 0 ]]; then
1389
+ echo "No arguments supplied to patchShebangs" 1>&2;
1390
+ return 0;
1391
+ fi;
1392
+ local f;
1393
+ while IFS= read -r -d '' f; do
1394
+ isScript "$f" || continue;
1395
+ read -r oldInterpreterLine < "$f";
1396
+ read -r oldPath arg0 args <<< "${oldInterpreterLine:2}";
1397
+ if [[ -z "${pathName:-}" ]]; then
1398
+ if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then
1399
+ pathName=HOST_PATH;
1400
+ else
1401
+ pathName=PATH;
1402
+ fi;
1403
+ fi;
1404
+ if [[ "$oldPath" == *"/bin/env" ]]; then
1405
+ if [[ $arg0 == "-S" ]]; then
1406
+ arg0=${args%% *};
1407
+ args=${args#* };
1408
+ newPath="$(PATH="${!pathName}" command -v "env" || true)";
1409
+ args="-S $(PATH="${!pathName}" command -v "$arg0" || true) $args";
1410
+ else
1411
+ if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then
1412
+ echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2;
1413
+ exit 1;
1414
+ else
1415
+ newPath="$(PATH="${!pathName}" command -v "$arg0" || true)";
1416
+ fi;
1417
+ fi;
1418
+ else
1419
+ if [[ -z $oldPath ]]; then
1420
+ oldPath="/bin/sh";
1421
+ fi;
1422
+ newPath="$(PATH="${!pathName}" command -v "$(basename "$oldPath")" || true)";
1423
+ args="$arg0 $args";
1424
+ fi;
1425
+ newInterpreterLine="$newPath $args";
1426
+ newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}};
1427
+ if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then
1428
+ if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then
1429
+ echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\"";
1430
+ escapedInterpreterLine=${newInterpreterLine//\\/\\\\};
1431
+ timestamp=$(stat --printf "%y" "$f");
1432
+ sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f";
1433
+ touch --date "$timestamp" "$f";
1434
+ fi;
1435
+ fi;
1436
+ done < <(find "$@" -type f -perm -0100 -print0)
1437
+ }
1438
+ patchShebangsAuto ()
1439
+ {
1440
+
1441
+ if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then
1442
+ if [[ "$output" != out && "$output" = "$outputDev" ]]; then
1443
+ patchShebangs --build "$prefix";
1444
+ else
1445
+ patchShebangs --host "$prefix";
1446
+ fi;
1447
+ fi
1448
+ }
1449
+ prependToVar ()
1450
+ {
1451
+
1452
+ local -n nameref="$1";
1453
+ local useArray type;
1454
+ if [ -n "$__structuredAttrs" ]; then
1455
+ useArray=true;
1456
+ else
1457
+ useArray=false;
1458
+ fi;
1459
+ if declare -p "$1" 2> /dev/null | grep -q '^'; then
1460
+ type="$(declare -p "$1")";
1461
+ if [[ "$type" =~ "declare -A" ]]; then
1462
+ echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2;
1463
+ return 1;
1464
+ else
1465
+ if [[ "$type" =~ "declare -a" ]]; then
1466
+ useArray=true;
1467
+ else
1468
+ useArray=false;
1469
+ fi;
1470
+ fi;
1471
+ fi;
1472
+ shift;
1473
+ if $useArray; then
1474
+ nameref=("$@" ${nameref+"${nameref[@]}"});
1475
+ else
1476
+ nameref="$* ${nameref-}";
1477
+ fi
1478
+ }
1479
+ printLines ()
1480
+ {
1481
+
1482
+ (( "$#" > 0 )) || return 0;
1483
+ printf '%s\n' "$@"
1484
+ }
1485
+ printWords ()
1486
+ {
1487
+
1488
+ (( "$#" > 0 )) || return 0;
1489
+ printf '%s ' "$@"
1490
+ }
1491
+ recordPropagatedDependencies ()
1492
+ {
1493
+
1494
+ declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated);
1495
+ declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}");
1496
+ local propagatedInputsIndex;
1497
+ for propagatedInputsIndex in "${!flatVars[@]}";
1498
+ do
1499
+ local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]";
1500
+ local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}";
1501
+ [[ -n "${!propagatedInputsSlice}" ]] || continue;
1502
+ mkdir -p "${!outputDev}/nix-support";
1503
+ printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile";
1504
+ done
1505
+ }
1506
+ runHook ()
1507
+ {
1508
+
1509
+ local hookName="$1";
1510
+ shift;
1511
+ local hooksSlice="${hookName%Hook}Hooks[@]";
1512
+ local hook;
1513
+ for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"};
1514
+ do
1515
+ _eval "$hook" "$@";
1516
+ done;
1517
+ return 0
1518
+ }
1519
+ runOneHook ()
1520
+ {
1521
+
1522
+ local hookName="$1";
1523
+ shift;
1524
+ local hooksSlice="${hookName%Hook}Hooks[@]";
1525
+ local hook ret=1;
1526
+ for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"};
1527
+ do
1528
+ if _eval "$hook" "$@"; then
1529
+ ret=0;
1530
+ break;
1531
+ fi;
1532
+ done;
1533
+ return "$ret"
1534
+ }
1535
+ runPhase ()
1536
+ {
1537
+
1538
+ local curPhase="$*";
1539
+ if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then
1540
+ return;
1541
+ fi;
1542
+ if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then
1543
+ return;
1544
+ fi;
1545
+ if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then
1546
+ return;
1547
+ fi;
1548
+ if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then
1549
+ return;
1550
+ fi;
1551
+ if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then
1552
+ return;
1553
+ fi;
1554
+ if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then
1555
+ return;
1556
+ fi;
1557
+ if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then
1558
+ return;
1559
+ fi;
1560
+ if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then
1561
+ return;
1562
+ fi;
1563
+ if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then
1564
+ return;
1565
+ fi;
1566
+ if [[ -n $NIX_LOG_FD ]]; then
1567
+ echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD";
1568
+ fi;
1569
+ showPhaseHeader "$curPhase";
1570
+ dumpVars;
1571
+ local startTime=$(date +"%s");
1572
+ eval "${!curPhase:-$curPhase}";
1573
+ local endTime=$(date +"%s");
1574
+ showPhaseFooter "$curPhase" "$startTime" "$endTime";
1575
+ if [ "$curPhase" = unpackPhase ]; then
1576
+ [ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}";
1577
+ cd "${sourceRoot:-.}";
1578
+ fi
1579
+ }
1580
+ showPhaseFooter ()
1581
+ {
1582
+
1583
+ local phase="$1";
1584
+ local startTime="$2";
1585
+ local endTime="$3";
1586
+ local delta=$(( endTime - startTime ));
1587
+ (( delta < 30 )) && return;
1588
+ local H=$((delta/3600));
1589
+ local M=$((delta%3600/60));
1590
+ local S=$((delta%60));
1591
+ echo -n "$phase completed in ";
1592
+ (( H > 0 )) && echo -n "$H hours ";
1593
+ (( M > 0 )) && echo -n "$M minutes ";
1594
+ echo "$S seconds"
1595
+ }
1596
+ showPhaseHeader ()
1597
+ {
1598
+
1599
+ local phase="$1";
1600
+ echo "Running phase: $phase"
1601
+ }
1602
+ stripDirs ()
1603
+ {
1604
+
1605
+ local cmd="$1";
1606
+ local ranlibCmd="$2";
1607
+ local paths="$3";
1608
+ local stripFlags="$4";
1609
+ local excludeFlags=();
1610
+ local pathsNew=;
1611
+ [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1;
1612
+ [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1;
1613
+ local pattern;
1614
+ if [ -n "${stripExclude:-}" ]; then
1615
+ for pattern in "${stripExclude[@]}";
1616
+ do
1617
+ excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')');
1618
+ done;
1619
+ fi;
1620
+ local p;
1621
+ for p in ${paths};
1622
+ do
1623
+ if [ -e "$prefix/$p" ]; then
1624
+ pathsNew="${pathsNew} $prefix/$p";
1625
+ fi;
1626
+ done;
1627
+ paths=${pathsNew};
1628
+ if [ -n "${paths}" ]; then
1629
+ echo "stripping (with command $cmd and flags $stripFlags) in $paths";
1630
+ local striperr;
1631
+ striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')";
1632
+ find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -print0 | xargs -r -0 -n1 -- realpath -z | sort -u -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?;
1633
+ [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 );
1634
+ rm "$striperr";
1635
+ find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null;
1636
+ fi
1637
+ }
1638
+ stripHash ()
1639
+ {
1640
+
1641
+ local strippedName casematchOpt=0;
1642
+ strippedName="$(basename -- "$1")";
1643
+ shopt -q nocasematch && casematchOpt=1;
1644
+ shopt -u nocasematch;
1645
+ if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then
1646
+ echo "${strippedName:33}";
1647
+ else
1648
+ echo "$strippedName";
1649
+ fi;
1650
+ if (( casematchOpt )); then
1651
+ shopt -s nocasematch;
1652
+ fi
1653
+ }
1654
+ substitute ()
1655
+ {
1656
+
1657
+ local input="$1";
1658
+ local output="$2";
1659
+ shift 2;
1660
+ if [ ! -f "$input" ]; then
1661
+ echo "substitute(): ERROR: file '$input' does not exist" 1>&2;
1662
+ return 1;
1663
+ fi;
1664
+ local content;
1665
+ consumeEntire content < "$input";
1666
+ if [ -e "$output" ]; then
1667
+ chmod +w "$output";
1668
+ fi;
1669
+ substituteStream content "file '$input'" "$@" > "$output"
1670
+ }
1671
+ substituteAll ()
1672
+ {
1673
+
1674
+ local input="$1";
1675
+ local output="$2";
1676
+ local -a args=();
1677
+ _allFlags;
1678
+ substitute "$input" "$output" "${args[@]}"
1679
+ }
1680
+ substituteAllInPlace ()
1681
+ {
1682
+
1683
+ local fileName="$1";
1684
+ shift;
1685
+ substituteAll "$fileName" "$fileName" "$@"
1686
+ }
1687
+ substituteAllStream ()
1688
+ {
1689
+
1690
+ local -a args=();
1691
+ _allFlags;
1692
+ substituteStream "$1" "$2" "${args[@]}"
1693
+ }
1694
+ substituteInPlace ()
1695
+ {
1696
+
1697
+ local -a fileNames=();
1698
+ for arg in "$@";
1699
+ do
1700
+ if [[ "$arg" = "--"* ]]; then
1701
+ break;
1702
+ fi;
1703
+ fileNames+=("$arg");
1704
+ shift;
1705
+ done;
1706
+ for file in "${fileNames[@]}";
1707
+ do
1708
+ substitute "$file" "$file" "$@";
1709
+ done
1710
+ }
1711
+ substituteStream ()
1712
+ {
1713
+
1714
+ local var=$1;
1715
+ local description=$2;
1716
+ shift 2;
1717
+ while (( "$#" )); do
1718
+ case "$1" in
1719
+ --replace)
1720
+ pattern="$2";
1721
+ replacement="$3";
1722
+ shift 3;
1723
+ local savedvar;
1724
+ savedvar="${!var}";
1725
+ eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}';
1726
+ if [ "$pattern" != "$replacement" ]; then
1727
+ if [ "${!var}" == "$savedvar" ]; then
1728
+ echo "substituteStream(): WARNING: pattern '$pattern' doesn't match anything in $description" 1>&2;
1729
+ fi;
1730
+ fi
1731
+ ;;
1732
+ --subst-var)
1733
+ local varName="$2";
1734
+ shift 2;
1735
+ if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then
1736
+ echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2;
1737
+ return 1;
1738
+ fi;
1739
+ if [ -z ${!varName+x} ]; then
1740
+ echo "substituteStream(): ERROR: variable \$$varName is unset" 1>&2;
1741
+ return 1;
1742
+ fi;
1743
+ pattern="@$varName@";
1744
+ replacement="${!varName}";
1745
+ eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
1746
+ ;;
1747
+ --subst-var-by)
1748
+ pattern="@$2@";
1749
+ replacement="$3";
1750
+ eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}';
1751
+ shift 3
1752
+ ;;
1753
+ *)
1754
+ echo "substituteStream(): ERROR: Invalid command line argument: $1" 1>&2;
1755
+ return 1
1756
+ ;;
1757
+ esac;
1758
+ done;
1759
+ printf "%s" "${!var}"
1760
+ }
1761
+ unpackFile ()
1762
+ {
1763
+
1764
+ curSrc="$1";
1765
+ echo "unpacking source archive $curSrc";
1766
+ if ! runOneHook unpackCmd "$curSrc"; then
1767
+ echo "do not know how to unpack source archive $curSrc";
1768
+ exit 1;
1769
+ fi
1770
+ }
1771
+ unpackPhase ()
1772
+ {
1773
+
1774
+ runHook preUnpack;
1775
+ if [ -z "${srcs:-}" ]; then
1776
+ if [ -z "${src:-}" ]; then
1777
+ echo 'variable $src or $srcs should point to the source';
1778
+ exit 1;
1779
+ fi;
1780
+ srcs="$src";
1781
+ fi;
1782
+ local -a srcsArray;
1783
+ if [ -n "$__structuredAttrs" ]; then
1784
+ srcsArray=("${srcs[@]}");
1785
+ else
1786
+ srcsArray=($srcs);
1787
+ fi;
1788
+ local dirsBefore="";
1789
+ for i in *;
1790
+ do
1791
+ if [ -d "$i" ]; then
1792
+ dirsBefore="$dirsBefore $i ";
1793
+ fi;
1794
+ done;
1795
+ for i in "${srcsArray[@]}";
1796
+ do
1797
+ unpackFile "$i";
1798
+ done;
1799
+ : "${sourceRoot=}";
1800
+ if [ -n "${setSourceRoot:-}" ]; then
1801
+ runOneHook setSourceRoot;
1802
+ else
1803
+ if [ -z "$sourceRoot" ]; then
1804
+ for i in *;
1805
+ do
1806
+ if [ -d "$i" ]; then
1807
+ case $dirsBefore in
1808
+ *\ $i\ *)
1809
+
1810
+ ;;
1811
+ *)
1812
+ if [ -n "$sourceRoot" ]; then
1813
+ echo "unpacker produced multiple directories";
1814
+ exit 1;
1815
+ fi;
1816
+ sourceRoot="$i"
1817
+ ;;
1818
+ esac;
1819
+ fi;
1820
+ done;
1821
+ fi;
1822
+ fi;
1823
+ if [ -z "$sourceRoot" ]; then
1824
+ echo "unpacker appears to have produced no directories";
1825
+ exit 1;
1826
+ fi;
1827
+ echo "source root is $sourceRoot";
1828
+ if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then
1829
+ chmod -R u+w -- "$sourceRoot";
1830
+ fi;
1831
+ runHook postUnpack
1832
+ }
1833
+ updateAutotoolsGnuConfigScriptsPhase ()
1834
+ {
1835
+
1836
+ if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then
1837
+ return;
1838
+ fi;
1839
+ for script in config.sub config.guess;
1840
+ do
1841
+ for f in $(find . -type f -name "$script");
1842
+ do
1843
+ echo "Updating Autotools / GNU config script to a newer upstream version: $f";
1844
+ cp -f "/nix/store/7n1vikpxsl1gs5h8f0f8zqfj2mcdy1ii-gnu-config-2023-09-19/$script" "$f";
1845
+ done;
1846
+ done
1847
+ }
1848
+ updateSourceDateEpoch ()
1849
+ {
1850
+
1851
+ local path="$1";
1852
+ local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ %p\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1));
1853
+ local time="${res[0]//\.[0-9]*/}";
1854
+ local newestFile="${res[1]}";
1855
+ if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then
1856
+ echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile";
1857
+ export SOURCE_DATE_EPOCH="$time";
1858
+ local now="$(date +%s)";
1859
+ if [ "$time" -gt $((now - 60)) ]; then
1860
+ echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic";
1861
+ fi;
1862
+ fi
1863
+ }
1864
+ PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}"
1865
+ XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}"
1866
+ export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)"
1867
+ export TMP="$NIX_BUILD_TOP"
1868
+ export TMPDIR="$NIX_BUILD_TOP"
1869
+ export TEMP="$NIX_BUILD_TOP"
1870
+ export TEMPDIR="$NIX_BUILD_TOP"
1871
+ eval "$shellHook"