@ifunny/ifunny-api-types 1.0.3 → 1.2.0

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.
Files changed (215) hide show
  1. package/.devenv/bootstrap/bootstrapLib.nix +630 -0
  2. package/.devenv/bootstrap/default.nix +22 -0
  3. package/.devenv/bootstrap/resolve-lock.nix +190 -0
  4. package/.devenv/changelog-cache.json +9 -0
  5. package/.devenv/devenv.fish +252 -0
  6. package/.devenv/imports.txt +0 -0
  7. package/.devenv/input-paths.txt +10 -0
  8. package/.devenv/load-exports +1 -0
  9. package/.devenv/nix-eval-cache.db +0 -0
  10. package/.devenv/nix-eval-cache.db-shm +0 -0
  11. package/.devenv/nix-eval-cache.db-wal +0 -0
  12. package/.devenv/nix-eval-cache.db.init.lock +0 -0
  13. package/.devenv/nixpkgs-config-99f33fda17d41bc9.nix +17 -0
  14. package/.devenv/nixpkgs-config-c46eff8321b73149.nix +29 -0
  15. package/.devenv/profiles/nix/bootstrap/bootstrapLib.nix +571 -0
  16. package/.devenv/profiles/nix/bootstrap/default.nix +19 -0
  17. package/.devenv/profiles/nix/bootstrap/resolve-lock.nix +157 -0
  18. package/.devenv/profiles/nix/imports.txt +0 -0
  19. package/.devenv/profiles/nix/input-paths.txt +4 -0
  20. package/.devenv/profiles/nix/load-exports +1 -0
  21. package/.devenv/profiles/nix/nix-eval-cache.db +0 -0
  22. package/.devenv/profiles/nix/nix-eval-cache.db-shm +0 -0
  23. package/.devenv/profiles/nix/nix-eval-cache.db-wal +0 -0
  24. package/.devenv/profiles/nix/nixpkgs-config-99f33fda17d41bc9.nix +17 -0
  25. package/.devenv/profiles/nix/shell-0d722b4fe4724c8e.sh +2270 -0
  26. package/.devenv/profiles/nix/shell-314b72302fb2c916.sh +2270 -0
  27. package/.devenv/profiles/nix/shell-6a4b00b5ca837a3b.sh +2270 -0
  28. package/.devenv/profiles/nix/shell-956adc1e664f64c3.sh +2270 -0
  29. package/.devenv/profiles/nix/shell-9dbff87fad44e8d9.sh +2270 -0
  30. package/.devenv/profiles/nix/shell-b1e9e1f82076662f.sh +2270 -0
  31. package/.devenv/profiles/nix/shell-b4f4bbfa36797bee.sh +2270 -0
  32. package/.devenv/profiles/nix/shell-c4b190d331c48d67.sh +2270 -0
  33. package/.devenv/profiles/nix/state/files.json +1 -0
  34. package/.devenv/profiles/nix/state/tasks.db +0 -0
  35. package/.devenv/profiles/nix/state/tasks.db-shm +0 -0
  36. package/.devenv/profiles/nix/state/tasks.db-wal +0 -0
  37. package/.devenv/profiles/nix/task-names.txt +5 -0
  38. package/.devenv/shell-086ca2c39799e6a6.sh +2270 -0
  39. package/.devenv/shell-2c06a35dd99be3d1.sh +2270 -0
  40. package/.devenv/shell-36f1fe0faec08873.sh +2270 -0
  41. package/.devenv/shell-676361065bda5b43.sh +2270 -0
  42. package/.devenv/shell-9f6cb513d1721fef.sh +2270 -0
  43. package/.devenv/shell-c0e4459b4f5922d7.sh +2270 -0
  44. package/.devenv/shell-c862a0db6e9ad5f4.sh +2270 -0
  45. package/.devenv/shell-d71ade933a43e837.sh +2270 -0
  46. package/.devenv/shell-dd73aac05b182946.sh +2270 -0
  47. package/.devenv/shell-e39d0b30a7e0eb13.sh +2270 -0
  48. package/.devenv/shell-env.sh +2263 -0
  49. package/.devenv/shell-f924d749ff8c17ee.sh +2270 -0
  50. package/.devenv/shell-rcfile.sh +152 -0
  51. package/.devenv/state/files.json +1 -0
  52. package/.devenv/state/tasks.db +0 -0
  53. package/.devenv/state/tasks.db-shm +0 -0
  54. package/.devenv/state/tasks.db-wal +0 -0
  55. package/.devenv/state/tasks.db.init.lock +0 -0
  56. package/.devenv/task-names.txt +5 -0
  57. package/.github/workflows/codeql.yml +72 -72
  58. package/.github/workflows/test.yml +31 -31
  59. package/CHANGELOG.md +8405 -417
  60. package/LICENSE +121 -121
  61. package/README.md +2 -2
  62. package/devenv.lock +65 -0
  63. package/devenv.nix +38 -0
  64. package/devenv.yaml +18 -0
  65. package/eslint.config.mjs +18 -0
  66. package/package.json +59 -50
  67. package/prettier.config.js +15 -0
  68. package/dist/errors/bad_request.js +0 -8
  69. package/dist/errors/bad_request.js.map +0 -1
  70. package/dist/errors/captcha_required.js +0 -19
  71. package/dist/errors/captcha_required.js.map +0 -1
  72. package/dist/errors/email_exists.js +0 -8
  73. package/dist/errors/email_exists.js.map +0 -1
  74. package/dist/errors/error.js +0 -3
  75. package/dist/errors/error.js.map +0 -1
  76. package/dist/errors/error_base.js +0 -43
  77. package/dist/errors/error_base.js.map +0 -1
  78. package/dist/errors/index.js +0 -29
  79. package/dist/errors/index.js.map +0 -1
  80. package/dist/errors/invalid_client.js +0 -8
  81. package/dist/errors/invalid_client.js.map +0 -1
  82. package/dist/errors/invalid_email.js +0 -8
  83. package/dist/errors/invalid_email.js.map +0 -1
  84. package/dist/errors/invalid_grant.js +0 -8
  85. package/dist/errors/invalid_grant.js.map +0 -1
  86. package/dist/errors/not_found.js +0 -3
  87. package/dist/errors/not_found.js.map +0 -1
  88. package/dist/errors/permission_denied.js +0 -8
  89. package/dist/errors/permission_denied.js.map +0 -1
  90. package/dist/errors/unauthorized.js +0 -8
  91. package/dist/errors/unauthorized.js.map +0 -1
  92. package/dist/errors/wrong_params.js +0 -8
  93. package/dist/errors/wrong_params.js.map +0 -1
  94. package/dist/index.js +0 -21
  95. package/dist/index.js.map +0 -1
  96. package/dist/payloads/activity.js +0 -50
  97. package/dist/payloads/activity.js.map +0 -1
  98. package/dist/payloads/app.js +0 -3
  99. package/dist/payloads/app.js.map +0 -1
  100. package/dist/payloads/appeal.js +0 -14
  101. package/dist/payloads/appeal.js.map +0 -1
  102. package/dist/payloads/ban.js +0 -36
  103. package/dist/payloads/ban.js.map +0 -1
  104. package/dist/payloads/base.js +0 -3
  105. package/dist/payloads/base.js.map +0 -1
  106. package/dist/payloads/client.js +0 -13
  107. package/dist/payloads/client.js.map +0 -1
  108. package/dist/payloads/comment.js +0 -42
  109. package/dist/payloads/comment.js.map +0 -1
  110. package/dist/payloads/content.js +0 -176
  111. package/dist/payloads/content.js.map +0 -1
  112. package/dist/payloads/index.js +0 -27
  113. package/dist/payloads/index.js.map +0 -1
  114. package/dist/payloads/strike.js +0 -3
  115. package/dist/payloads/strike.js.map +0 -1
  116. package/dist/payloads/user.js +0 -214
  117. package/dist/payloads/user.js.map +0 -1
  118. package/dist/rest/account.js +0 -3
  119. package/dist/rest/account.js.map +0 -1
  120. package/dist/rest/content.js +0 -54
  121. package/dist/rest/content.js.map +0 -1
  122. package/dist/rest/counters.js +0 -3
  123. package/dist/rest/counters.js.map +0 -1
  124. package/dist/rest/endpoints.js +0 -199
  125. package/dist/rest/endpoints.js.map +0 -1
  126. package/dist/rest/explore.js +0 -82
  127. package/dist/rest/explore.js.map +0 -1
  128. package/dist/rest/feeds.js +0 -3
  129. package/dist/rest/feeds.js.map +0 -1
  130. package/dist/rest/index.js +0 -25
  131. package/dist/rest/index.js.map +0 -1
  132. package/dist/rest/issues.js +0 -3
  133. package/dist/rest/issues.js.map +0 -1
  134. package/dist/rest/oauth2.js +0 -9
  135. package/dist/rest/oauth2.js.map +0 -1
  136. package/dist/utils/index.js +0 -19
  137. package/dist/utils/index.js.map +0 -1
  138. package/dist/utils/rest.js +0 -3
  139. package/dist/utils/rest.js.map +0 -1
  140. package/dist/utils/util.js +0 -3
  141. package/dist/utils/util.js.map +0 -1
  142. package/types/errors/bad_request.d.ts +0 -12
  143. package/types/errors/bad_request.d.ts.map +0 -1
  144. package/types/errors/captcha_required.d.ts +0 -33
  145. package/types/errors/captcha_required.d.ts.map +0 -1
  146. package/types/errors/email_exists.d.ts +0 -15
  147. package/types/errors/email_exists.d.ts.map +0 -1
  148. package/types/errors/error.d.ts +0 -29
  149. package/types/errors/error.d.ts.map +0 -1
  150. package/types/errors/error_base.d.ts +0 -61
  151. package/types/errors/error_base.d.ts.map +0 -1
  152. package/types/errors/index.d.ts +0 -13
  153. package/types/errors/index.d.ts.map +0 -1
  154. package/types/errors/invalid_client.d.ts +0 -15
  155. package/types/errors/invalid_client.d.ts.map +0 -1
  156. package/types/errors/invalid_email.d.ts +0 -15
  157. package/types/errors/invalid_email.d.ts.map +0 -1
  158. package/types/errors/invalid_grant.d.ts +0 -12
  159. package/types/errors/invalid_grant.d.ts.map +0 -1
  160. package/types/errors/not_found.d.ts +0 -8
  161. package/types/errors/not_found.d.ts.map +0 -1
  162. package/types/errors/permission_denied.d.ts +0 -12
  163. package/types/errors/permission_denied.d.ts.map +0 -1
  164. package/types/errors/unauthorized.d.ts +0 -12
  165. package/types/errors/unauthorized.d.ts.map +0 -1
  166. package/types/errors/wrong_params.d.ts +0 -11
  167. package/types/errors/wrong_params.d.ts.map +0 -1
  168. package/types/index.d.ts +0 -5
  169. package/types/index.d.ts.map +0 -1
  170. package/types/payloads/activity.d.ts +0 -114
  171. package/types/payloads/activity.d.ts.map +0 -1
  172. package/types/payloads/app.d.ts +0 -266
  173. package/types/payloads/app.d.ts.map +0 -1
  174. package/types/payloads/appeal.d.ts +0 -22
  175. package/types/payloads/appeal.d.ts.map +0 -1
  176. package/types/payloads/ban.d.ts +0 -85
  177. package/types/payloads/ban.d.ts.map +0 -1
  178. package/types/payloads/base.d.ts +0 -5
  179. package/types/payloads/base.d.ts.map +0 -1
  180. package/types/payloads/client.d.ts +0 -106
  181. package/types/payloads/client.d.ts.map +0 -1
  182. package/types/payloads/comment.d.ts +0 -124
  183. package/types/payloads/comment.d.ts.map +0 -1
  184. package/types/payloads/content.d.ts +0 -676
  185. package/types/payloads/content.d.ts.map +0 -1
  186. package/types/payloads/index.d.ts +0 -11
  187. package/types/payloads/index.d.ts.map +0 -1
  188. package/types/payloads/strike.d.ts +0 -15
  189. package/types/payloads/strike.d.ts.map +0 -1
  190. package/types/payloads/user.d.ts +0 -515
  191. package/types/payloads/user.d.ts.map +0 -1
  192. package/types/rest/account.d.ts +0 -4
  193. package/types/rest/account.d.ts.map +0 -1
  194. package/types/rest/content.d.ts +0 -96
  195. package/types/rest/content.d.ts.map +0 -1
  196. package/types/rest/counters.d.ts +0 -10
  197. package/types/rest/counters.d.ts.map +0 -1
  198. package/types/rest/endpoints.d.ts +0 -153
  199. package/types/rest/endpoints.d.ts.map +0 -1
  200. package/types/rest/explore.d.ts +0 -113
  201. package/types/rest/explore.d.ts.map +0 -1
  202. package/types/rest/feeds.d.ts +0 -17
  203. package/types/rest/feeds.d.ts.map +0 -1
  204. package/types/rest/index.d.ts +0 -9
  205. package/types/rest/index.d.ts.map +0 -1
  206. package/types/rest/issues.d.ts +0 -16
  207. package/types/rest/issues.d.ts.map +0 -1
  208. package/types/rest/oauth2.d.ts +0 -37
  209. package/types/rest/oauth2.d.ts.map +0 -1
  210. package/types/utils/index.d.ts +0 -3
  211. package/types/utils/index.d.ts.map +0 -1
  212. package/types/utils/rest.d.ts +0 -50
  213. package/types/utils/rest.d.ts.map +0 -1
  214. package/types/utils/util.d.ts +0 -80
  215. package/types/utils/util.d.ts.map +0 -1
@@ -0,0 +1,2270 @@
1
+ if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then
2
+ source $HOME/.bashrc;
3
+ fi
4
+
5
+ shopt -u expand_aliases
6
+ PATH=${PATH:-}
7
+ nix_saved_PATH="$PATH"
8
+ XDG_DATA_DIRS=${XDG_DATA_DIRS:-}
9
+ nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS"
10
+ declare -a envBuildBuildHooks=('addNodePath' )
11
+ NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1'
12
+ export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
13
+ DEVENV_DOTFILE='/media/Code/@Open-iFunny/ifunny-api-types/.devenv'
14
+ export DEVENV_DOTFILE
15
+ outputDevdoc='REMOVE'
16
+ 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' )
17
+ IFS='
18
+ '
19
+ declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' )
20
+ declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' )
21
+ outputLib='out'
22
+ outputs='out'
23
+ export outputs
24
+ outputInclude='out'
25
+ OLDPWD=''
26
+ export OLDPWD
27
+ _substituteStream_has_warned_replace_deprecation='false'
28
+ depsBuildTarget=''
29
+ export depsBuildTarget
30
+ cmakeFlags=''
31
+ export cmakeFlags
32
+ doCheck=''
33
+ export doCheck
34
+ outputBin='out'
35
+ NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningextensive libcxxhardeningfast pic relro stackclashprotection stackprotector strictoverflow zerocallusedregs'
36
+ export NIX_HARDENING_ENABLE
37
+ patches=''
38
+ export patches
39
+ builder='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash'
40
+ export builder
41
+ propagatedBuildInputs=''
42
+ export propagatedBuildInputs
43
+ NIX_CFLAGS_COMPILE=' -frandom-seed=fncwiw8x7v -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/b3pq4ppjwbm34cq8mgfmkcbjp8xyqdxa-nodejs-slim-24.13.0-dev/include -isystem /nix/store/h4apbnz8p5fmjwcmzlaxcjm5vr70d97x-nodejs-slim-24.13.0/include -isystem /nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/include -isystem /nix/store/b3pq4ppjwbm34cq8mgfmkcbjp8xyqdxa-nodejs-slim-24.13.0-dev/include -isystem /nix/store/h4apbnz8p5fmjwcmzlaxcjm5vr70d97x-nodejs-slim-24.13.0/include'
44
+ export NIX_CFLAGS_COMPILE
45
+ declare -a pkgsBuildHost=('/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev' '/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9' '/nix/store/b3pq4ppjwbm34cq8mgfmkcbjp8xyqdxa-nodejs-slim-24.13.0-dev' '/nix/store/h4apbnz8p5fmjwcmzlaxcjm5vr70d97x-nodejs-slim-24.13.0' '/nix/store/jn9wngbhqmijdw4m2czilnhl4pw4jcdp-typescript-language-server-5.1.3' '/nix/store/8x49w8i0vafv34rlc6h4a0f7z0z2qpb5-git-2.53.0' '/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2' '/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2' '/nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-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/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0' '/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44' )
46
+ declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' )
47
+ NODE_PATH='/nix/store/jn9wngbhqmijdw4m2czilnhl4pw4jcdp-typescript-language-server-5.1.3/lib/node_modules'
48
+ export NODE_PATH
49
+ PKG_CONFIG_PATH='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev/lib/pkgconfig'
50
+ export PKG_CONFIG_PATH
51
+ declare -a envTargetTargetHooks=()
52
+ NIX_ENFORCE_NO_NATIVE='1'
53
+ export NIX_ENFORCE_NO_NATIVE
54
+ declare -a unpackCmdHooks=('_defaultUnpack' )
55
+ SIZE='size'
56
+ export SIZE
57
+ OSTYPE='linux-gnu'
58
+ outputInfo='out'
59
+ buildPhase='{ echo "------------------------------------------------------------";
60
+ echo " WARNING: the existence of this path is not guaranteed.";
61
+ echo " It is an internal implementation detail for pkgs.mkShell.";
62
+ echo "------------------------------------------------------------";
63
+ echo;
64
+ # Record all build inputs as runtime dependencies
65
+ export;
66
+ } >> "$out"
67
+ '
68
+ export buildPhase
69
+ nativeBuildInputs='/nix/store/pg04l21ca5xaif9hplyi09lhqxbipkcx-bash-interactive-5.3p9-dev /nix/store/b3pq4ppjwbm34cq8mgfmkcbjp8xyqdxa-nodejs-slim-24.13.0-dev /nix/store/jn9wngbhqmijdw4m2czilnhl4pw4jcdp-typescript-language-server-5.1.3 /nix/store/8x49w8i0vafv34rlc6h4a0f7z0z2qpb5-git-2.53.0 /nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2'
70
+ export nativeBuildInputs
71
+ depsTargetTarget=''
72
+ export depsTargetTarget
73
+ declare -a preConfigureHooks=('_multioutConfig' )
74
+ OPTERR='1'
75
+ NIX_CC='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0'
76
+ export NIX_CC
77
+ depsBuildTargetPropagated=''
78
+ export depsBuildTargetPropagated
79
+ buildInputs=''
80
+ export buildInputs
81
+ DEVENV_PROFILE='/nix/store/npbcw7r3h388y1c69h1y6xl14bwff2mq-devenv-profile'
82
+ export DEVENV_PROFILE
83
+ LINENO='79'
84
+ declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' )
85
+ DEVENV_TASKS=''
86
+ export DEVENV_TASKS
87
+ out='/nix/store/fncwiw8x7v34xsdjzglc3kna17hjwvqp-devenv-shell-env'
88
+ export out
89
+ NIX_LDFLAGS='-rpath /nix/store/fncwiw8x7v34xsdjzglc3kna17hjwvqp-devenv-shell-env/lib '
90
+ export NIX_LDFLAGS
91
+ hardeningDisable=''
92
+ export hardeningDisable
93
+ XDG_DATA_DIRS='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/share:/nix/store/h4apbnz8p5fmjwcmzlaxcjm5vr70d97x-nodejs-slim-24.13.0/share:/nix/store/8x49w8i0vafv34rlc6h4a0f7z0z2qpb5-git-2.53.0/share:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/share:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/share'
94
+ export XDG_DATA_DIRS
95
+ BASH='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash'
96
+ declare -a pkgsHostHost=()
97
+ declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' )
98
+ doInstallCheck=''
99
+ export doInstallCheck
100
+ declare -a envBuildTargetHooks=('addNodePath' )
101
+ NIX_NO_SELF_RPATH='1'
102
+ defaultBuildInputs=''
103
+ declare -a pkgsTargetTarget=()
104
+ system='x86_64-linux'
105
+ export system
106
+ PKG_CONFIG='pkg-config'
107
+ export PKG_CONFIG
108
+ outputDoc='out'
109
+ outputMan='out'
110
+ preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase'
111
+ depsBuildBuild=''
112
+ export depsBuildBuild
113
+ declare -a pkgsBuildTarget=()
114
+ depsHostHost=''
115
+ export depsHostHost
116
+ declare -a propagatedTargetDepFiles=('propagated-target-target-deps' )
117
+ __structuredAttrs=''
118
+ export __structuredAttrs
119
+ RANLIB='ranlib'
120
+ export RANLIB
121
+ depsBuildBuildPropagated=''
122
+ export depsBuildBuildPropagated
123
+ DEVENV_ROOT='/media/Code/@Open-iFunny/ifunny-api-types'
124
+ export DEVENV_ROOT
125
+ NM='nm'
126
+ export NM
127
+ DEVENV_TASK_FILE='/nix/store/nhydk1vfz2iflsibb9a71r86wcyflz49-tasks.json'
128
+ export DEVENV_TASK_FILE
129
+ NIX_STORE='/nix/store'
130
+ export NIX_STORE
131
+ IN_NIX_SHELL='impure'
132
+ export IN_NIX_SHELL
133
+ CXX='g++'
134
+ export CXX
135
+ declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' )
136
+ mesonFlags=''
137
+ export mesonFlags
138
+ DEVENV_STATE='/media/Code/@Open-iFunny/ifunny-api-types/.devenv/state'
139
+ export DEVENV_STATE
140
+ CONFIG_SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash'
141
+ export CONFIG_SHELL
142
+ initialPath='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10 /nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0 /nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12 /nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9 /nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12 /nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2 /nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35 /nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14 /nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin /nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1 /nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9 /nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8 /nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin /nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45'
143
+ propagatedNativeBuildInputs=''
144
+ export propagatedNativeBuildInputs
145
+ NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1'
146
+ export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
147
+ OBJDUMP='objdump'
148
+ export OBJDUMP
149
+ declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' )
150
+ stdenv='/nix/store/zkiy4zv8wz3v95bj6fdmkqwql8x1vnhb-stdenv-linux'
151
+ export stdenv
152
+ declare -a pkgsHostTarget=()
153
+ READELF='readelf'
154
+ export READELF
155
+ NIX_BINTOOLS='/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44'
156
+ export NIX_BINTOOLS
157
+ HOST_PATH='/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin'
158
+ export HOST_PATH
159
+ phases='buildPhase'
160
+ export phases
161
+ STRIP='strip'
162
+ export STRIP
163
+ declare -a pkgsBuildBuild=()
164
+ strictDeps=''
165
+ export strictDeps
166
+ HOSTTYPE='x86_64'
167
+ PATH='/nix/store/0550j0i8bmzxbcnzrg1g51zigj7y12ih-bash-interactive-5.3p9/bin:/nix/store/b3pq4ppjwbm34cq8mgfmkcbjp8xyqdxa-nodejs-slim-24.13.0-dev/bin:/nix/store/h4apbnz8p5fmjwcmzlaxcjm5vr70d97x-nodejs-slim-24.13.0/bin:/nix/store/jn9wngbhqmijdw4m2czilnhl4pw4jcdp-typescript-language-server-5.1.3/bin:/nix/store/8x49w8i0vafv34rlc6h4a0f7z0z2qpb5-git-2.53.0/bin:/nix/store/1nv3i8mpypy3d516f4pd95m0w72r73jy-pkg-config-wrapper-0.29.2/bin:/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2/bin:/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0/bin:/nix/store/sca0pf46jmxva40qahkcwys5c1lvk6n2-gcc-15.2.0/bin:/nix/store/2c48s343k15i0cmwb9cp1vi6randmzcw-glibc-2.42-51-bin/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/4yi6jj75bb5hhdzpzlxfyf69d35wsf2x-binutils-wrapper-2.44/bin:/nix/store/9nmzd62x45ayp4vmswvn6z45h6bzrsla-binutils-2.44/bin:/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin:/nix/store/b3rx5wac9hhfxn9120xkcvdwj51mc9z2-findutils-4.10.0/bin:/nix/store/icrrz26xbyp293kagrlkab1bhc6gra0r-diffutils-3.12/bin:/nix/store/wv7qq5yb8plyhxji9x3r5gpkyfm2kf29-gnused-4.9/bin:/nix/store/8laf6k81j9ckylrigj3xsk76j69knhvl-gnugrep-3.12/bin:/nix/store/gf7b4yz4vhd0y2hnnrimhh875ghwzzzj-gawk-5.3.2/bin:/nix/store/isva9q9zx3frx6hh6cnpihh1kd2bx6bk-gnutar-1.35/bin:/nix/store/w1n7yp2vnldr395hbwbcaw9sflh413bm-gzip-1.14/bin:/nix/store/x8l7qzpab2gpdrp89g48mxlrsiz4f0gm-bzip2-1.0.8-bin/bin:/nix/store/0xw6y53ijaqwfd9c99wyaqiinychzv1f-gnumake-4.4.1/bin:/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin:/nix/store/8y5jm97n4lyw80gh71yihghbhqc11fdz-patch-2.8/bin:/nix/store/27fx8p4k6098wan3zahdbyj79ndcn03z-xz-5.8.2-bin/bin:/nix/store/p3j7lphwlci13f9w2v4rav6rbvpi80li-file-5.45/bin'
168
+ export PATH
169
+ OBJCOPY='objcopy'
170
+ export OBJCOPY
171
+ name='devenv-shell-env'
172
+ export name
173
+ CC='gcc'
174
+ export CC
175
+ depsTargetTargetPropagated=''
176
+ export depsTargetTargetPropagated
177
+ STRINGS='strings'
178
+ export STRINGS
179
+ SOURCE_DATE_EPOCH='315532800'
180
+ export SOURCE_DATE_EPOCH
181
+ configureFlags=''
182
+ export configureFlags
183
+ NIX_BUILD_CORES='4'
184
+ export NIX_BUILD_CORES
185
+ dontAddDisableDepTrack='1'
186
+ export dontAddDisableDepTrack
187
+ prefix='/nix/store/fncwiw8x7v34xsdjzglc3kna17hjwvqp-devenv-shell-env'
188
+ DEVENV_RUNTIME='/run/user/1000/devenv-02bb315'
189
+ export DEVENV_RUNTIME
190
+ LD='ld'
191
+ export LD
192
+ MACHTYPE='x86_64-pc-linux-gnu'
193
+ preferLocalBuild='1'
194
+ export preferLocalBuild
195
+ PS4='+ '
196
+ shell='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash'
197
+ export shell
198
+ AR='ar'
199
+ export AR
200
+ SHELL='/nix/store/2hjsch59amjs3nbgh7ahcfzm2bfwl8zi-bash-5.3p9/bin/bash'
201
+ export SHELL
202
+ AS='as'
203
+ export AS
204
+ defaultNativeBuildInputs='/nix/store/590yx3aynyhs48jyk8ip37fk1mjqfhkb-patchelf-0.15.2 /nix/store/gz3rknshr1ywis4mjaqrgj3z2shp3n3v-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-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/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0'
205
+ shellHook='
206
+ export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}"
207
+
208
+ # Override temp directories that stdenv set to NIX_BUILD_TOP.
209
+ # Only reset those that still point to the Nix build dir; leave
210
+ # any user/CI-supplied value intact so child processes (e.g.
211
+ # `devenv processes wait`) compute the same runtime directory.
212
+ for var in TMP TMPDIR TEMP TEMPDIR; do
213
+ if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then
214
+ export "$var"=/tmp
215
+ fi
216
+ done
217
+ if [ -n "${NIX_BUILD_TOP-}" ]; then
218
+ unset NIX_BUILD_TOP
219
+ fi
220
+
221
+ # set path to locales on non-NixOS Linux hosts
222
+ if [ -z "${LOCALE_ARCHIVE-}" ]; then
223
+ export LOCALE_ARCHIVE=/nix/store/q6y3frkqaq8v7va2rmgaq6jvhy1vb9q3-glibc-locales-2.42-51/lib/locale/locale-archive
224
+ fi
225
+
226
+
227
+ # direnv helper
228
+ if [ ! type -p direnv &>/dev/null && -f .envrc ]; then
229
+ echo "An .envrc file was detected, but the direnv command is not installed."
230
+ echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html"
231
+ fi
232
+
233
+ mkdir -p "$DEVENV_STATE"
234
+ if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/hlxw2q9qansq7bn52xvlb5badw3z1v8s-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/npbcw7r3h388y1c69h1y6xl14bwff2mq-devenv-profile" ]
235
+ then
236
+ ln -snf /nix/store/npbcw7r3h388y1c69h1y6xl14bwff2mq-devenv-profile "$DEVENV_DOTFILE/profile"
237
+ fi
238
+ unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps
239
+
240
+ mkdir -p /run/user/1000/devenv-02bb315
241
+ ln -snf /run/user/1000/devenv-02bb315 /media/Code/@Open-iFunny/ifunny-api-types/.devenv/run
242
+
243
+
244
+ export PATH="node_modules/.bin:$PATH"
245
+
246
+
247
+
248
+ # Check whether the direnv integration is out of date.
249
+ {
250
+ if [[ ":${DIRENV_ACTIVE-}:" == *":/media/Code/@Open-iFunny/ifunny-api-types:"* ]]; then
251
+ if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then
252
+ if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then
253
+ direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "")
254
+
255
+ echo "✨ The direnv integration in your .envrc is out of date."
256
+ echo ""
257
+ echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. "
258
+ if [[ -n "$direnv_line" ]]; then
259
+ echo "To enable this feature, replace the following line in your .envrc:"
260
+ echo ""
261
+ echo " $direnv_line"
262
+ echo ""
263
+ echo "with:"
264
+ echo ""
265
+ echo " eval \"\$(devenv direnvrc)\""
266
+ else
267
+ echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:"
268
+ echo ""
269
+ echo " eval \"$(devenv direnvrc)\""
270
+ fi
271
+ echo ""
272
+ echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/."
273
+ echo ""
274
+ echo "To disable this message:"
275
+ echo ""
276
+ echo " Add the following environment to your .envrc before \`use devenv\`:"
277
+ echo ""
278
+ echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1"
279
+ echo ""
280
+ echo " Or set the following option in your devenv configuration:"
281
+ echo ""
282
+ echo " devenv.warnOnNewVersion = false;"
283
+ echo ""
284
+ fi
285
+ fi
286
+ fi
287
+ } >&2
288
+
289
+ git --version # Use packages
290
+
291
+ '
292
+ export shellHook
293
+ outputDev='out'
294
+ depsHostHostPropagated=''
295
+ export depsHostHostPropagated
296
+ declare -a envBuildHostHooks=('addNodePath' )
297
+ pkg='/nix/store/kbw2j1vag664b3sj3rjwz9v53cqx87sb-gcc-wrapper-15.2.0'
298
+ NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1'
299
+ export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu
300
+ outputDevman='out'
301
+ substituteInPlace ()
302
+ {
303
+
304
+ local -a fileNames=();
305
+ for arg in "$@";
306
+ do
307
+ if [[ "$arg" = "--"* ]]; then
308
+ break;
309
+ fi;
310
+ fileNames+=("$arg");
311
+ shift;
312
+ done;
313
+ if ! [[ "${#fileNames[@]}" -gt 0 ]]; then
314
+ echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2;
315
+ return 1;
316
+ fi;
317
+ for file in "${fileNames[@]}";
318
+ do
319
+ substitute "$file" "$file" "$@";
320
+ done
321
+ }
322
+ runOneHook ()
323
+ {
324
+
325
+ local hookName="$1";
326
+ shift;
327
+ local hooksSlice="${hookName%Hook}Hooks[@]";
328
+ local hook ret=1;
329
+ for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"};
330
+ do
331
+ _logHook "$hookName" "$hook" "$@";
332
+ if _eval "$hook" "$@"; then
333
+ ret=0;
334
+ break;
335
+ fi;
336
+ done;
337
+ return "$ret"
338
+ }
339
+ getTargetRole ()
340
+ {
341
+
342
+ getRole "$targetOffset"
343
+ }
344
+ runHook ()
345
+ {
346
+
347
+ local hookName="$1";
348
+ shift;
349
+ local hooksSlice="${hookName%Hook}Hooks[@]";
350
+ local hook;
351
+ for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"};
352
+ do
353
+ _logHook "$hookName" "$hook" "$@";
354
+ _eval "$hook" "$@";
355
+ done;
356
+ return 0
357
+ }
358
+ concatStringsSep ()
359
+ {
360
+
361
+ local sep="$1";
362
+ local name="$2";
363
+ local type oldifs;
364
+ if type=$(declare -p "$name" 2> /dev/null); then
365
+ local -n nameref="$name";
366
+ case "${type#* }" in
367
+ -A*)
368
+ echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2;
369
+ return 1
370
+ ;;
371
+ -a*)
372
+ local IFS="$(printf '\036')"
373
+ ;;
374
+ *)
375
+ local IFS=" "
376
+ ;;
377
+ esac;
378
+ local ifs_separated="${nameref[*]}";
379
+ echo -n "${ifs_separated//"$IFS"/"$sep"}";
380
+ fi
381
+ }
382
+ addToSearchPath ()
383
+ {
384
+
385
+ addToSearchPathWithCustomDelimiter ":" "$@"
386
+ }
387
+ genericBuild ()
388
+ {
389
+
390
+ export GZIP_NO_TIMESTAMPS=1;
391
+ if [ -f "${buildCommandPath:-}" ]; then
392
+ source "$buildCommandPath";
393
+ return;
394
+ fi;
395
+ if [ -n "${buildCommand:-}" ]; then
396
+ eval "$buildCommand";
397
+ return;
398
+ fi;
399
+ definePhases;
400
+ for curPhase in ${phases[*]};
401
+ do
402
+ runPhase "$curPhase";
403
+ done
404
+ }
405
+ _allFlags ()
406
+ {
407
+
408
+ export system pname name version;
409
+ while IFS='' read -r varName; do
410
+ nixTalkativeLog "@${varName}@ -> ${!varName}";
411
+ args+=("--subst-var" "$varName");
412
+ done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }')
413
+ }
414
+ addEnvHooks ()
415
+ {
416
+
417
+ local depHostOffset="$1";
418
+ shift;
419
+ local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]";
420
+ local pkgHookVar;
421
+ for pkgHookVar in "${!pkgHookVarsSlice}";
422
+ do
423
+ eval "${pkgHookVar}s"'+=("$@")';
424
+ done
425
+ }
426
+ exitHandler ()
427
+ {
428
+
429
+ exitCode="$?";
430
+ set +e;
431
+ if [ -n "${showBuildStats:-}" ]; then
432
+ read -r -d '' -a buildTimes < <(times);
433
+ echo "build times:";
434
+ echo "user time for the shell ${buildTimes[0]}";
435
+ echo "system time for the shell ${buildTimes[1]}";
436
+ echo "user time for all child processes ${buildTimes[2]}";
437
+ echo "system time for all child processes ${buildTimes[3]}";
438
+ fi;
439
+ if (( "$exitCode" != 0 )); then
440
+ runHook failureHook;
441
+ if [ -n "${succeedOnFailure:-}" ]; then
442
+ echo "build failed with exit code $exitCode (ignored)";
443
+ mkdir -p "$out/nix-support";
444
+ printf "%s" "$exitCode" > "$out/nix-support/failed";
445
+ exit 0;
446
+ fi;
447
+ else
448
+ runHook exitHook;
449
+ fi;
450
+ return "$exitCode"
451
+ }
452
+ installPhase ()
453
+ {
454
+
455
+ runHook preInstall;
456
+ if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then
457
+ echo "no Makefile or custom installPhase, doing nothing";
458
+ runHook postInstall;
459
+ return;
460
+ else
461
+ foundMakefile=1;
462
+ fi;
463
+ if [ -n "$prefix" ]; then
464
+ mkdir -p "$prefix";
465
+ fi;
466
+ local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL");
467
+ concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install;
468
+ echoCmd 'install flags' "${flagsArray[@]}";
469
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
470
+ unset flagsArray;
471
+ runHook postInstall
472
+ }
473
+ substituteStream ()
474
+ {
475
+
476
+ local var=$1;
477
+ local description=$2;
478
+ shift 2;
479
+ while (( "$#" )); do
480
+ local replace_mode="$1";
481
+ case "$1" in
482
+ --replace)
483
+ if ! "$_substituteStream_has_warned_replace_deprecation"; then
484
+ echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2;
485
+ _substituteStream_has_warned_replace_deprecation=true;
486
+ fi;
487
+ replace_mode='--replace-warn'
488
+ ;&
489
+ --replace-quiet | --replace-warn | --replace-fail)
490
+ pattern="$2";
491
+ replacement="$3";
492
+ shift 3;
493
+ if ! [[ "${!var}" == *"$pattern"* ]]; then
494
+ if [ "$replace_mode" == --replace-warn ]; then
495
+ printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2;
496
+ else
497
+ if [ "$replace_mode" == --replace-fail ]; then
498
+ printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2;
499
+ return 1;
500
+ fi;
501
+ fi;
502
+ fi;
503
+ eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
504
+ ;;
505
+ --subst-var)
506
+ local varName="$2";
507
+ shift 2;
508
+ if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then
509
+ echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2;
510
+ return 1;
511
+ fi;
512
+ if [ -z ${!varName+x} ]; then
513
+ echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2;
514
+ return 1;
515
+ fi;
516
+ pattern="@$varName@";
517
+ replacement="${!varName}";
518
+ eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
519
+ ;;
520
+ --subst-var-by)
521
+ pattern="@$2@";
522
+ replacement="$3";
523
+ eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}';
524
+ shift 3
525
+ ;;
526
+ *)
527
+ echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2;
528
+ return 1
529
+ ;;
530
+ esac;
531
+ done;
532
+ printf "%s" "${!var}"
533
+ }
534
+ substituteAllInPlace ()
535
+ {
536
+
537
+ local fileName="$1";
538
+ shift;
539
+ substituteAll "$fileName" "$fileName" "$@"
540
+ }
541
+ substituteAll ()
542
+ {
543
+
544
+ local input="$1";
545
+ local output="$2";
546
+ local -a args=();
547
+ _allFlags;
548
+ substitute "$input" "$output" "${args[@]}"
549
+ }
550
+ _defaultUnpack ()
551
+ {
552
+
553
+ local fn="$1";
554
+ local destination;
555
+ if [ -d "$fn" ]; then
556
+ destination="$(stripHash "$fn")";
557
+ if [ -e "$destination" ]; then
558
+ echo "Cannot copy $fn to $destination: destination already exists!";
559
+ echo "Did you specify two \"srcs\" with the same \"name\"?";
560
+ return 1;
561
+ fi;
562
+ cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination";
563
+ else
564
+ case "$fn" in
565
+ *.tar.xz | *.tar.lzma | *.txz)
566
+ ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn";
567
+ true ) | tar xf - --mode=+w --warning=no-timestamp
568
+ ;;
569
+ *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz)
570
+ tar xf "$fn" --mode=+w --warning=no-timestamp
571
+ ;;
572
+ *)
573
+ return 1
574
+ ;;
575
+ esac;
576
+ fi
577
+ }
578
+ distPhase ()
579
+ {
580
+
581
+ runHook preDist;
582
+ local flagsArray=();
583
+ concatTo flagsArray distFlags distFlagsArray distTarget=dist;
584
+ echo 'dist flags: %q' "${flagsArray[@]}";
585
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
586
+ if [ "${dontCopyDist:-0}" != 1 ]; then
587
+ mkdir -p "$out/tarballs";
588
+ cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs";
589
+ fi;
590
+ runHook postDist
591
+ }
592
+ nixWarnLog ()
593
+ {
594
+
595
+ _nixLogWithLevel 1 "$*"
596
+ }
597
+ printPhases ()
598
+ {
599
+
600
+ definePhases;
601
+ local phase;
602
+ for phase in ${phases[*]};
603
+ do
604
+ printf '%s\n' "$phase";
605
+ done
606
+ }
607
+ _makeSymlinksRelative ()
608
+ {
609
+
610
+ local prefixes;
611
+ prefixes=();
612
+ for output in $(getAllOutputNames);
613
+ do
614
+ [ ! -e "${!output}" ] && continue;
615
+ prefixes+=("${!output}");
616
+ done;
617
+ find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c '
618
+ output="$1"
619
+ link="$2"
620
+
621
+ linkTarget=$(readlink "$link")
622
+
623
+ # only touch links that point inside the same output tree
624
+ [[ $linkTarget == "$output"/* ]] || exit 0
625
+
626
+ if [ ! -e "$linkTarget" ]; then
627
+ echo "the symlink $link is broken, it points to $linkTarget (which is missing)"
628
+ fi
629
+
630
+ echo "making symlink relative: $link"
631
+ ln -snrf "$linkTarget" "$link"
632
+ ' _
633
+ }
634
+ _moveSystemdUserUnits ()
635
+ {
636
+
637
+ if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then
638
+ return;
639
+ fi;
640
+ if [ ! -e "${prefix:?}/lib/systemd/user" ]; then
641
+ return;
642
+ fi;
643
+ local source="$prefix/lib/systemd/user";
644
+ local target="$prefix/share/systemd/user";
645
+ echo "moving $source/* to $target";
646
+ mkdir -p "$target";
647
+ ( shopt -s dotglob;
648
+ for i in "$source"/*;
649
+ do
650
+ mv "$i" "$target";
651
+ done );
652
+ rmdir "$source";
653
+ ln -s "$target" "$source"
654
+ }
655
+ isScript ()
656
+ {
657
+
658
+ local fn="$1";
659
+ local fd;
660
+ local magic;
661
+ exec {fd}< "$fn";
662
+ LANG=C read -r -n 2 -u "$fd" magic;
663
+ exec {fd}>&-;
664
+ if [[ "$magic" =~ \#! ]]; then
665
+ return 0;
666
+ else
667
+ return 1;
668
+ fi
669
+ }
670
+ substitute ()
671
+ {
672
+
673
+ local input="$1";
674
+ local output="$2";
675
+ shift 2;
676
+ if [ ! -f "$input" ]; then
677
+ echo "substitute(): ERROR: file '$input' does not exist" 1>&2;
678
+ return 1;
679
+ fi;
680
+ local content;
681
+ consumeEntire content < "$input";
682
+ if [ -e "$output" ]; then
683
+ chmod +w "$output";
684
+ fi;
685
+ substituteStream content "file '$input'" "$@" > "$output"
686
+ }
687
+ showPhaseHeader ()
688
+ {
689
+
690
+ local phase="$1";
691
+ echo "Running phase: $phase";
692
+ if [[ -z ${NIX_LOG_FD-} ]]; then
693
+ return;
694
+ fi;
695
+ printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD"
696
+ }
697
+ bintoolsWrapper_addLDVars ()
698
+ {
699
+
700
+ local role_post;
701
+ getHostRoleEnvHook;
702
+ if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then
703
+ export NIX_LDFLAGS${role_post}+=" -L$1/lib64";
704
+ fi;
705
+ if [[ -d "$1/lib" ]]; then
706
+ local -a glob=($1/lib/lib*);
707
+ if [ "${#glob[*]}" -gt 0 ]; then
708
+ export NIX_LDFLAGS${role_post}+=" -L$1/lib";
709
+ fi;
710
+ fi
711
+ }
712
+ getHostRole ()
713
+ {
714
+
715
+ getRole "$hostOffset"
716
+ }
717
+ getRole ()
718
+ {
719
+
720
+ case $1 in
721
+ -1)
722
+ role_post='_FOR_BUILD'
723
+ ;;
724
+ 0)
725
+ role_post=''
726
+ ;;
727
+ 1)
728
+ role_post='_FOR_TARGET'
729
+ ;;
730
+ *)
731
+ echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2;
732
+ return 1
733
+ ;;
734
+ esac
735
+ }
736
+ stripHash ()
737
+ {
738
+
739
+ local strippedName casematchOpt=0;
740
+ strippedName="$(basename -- "$1")";
741
+ shopt -q nocasematch && casematchOpt=1;
742
+ shopt -u nocasematch;
743
+ if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then
744
+ echo "${strippedName:33}";
745
+ else
746
+ echo "$strippedName";
747
+ fi;
748
+ if (( casematchOpt )); then
749
+ shopt -s nocasematch;
750
+ fi
751
+ }
752
+ fixLibtool ()
753
+ {
754
+
755
+ local search_path;
756
+ for flag in $NIX_LDFLAGS;
757
+ do
758
+ case $flag in
759
+ -L*)
760
+ search_path+=" ${flag#-L}"
761
+ ;;
762
+ esac;
763
+ done;
764
+ sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^'
765
+ }
766
+ nixVomitLog ()
767
+ {
768
+
769
+ _nixLogWithLevel 7 "$*"
770
+ }
771
+ _activatePkgs ()
772
+ {
773
+
774
+ local hostOffset targetOffset;
775
+ local pkg;
776
+ for hostOffset in "${allPlatOffsets[@]}";
777
+ do
778
+ local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}";
779
+ for targetOffset in "${allPlatOffsets[@]}";
780
+ do
781
+ (( hostOffset <= targetOffset )) || continue;
782
+ local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]";
783
+ local pkgsSlice="${!pkgsRef}[@]";
784
+ for pkg in ${!pkgsSlice+"${!pkgsSlice}"};
785
+ do
786
+ activatePackage "$pkg" "$hostOffset" "$targetOffset";
787
+ done;
788
+ done;
789
+ done
790
+ }
791
+ _callImplicitHook ()
792
+ {
793
+
794
+ local def="$1";
795
+ local hookName="$2";
796
+ if declare -F "$hookName" > /dev/null; then
797
+ nixTalkativeLog "calling implicit '$hookName' function hook";
798
+ "$hookName";
799
+ else
800
+ if type -p "$hookName" > /dev/null; then
801
+ nixTalkativeLog "sourcing implicit '$hookName' script hook";
802
+ source "$hookName";
803
+ else
804
+ if [ -n "${!hookName:-}" ]; then
805
+ nixTalkativeLog "evaling implicit '$hookName' string hook";
806
+ eval "${!hookName}";
807
+ else
808
+ return "$def";
809
+ fi;
810
+ fi;
811
+ fi
812
+ }
813
+ getHostRoleEnvHook ()
814
+ {
815
+
816
+ getRole "$depHostOffset"
817
+ }
818
+ patchELF ()
819
+ {
820
+
821
+ local dir="$1";
822
+ [ -e "$dir" ] || return 0;
823
+ echo "shrinking RPATHs of ELF executables and libraries in $dir";
824
+ local i;
825
+ while IFS= read -r -d '' i; do
826
+ if [[ "$i" =~ .build-id ]]; then
827
+ continue;
828
+ fi;
829
+ if ! isELF "$i"; then
830
+ continue;
831
+ fi;
832
+ echo "shrinking $i";
833
+ patchelf --shrink-rpath "$i" || true;
834
+ done < <(find "$dir" -type f -print0)
835
+ }
836
+ pkgConfigWrapper_addPkgConfigPath ()
837
+ {
838
+
839
+ local role_post;
840
+ getHostRoleEnvHook;
841
+ addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig";
842
+ addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig"
843
+ }
844
+ isELF ()
845
+ {
846
+
847
+ local fn="$1";
848
+ local fd;
849
+ local magic;
850
+ exec {fd}< "$fn";
851
+ LANG=C read -r -n 4 -u "$fd" magic;
852
+ exec {fd}>&-;
853
+ if [ "$magic" = 'ELF' ]; then
854
+ return 0;
855
+ else
856
+ return 1;
857
+ fi
858
+ }
859
+ nixErrorLog ()
860
+ {
861
+
862
+ _nixLogWithLevel 0 "$*"
863
+ }
864
+ _multioutPropagateDev ()
865
+ {
866
+
867
+ if [ "$(getAllOutputNames)" = "out" ]; then
868
+ return;
869
+ fi;
870
+ local outputFirst;
871
+ for outputFirst in $(getAllOutputNames);
872
+ do
873
+ break;
874
+ done;
875
+ local propagaterOutput="$outputDev";
876
+ if [ -z "$propagaterOutput" ]; then
877
+ propagaterOutput="$outputFirst";
878
+ fi;
879
+ if [ -z "${propagatedBuildOutputs+1}" ]; then
880
+ local po_dirty="$outputBin $outputInclude $outputLib";
881
+ set +o pipefail;
882
+ propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `;
883
+ set -o pipefail;
884
+ fi;
885
+ if [ -z "$propagatedBuildOutputs" ]; then
886
+ return;
887
+ fi;
888
+ mkdir -p "${!propagaterOutput}"/nix-support;
889
+ for output in $propagatedBuildOutputs;
890
+ do
891
+ echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs;
892
+ done
893
+ }
894
+ moveToOutput ()
895
+ {
896
+
897
+ local patt="$1";
898
+ local dstOut="$2";
899
+ local output;
900
+ for output in $(getAllOutputNames);
901
+ do
902
+ if [ "${!output}" = "$dstOut" ]; then
903
+ continue;
904
+ fi;
905
+ local srcPath;
906
+ for srcPath in "${!output}"/$patt;
907
+ do
908
+ if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then
909
+ continue;
910
+ fi;
911
+ if [ "$dstOut" = REMOVE ]; then
912
+ echo "Removing $srcPath";
913
+ rm -r "$srcPath";
914
+ else
915
+ local dstPath="$dstOut${srcPath#${!output}}";
916
+ echo "Moving $srcPath to $dstPath";
917
+ if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then
918
+ rmdir "$srcPath" --ignore-fail-on-non-empty;
919
+ if [ -d "$srcPath" ]; then
920
+ mv -t "$dstPath" "$srcPath"/*;
921
+ rmdir "$srcPath";
922
+ fi;
923
+ else
924
+ mkdir -p "$(readlink -m "$dstPath/..")";
925
+ mv "$srcPath" "$dstPath";
926
+ fi;
927
+ fi;
928
+ local srcParent="$(readlink -m "$srcPath/..")";
929
+ if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then
930
+ echo "Removing empty $srcParent/ and (possibly) its parents";
931
+ rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true;
932
+ fi;
933
+ done;
934
+ done
935
+ }
936
+ installCheckPhase ()
937
+ {
938
+
939
+ runHook preInstallCheck;
940
+ if [[ -z "${foundMakefile:-}" ]]; then
941
+ echo "no Makefile or custom installCheckPhase, doing nothing";
942
+ else
943
+ if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then
944
+ echo "no installcheck target in ${makefile:-Makefile}, doing nothing";
945
+ else
946
+ local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL");
947
+ concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck;
948
+ echoCmd 'installcheck flags' "${flagsArray[@]}";
949
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
950
+ unset flagsArray;
951
+ fi;
952
+ fi;
953
+ runHook postInstallCheck
954
+ }
955
+ printWords ()
956
+ {
957
+
958
+ (( "$#" > 0 )) || return 0;
959
+ printf '%s ' "$@"
960
+ }
961
+ _assignFirst ()
962
+ {
963
+
964
+ local varName="$1";
965
+ local _var;
966
+ local REMOVE=REMOVE;
967
+ shift;
968
+ for _var in "$@";
969
+ do
970
+ if [ -n "${!_var-}" ]; then
971
+ eval "${varName}"="${_var}";
972
+ return;
973
+ fi;
974
+ done;
975
+ echo;
976
+ echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}.";
977
+ echo " The following variables were all unset or empty:";
978
+ echo " $*";
979
+ if [ -z "${out:-}" ]; then
980
+ echo ' If you do not want an "out" output in your derivation, make sure to define';
981
+ echo ' the other specific required outputs. This can be achieved by picking one';
982
+ echo " of the above as an output.";
983
+ echo ' You do not have to remove "out" if you want to have a different default';
984
+ echo ' output, because the first output is taken as a default.';
985
+ echo;
986
+ fi;
987
+ return 1
988
+ }
989
+ echoCmd ()
990
+ {
991
+
992
+ printf "%s:" "$1";
993
+ shift;
994
+ printf ' %q' "$@";
995
+ echo
996
+ }
997
+ nixInfoLog ()
998
+ {
999
+
1000
+ _nixLogWithLevel 3 "$*"
1001
+ }
1002
+ prependToVar ()
1003
+ {
1004
+
1005
+ local -n nameref="$1";
1006
+ local useArray type;
1007
+ if [ -n "$__structuredAttrs" ]; then
1008
+ useArray=true;
1009
+ else
1010
+ useArray=false;
1011
+ fi;
1012
+ if type=$(declare -p "$1" 2> /dev/null); then
1013
+ case "${type#* }" in
1014
+ -A*)
1015
+ echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2;
1016
+ return 1
1017
+ ;;
1018
+ -a*)
1019
+ useArray=true
1020
+ ;;
1021
+ *)
1022
+ useArray=false
1023
+ ;;
1024
+ esac;
1025
+ fi;
1026
+ shift;
1027
+ if $useArray; then
1028
+ nameref=("$@" ${nameref+"${nameref[@]}"});
1029
+ else
1030
+ nameref="$* ${nameref-}";
1031
+ fi
1032
+ }
1033
+ noBrokenSymlinks ()
1034
+ {
1035
+
1036
+ local -r output="${1:?}";
1037
+ local path;
1038
+ local pathParent;
1039
+ local symlinkTarget;
1040
+ local -i numDanglingSymlinks=0;
1041
+ local -i numReflexiveSymlinks=0;
1042
+ local -i numUnreadableSymlinks=0;
1043
+ if [[ ! -e $output ]]; then
1044
+ nixWarnLog "skipping non-existent output $output";
1045
+ return 0;
1046
+ fi;
1047
+ nixInfoLog "running on $output";
1048
+ while IFS= read -r -d '' path; do
1049
+ pathParent="$(dirname "$path")";
1050
+ if ! symlinkTarget="$(readlink "$path")"; then
1051
+ nixErrorLog "the symlink $path is unreadable";
1052
+ numUnreadableSymlinks+=1;
1053
+ continue;
1054
+ fi;
1055
+ if [[ $symlinkTarget == /* ]]; then
1056
+ nixInfoLog "symlink $path points to absolute target $symlinkTarget";
1057
+ else
1058
+ nixInfoLog "symlink $path points to relative target $symlinkTarget";
1059
+ symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")";
1060
+ fi;
1061
+ if [[ $symlinkTarget = "$TMPDIR"/* ]]; then
1062
+ nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget";
1063
+ numDanglingSymlinks+=1;
1064
+ continue;
1065
+ fi;
1066
+ if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then
1067
+ nixInfoLog "symlink $path points outside the Nix store; ignoring";
1068
+ continue;
1069
+ fi;
1070
+ if [[ $path == "$symlinkTarget" ]]; then
1071
+ nixErrorLog "the symlink $path is reflexive";
1072
+ numReflexiveSymlinks+=1;
1073
+ else
1074
+ if [[ ! -e $symlinkTarget ]]; then
1075
+ nixErrorLog "the symlink $path points to a missing target: $symlinkTarget";
1076
+ numDanglingSymlinks+=1;
1077
+ else
1078
+ nixDebugLog "the symlink $path is irreflexive and points to a target which exists";
1079
+ fi;
1080
+ fi;
1081
+ done < <(find "$output" -type l -print0);
1082
+ if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then
1083
+ nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks";
1084
+ exit 1;
1085
+ fi;
1086
+ return 0
1087
+ }
1088
+ getTargetRoleEnvHook ()
1089
+ {
1090
+
1091
+ getRole "$depTargetOffset"
1092
+ }
1093
+ nixDebugLog ()
1094
+ {
1095
+
1096
+ _nixLogWithLevel 6 "$*"
1097
+ }
1098
+ nixTalkativeLog ()
1099
+ {
1100
+
1101
+ _nixLogWithLevel 4 "$*"
1102
+ }
1103
+ _multioutDevs ()
1104
+ {
1105
+
1106
+ if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then
1107
+ return;
1108
+ fi;
1109
+ moveToOutput include "${!outputInclude}";
1110
+ moveToOutput lib/pkgconfig "${!outputDev}";
1111
+ moveToOutput share/pkgconfig "${!outputDev}";
1112
+ moveToOutput lib/cmake "${!outputDev}";
1113
+ moveToOutput share/aclocal "${!outputDev}";
1114
+ for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc;
1115
+ do
1116
+ echo "Patching '$f' includedir to output ${!outputInclude}";
1117
+ sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f";
1118
+ done
1119
+ }
1120
+ noBrokenSymlinksInAllOutputs ()
1121
+ {
1122
+
1123
+ if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then
1124
+ for output in $(getAllOutputNames);
1125
+ do
1126
+ noBrokenSymlinks "${!output}";
1127
+ done;
1128
+ fi
1129
+ }
1130
+ fixupPhase ()
1131
+ {
1132
+
1133
+ local output;
1134
+ for output in $(getAllOutputNames);
1135
+ do
1136
+ if [ -e "${!output}" ]; then
1137
+ chmod -R u+w,u-s,g-s "${!output}";
1138
+ fi;
1139
+ done;
1140
+ runHook preFixup;
1141
+ local output;
1142
+ for output in $(getAllOutputNames);
1143
+ do
1144
+ prefix="${!output}" runHook fixupOutput;
1145
+ done;
1146
+ recordPropagatedDependencies;
1147
+ if [ -n "${setupHook:-}" ]; then
1148
+ mkdir -p "${!outputDev}/nix-support";
1149
+ substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook";
1150
+ fi;
1151
+ if [ -n "${setupHooks:-}" ]; then
1152
+ mkdir -p "${!outputDev}/nix-support";
1153
+ local hook;
1154
+ for hook in ${setupHooks[@]};
1155
+ do
1156
+ local content;
1157
+ consumeEntire content < "$hook";
1158
+ substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook";
1159
+ unset -v content;
1160
+ done;
1161
+ unset -v hook;
1162
+ fi;
1163
+ if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then
1164
+ mkdir -p "${!outputBin}/nix-support";
1165
+ printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages";
1166
+ fi;
1167
+ runHook postFixup
1168
+ }
1169
+ definePhases ()
1170
+ {
1171
+
1172
+ if [ -z "${phases[*]:-}" ]; then
1173
+ phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}";
1174
+ fi
1175
+ }
1176
+ mapOffset ()
1177
+ {
1178
+
1179
+ local -r inputOffset="$1";
1180
+ local -n outputOffset="$2";
1181
+ if (( inputOffset <= 0 )); then
1182
+ outputOffset=$((inputOffset + hostOffset));
1183
+ else
1184
+ outputOffset=$((inputOffset - 1 + targetOffset));
1185
+ fi
1186
+ }
1187
+ checkPhase ()
1188
+ {
1189
+
1190
+ runHook preCheck;
1191
+ if [[ -z "${foundMakefile:-}" ]]; then
1192
+ echo "no Makefile or custom checkPhase, doing nothing";
1193
+ runHook postCheck;
1194
+ return;
1195
+ fi;
1196
+ if [[ -z "${checkTarget:-}" ]]; then
1197
+ if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then
1198
+ checkTarget="check";
1199
+ else
1200
+ if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then
1201
+ checkTarget="test";
1202
+ fi;
1203
+ fi;
1204
+ fi;
1205
+ if [[ -z "${checkTarget:-}" ]]; then
1206
+ echo "no check/test target in ${makefile:-Makefile}, doing nothing";
1207
+ else
1208
+ local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL");
1209
+ concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget;
1210
+ echoCmd 'check flags' "${flagsArray[@]}";
1211
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
1212
+ unset flagsArray;
1213
+ fi;
1214
+ runHook postCheck
1215
+ }
1216
+ patchPhase ()
1217
+ {
1218
+
1219
+ runHook prePatch;
1220
+ local -a patchesArray;
1221
+ concatTo patchesArray patches;
1222
+ local -a flagsArray;
1223
+ concatTo flagsArray patchFlags=-p1;
1224
+ for i in "${patchesArray[@]}";
1225
+ do
1226
+ echo "applying patch $i";
1227
+ local uncompress=cat;
1228
+ case "$i" in
1229
+ *.gz)
1230
+ uncompress="gzip -d"
1231
+ ;;
1232
+ *.bz2)
1233
+ uncompress="bzip2 -d"
1234
+ ;;
1235
+ *.xz)
1236
+ uncompress="xz -d"
1237
+ ;;
1238
+ *.lzma)
1239
+ uncompress="lzma -d"
1240
+ ;;
1241
+ esac;
1242
+ $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}";
1243
+ done;
1244
+ runHook postPatch
1245
+ }
1246
+ recordPropagatedDependencies ()
1247
+ {
1248
+
1249
+ declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated);
1250
+ declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}");
1251
+ local propagatedInputsIndex;
1252
+ for propagatedInputsIndex in "${!flatVars[@]}";
1253
+ do
1254
+ local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]";
1255
+ local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}";
1256
+ [[ -n "${!propagatedInputsSlice}" ]] || continue;
1257
+ mkdir -p "${!outputDev}/nix-support";
1258
+ printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile";
1259
+ done
1260
+ }
1261
+ _updateSourceDateEpochFromSourceRoot ()
1262
+ {
1263
+
1264
+ if [ -n "$sourceRoot" ]; then
1265
+ updateSourceDateEpoch "$sourceRoot";
1266
+ fi
1267
+ }
1268
+ substituteAllStream ()
1269
+ {
1270
+
1271
+ local -a args=();
1272
+ _allFlags;
1273
+ substituteStream "$1" "$2" "${args[@]}"
1274
+ }
1275
+ unpackFile ()
1276
+ {
1277
+
1278
+ curSrc="$1";
1279
+ echo "unpacking source archive $curSrc";
1280
+ if ! runOneHook unpackCmd "$curSrc"; then
1281
+ echo "do not know how to unpack source archive $curSrc";
1282
+ exit 1;
1283
+ fi
1284
+ }
1285
+ findInputs ()
1286
+ {
1287
+
1288
+ local -r pkg="$1";
1289
+ local -r hostOffset="$2";
1290
+ local -r targetOffset="$3";
1291
+ (( hostOffset <= targetOffset )) || exit 1;
1292
+ local varVar="${pkgAccumVarVars[hostOffset + 1]}";
1293
+ local varRef="$varVar[$((targetOffset - hostOffset))]";
1294
+ local var="${!varRef}";
1295
+ unset -v varVar varRef;
1296
+ local varSlice="$var[*]";
1297
+ case " ${!varSlice-} " in
1298
+ *" $pkg "*)
1299
+ return 0
1300
+ ;;
1301
+ esac;
1302
+ unset -v varSlice;
1303
+ eval "$var"'+=("$pkg")';
1304
+ if ! [ -e "$pkg" ]; then
1305
+ echo "build input $pkg does not exist" 1>&2;
1306
+ exit 1;
1307
+ fi;
1308
+ function mapOffset ()
1309
+ {
1310
+ local -r inputOffset="$1";
1311
+ local -n outputOffset="$2";
1312
+ if (( inputOffset <= 0 )); then
1313
+ outputOffset=$((inputOffset + hostOffset));
1314
+ else
1315
+ outputOffset=$((inputOffset - 1 + targetOffset));
1316
+ fi
1317
+ };
1318
+ local relHostOffset;
1319
+ for relHostOffset in "${allPlatOffsets[@]}";
1320
+ do
1321
+ local files="${propagatedDepFilesVars[relHostOffset + 1]}";
1322
+ local hostOffsetNext;
1323
+ mapOffset "$relHostOffset" hostOffsetNext;
1324
+ (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue;
1325
+ local relTargetOffset;
1326
+ for relTargetOffset in "${allPlatOffsets[@]}";
1327
+ do
1328
+ (( "$relHostOffset" <= "$relTargetOffset" )) || continue;
1329
+ local fileRef="${files}[$relTargetOffset - $relHostOffset]";
1330
+ local file="${!fileRef}";
1331
+ unset -v fileRef;
1332
+ local targetOffsetNext;
1333
+ mapOffset "$relTargetOffset" targetOffsetNext;
1334
+ (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue;
1335
+ [[ -f "$pkg/nix-support/$file" ]] || continue;
1336
+ local pkgNext;
1337
+ read -r -d '' pkgNext < "$pkg/nix-support/$file" || true;
1338
+ for pkgNext in $pkgNext;
1339
+ do
1340
+ findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext";
1341
+ done;
1342
+ done;
1343
+ done
1344
+ }
1345
+ addToSearchPathWithCustomDelimiter ()
1346
+ {
1347
+
1348
+ local delimiter="$1";
1349
+ local varName="$2";
1350
+ local dir="$3";
1351
+ if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then
1352
+ export "${varName}=${!varName:+${!varName}${delimiter}}${dir}";
1353
+ fi
1354
+ }
1355
+ ccWrapper_addCVars ()
1356
+ {
1357
+
1358
+ local role_post;
1359
+ getHostRoleEnvHook;
1360
+ local found=;
1361
+ if [ -d "$1/include" ]; then
1362
+ export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include";
1363
+ found=1;
1364
+ fi;
1365
+ if [ -d "$1/Library/Frameworks" ]; then
1366
+ export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks";
1367
+ found=1;
1368
+ fi;
1369
+ if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then
1370
+ local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}";
1371
+ export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed";
1372
+ fi
1373
+ }
1374
+ unpackPhase ()
1375
+ {
1376
+
1377
+ runHook preUnpack;
1378
+ if [ -z "${srcs:-}" ]; then
1379
+ if [ -z "${src:-}" ]; then
1380
+ echo 'variable $src or $srcs should point to the source';
1381
+ exit 1;
1382
+ fi;
1383
+ srcs="$src";
1384
+ fi;
1385
+ local -a srcsArray;
1386
+ concatTo srcsArray srcs;
1387
+ local dirsBefore="";
1388
+ for i in *;
1389
+ do
1390
+ if [ -d "$i" ]; then
1391
+ dirsBefore="$dirsBefore $i ";
1392
+ fi;
1393
+ done;
1394
+ for i in "${srcsArray[@]}";
1395
+ do
1396
+ unpackFile "$i";
1397
+ done;
1398
+ : "${sourceRoot=}";
1399
+ if [ -n "${setSourceRoot:-}" ]; then
1400
+ runOneHook setSourceRoot;
1401
+ else
1402
+ if [ -z "$sourceRoot" ]; then
1403
+ for i in *;
1404
+ do
1405
+ if [ -d "$i" ]; then
1406
+ case $dirsBefore in
1407
+ *\ $i\ *)
1408
+
1409
+ ;;
1410
+ *)
1411
+ if [ -n "$sourceRoot" ]; then
1412
+ echo "unpacker produced multiple directories";
1413
+ exit 1;
1414
+ fi;
1415
+ sourceRoot="$i"
1416
+ ;;
1417
+ esac;
1418
+ fi;
1419
+ done;
1420
+ fi;
1421
+ fi;
1422
+ if [ -z "$sourceRoot" ]; then
1423
+ echo "unpacker appears to have produced no directories";
1424
+ exit 1;
1425
+ fi;
1426
+ echo "source root is $sourceRoot";
1427
+ if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then
1428
+ chmod -R u+w -- "$sourceRoot";
1429
+ fi;
1430
+ runHook postUnpack
1431
+ }
1432
+ _logHook ()
1433
+ {
1434
+
1435
+ if [[ -z ${NIX_LOG_FD-} ]]; then
1436
+ return;
1437
+ fi;
1438
+ local hookKind="$1";
1439
+ local hookExpr="$2";
1440
+ shift 2;
1441
+ if declare -F "$hookExpr" > /dev/null 2>&1; then
1442
+ nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@";
1443
+ else
1444
+ if type -p "$hookExpr" > /dev/null; then
1445
+ nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'";
1446
+ else
1447
+ if [[ "$hookExpr" != "_callImplicitHook"* ]]; then
1448
+ local exprToOutput;
1449
+ if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then
1450
+ exprToOutput="$hookExpr";
1451
+ else
1452
+ local hookExprLine;
1453
+ while IFS= read -r hookExprLine; do
1454
+ hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}";
1455
+ if [[ -n "$hookExprLine" ]]; then
1456
+ exprToOutput+="$hookExprLine\\n ";
1457
+ fi;
1458
+ done <<< "$hookExpr";
1459
+ exprToOutput="${exprToOutput%%\\n }";
1460
+ fi;
1461
+ nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'";
1462
+ fi;
1463
+ fi;
1464
+ fi
1465
+ }
1466
+ updateSourceDateEpoch ()
1467
+ {
1468
+
1469
+ local path="$1";
1470
+ [[ $path == -* ]] && path="./$path";
1471
+ 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));
1472
+ local time="${res[0]//\.[0-9]*/}";
1473
+ local newestFile="${res[1]}";
1474
+ if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then
1475
+ echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile";
1476
+ export SOURCE_DATE_EPOCH="$time";
1477
+ local now="$(date +%s)";
1478
+ if [ "$time" -gt $((now - 60)) ]; then
1479
+ echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic";
1480
+ fi;
1481
+ fi
1482
+ }
1483
+ _multioutDocs ()
1484
+ {
1485
+
1486
+ local REMOVE=REMOVE;
1487
+ moveToOutput share/info "${!outputInfo}";
1488
+ moveToOutput share/doc "${!outputDoc}";
1489
+ moveToOutput share/gtk-doc "${!outputDevdoc}";
1490
+ moveToOutput share/devhelp/books "${!outputDevdoc}";
1491
+ moveToOutput share/man "${!outputMan}";
1492
+ moveToOutput share/man/man3 "${!outputDevman}"
1493
+ }
1494
+ activatePackage ()
1495
+ {
1496
+
1497
+ local pkg="$1";
1498
+ local -r hostOffset="$2";
1499
+ local -r targetOffset="$3";
1500
+ (( hostOffset <= targetOffset )) || exit 1;
1501
+ if [ -f "$pkg" ]; then
1502
+ nixTalkativeLog "sourcing setup hook '$pkg'";
1503
+ source "$pkg";
1504
+ fi;
1505
+ if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then
1506
+ addToSearchPath _PATH "$pkg/bin";
1507
+ fi;
1508
+ if (( hostOffset <= -1 )); then
1509
+ addToSearchPath _XDG_DATA_DIRS "$pkg/share";
1510
+ fi;
1511
+ if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then
1512
+ addToSearchPath _HOST_PATH "$pkg/bin";
1513
+ fi;
1514
+ if [[ -f "$pkg/nix-support/setup-hook" ]]; then
1515
+ nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'";
1516
+ source "$pkg/nix-support/setup-hook";
1517
+ fi
1518
+ }
1519
+ compressManPages ()
1520
+ {
1521
+
1522
+ local dir="$1";
1523
+ if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then
1524
+ return;
1525
+ fi;
1526
+ echo "gzipping man pages under $dir/share/man/";
1527
+ find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f;
1528
+ find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do
1529
+ local target;
1530
+ target="$(readlink -f "$f")";
1531
+ if [ -f "$target".gz ]; then
1532
+ ln -sf "$target".gz "$f".gz && rm "$f";
1533
+ fi;
1534
+ done
1535
+ }
1536
+ _doStrip ()
1537
+ {
1538
+
1539
+ local -ra flags=(dontStripHost dontStripTarget);
1540
+ local -ra debugDirs=(stripDebugList stripDebugListTarget);
1541
+ local -ra allDirs=(stripAllList stripAllListTarget);
1542
+ local -ra stripCmds=(STRIP STRIP_FOR_TARGET);
1543
+ local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET);
1544
+ stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks};
1545
+ stripDebugListTarget=${stripDebugListTarget[*]:-};
1546
+ stripAllList=${stripAllList[*]:-};
1547
+ stripAllListTarget=${stripAllListTarget[*]:-};
1548
+ local i;
1549
+ for i in ${!stripCmds[@]};
1550
+ do
1551
+ local -n flag="${flags[$i]}";
1552
+ local -n debugDirList="${debugDirs[$i]}";
1553
+ local -n allDirList="${allDirs[$i]}";
1554
+ local -n stripCmd="${stripCmds[$i]}";
1555
+ local -n ranlibCmd="${ranlibCmds[$i]}";
1556
+ if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then
1557
+ continue;
1558
+ fi;
1559
+ stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}";
1560
+ stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}";
1561
+ done
1562
+ }
1563
+ _multioutConfig ()
1564
+ {
1565
+
1566
+ if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then
1567
+ return;
1568
+ fi;
1569
+ if [ -z "${shareDocName:-}" ]; then
1570
+ local confScript="${configureScript:-}";
1571
+ if [ -z "$confScript" ] && [ -x ./configure ]; then
1572
+ confScript=./configure;
1573
+ fi;
1574
+ if [ -f "$confScript" ]; then
1575
+ local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")";
1576
+ fi;
1577
+ if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then
1578
+ shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')";
1579
+ fi;
1580
+ fi;
1581
+ prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!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;
1582
+ prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal
1583
+ }
1584
+ dumpVars ()
1585
+ {
1586
+
1587
+ if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then
1588
+ local old_umask;
1589
+ old_umask=$(umask);
1590
+ umask 0077;
1591
+ export 2> /dev/null > "$NIX_BUILD_TOP/env-vars";
1592
+ umask "$old_umask";
1593
+ fi
1594
+ }
1595
+ nixChattyLog ()
1596
+ {
1597
+
1598
+ _nixLogWithLevel 5 "$*"
1599
+ }
1600
+ patchShebangsAuto ()
1601
+ {
1602
+
1603
+ if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then
1604
+ if [[ "$output" != out && "$output" = "$outputDev" ]]; then
1605
+ patchShebangs --build "$prefix";
1606
+ else
1607
+ patchShebangs --host "$prefix";
1608
+ fi;
1609
+ fi
1610
+ }
1611
+ showPhaseFooter ()
1612
+ {
1613
+
1614
+ local phase="$1";
1615
+ local startTime="$2";
1616
+ local endTime="$3";
1617
+ local delta=$(( endTime - startTime ));
1618
+ (( delta < 30 )) && return;
1619
+ local H=$((delta/3600));
1620
+ local M=$((delta%3600/60));
1621
+ local S=$((delta%60));
1622
+ echo -n "$phase completed in ";
1623
+ (( H > 0 )) && echo -n "$H hours ";
1624
+ (( M > 0 )) && echo -n "$M minutes ";
1625
+ echo "$S seconds"
1626
+ }
1627
+ _addToEnv ()
1628
+ {
1629
+
1630
+ local depHostOffset depTargetOffset;
1631
+ local pkg;
1632
+ for depHostOffset in "${allPlatOffsets[@]}";
1633
+ do
1634
+ local hookVar="${pkgHookVarVars[depHostOffset + 1]}";
1635
+ local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}";
1636
+ for depTargetOffset in "${allPlatOffsets[@]}";
1637
+ do
1638
+ (( depHostOffset <= depTargetOffset )) || continue;
1639
+ local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]";
1640
+ if [[ -z "${strictDeps-}" ]]; then
1641
+ local visitedPkgs="";
1642
+ for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}";
1643
+ do
1644
+ if [[ "$visitedPkgs" = *"$pkg"* ]]; then
1645
+ continue;
1646
+ fi;
1647
+ runHook "${!hookRef}" "$pkg";
1648
+ visitedPkgs+=" $pkg";
1649
+ done;
1650
+ else
1651
+ local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]";
1652
+ local pkgsSlice="${!pkgsRef}[@]";
1653
+ for pkg in ${!pkgsSlice+"${!pkgsSlice}"};
1654
+ do
1655
+ runHook "${!hookRef}" "$pkg";
1656
+ done;
1657
+ fi;
1658
+ done;
1659
+ done
1660
+ }
1661
+ getTargetRoleWrapper ()
1662
+ {
1663
+
1664
+ case $targetOffset in
1665
+ -1)
1666
+ export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1
1667
+ ;;
1668
+ 0)
1669
+ export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1
1670
+ ;;
1671
+ 1)
1672
+ export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1
1673
+ ;;
1674
+ *)
1675
+ echo "binutils-wrapper-2.44: used as improper sort of dependency" 1>&2;
1676
+ return 1
1677
+ ;;
1678
+ esac
1679
+ }
1680
+ _moveToShare ()
1681
+ {
1682
+
1683
+ if [ -n "$__structuredAttrs" ]; then
1684
+ if [ -z "${forceShare-}" ]; then
1685
+ forceShare=(man doc info);
1686
+ fi;
1687
+ else
1688
+ forceShare=(${forceShare:-man doc info});
1689
+ fi;
1690
+ if [[ -z "$out" ]]; then
1691
+ return;
1692
+ fi;
1693
+ for d in "${forceShare[@]}";
1694
+ do
1695
+ if [ -d "$out/$d" ]; then
1696
+ if [ -d "$out/share/$d" ]; then
1697
+ echo "both $d/ and share/$d/ exist!";
1698
+ else
1699
+ echo "moving $out/$d to $out/share/$d";
1700
+ mkdir -p $out/share;
1701
+ mv $out/$d $out/share/;
1702
+ fi;
1703
+ fi;
1704
+ done
1705
+ }
1706
+ printLines ()
1707
+ {
1708
+
1709
+ (( "$#" > 0 )) || return 0;
1710
+ printf '%s\n' "$@"
1711
+ }
1712
+ _moveLib64 ()
1713
+ {
1714
+
1715
+ if [ "${dontMoveLib64-}" = 1 ]; then
1716
+ return;
1717
+ fi;
1718
+ if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then
1719
+ return;
1720
+ fi;
1721
+ echo "moving $prefix/lib64/* to $prefix/lib";
1722
+ mkdir -p $prefix/lib;
1723
+ shopt -s dotglob;
1724
+ for i in $prefix/lib64/*;
1725
+ do
1726
+ mv --no-clobber "$i" $prefix/lib;
1727
+ done;
1728
+ shopt -u dotglob;
1729
+ rmdir $prefix/lib64;
1730
+ ln -s lib $prefix/lib64
1731
+ }
1732
+ getAllOutputNames ()
1733
+ {
1734
+
1735
+ if [ -n "$__structuredAttrs" ]; then
1736
+ echo "${!outputs[*]}";
1737
+ else
1738
+ echo "$outputs";
1739
+ fi
1740
+ }
1741
+ _eval ()
1742
+ {
1743
+
1744
+ if declare -F "$1" > /dev/null 2>&1; then
1745
+ "$@";
1746
+ else
1747
+ eval "$1";
1748
+ fi
1749
+ }
1750
+ _nixLogWithLevel ()
1751
+ {
1752
+
1753
+ [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0;
1754
+ local logLevel;
1755
+ case "${1:?}" in
1756
+ 0)
1757
+ logLevel=ERROR
1758
+ ;;
1759
+ 1)
1760
+ logLevel=WARN
1761
+ ;;
1762
+ 2)
1763
+ logLevel=NOTICE
1764
+ ;;
1765
+ 3)
1766
+ logLevel=INFO
1767
+ ;;
1768
+ 4)
1769
+ logLevel=TALKATIVE
1770
+ ;;
1771
+ 5)
1772
+ logLevel=CHATTY
1773
+ ;;
1774
+ 6)
1775
+ logLevel=DEBUG
1776
+ ;;
1777
+ 7)
1778
+ logLevel=VOMIT
1779
+ ;;
1780
+ *)
1781
+ echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD";
1782
+ return 1
1783
+ ;;
1784
+ esac;
1785
+ local callerName="${FUNCNAME[2]}";
1786
+ if [[ $callerName == "_callImplicitHook" ]]; then
1787
+ callerName="${hookName:?}";
1788
+ fi;
1789
+ printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD"
1790
+ }
1791
+ nixLog ()
1792
+ {
1793
+
1794
+ [[ -z ${NIX_LOG_FD-} ]] && return 0;
1795
+ local callerName="${FUNCNAME[1]}";
1796
+ if [[ $callerName == "_callImplicitHook" ]]; then
1797
+ callerName="${hookName:?}";
1798
+ fi;
1799
+ printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD"
1800
+ }
1801
+ patchShebangs ()
1802
+ {
1803
+
1804
+ local pathName;
1805
+ local update=false;
1806
+ while [[ $# -gt 0 ]]; do
1807
+ case "$1" in
1808
+ --host)
1809
+ pathName=HOST_PATH;
1810
+ shift
1811
+ ;;
1812
+ --build)
1813
+ pathName=PATH;
1814
+ shift
1815
+ ;;
1816
+ --update)
1817
+ update=true;
1818
+ shift
1819
+ ;;
1820
+ --)
1821
+ shift;
1822
+ break
1823
+ ;;
1824
+ -* | --*)
1825
+ echo "Unknown option $1 supplied to patchShebangs" 1>&2;
1826
+ return 1
1827
+ ;;
1828
+ *)
1829
+ break
1830
+ ;;
1831
+ esac;
1832
+ done;
1833
+ echo "patching script interpreter paths in $@";
1834
+ local f;
1835
+ local oldPath;
1836
+ local newPath;
1837
+ local arg0;
1838
+ local args;
1839
+ local oldInterpreterLine;
1840
+ local newInterpreterLine;
1841
+ if [[ $# -eq 0 ]]; then
1842
+ echo "No arguments supplied to patchShebangs" 1>&2;
1843
+ return 0;
1844
+ fi;
1845
+ local f;
1846
+ while IFS= read -r -d '' f; do
1847
+ isScript "$f" || continue;
1848
+ read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ];
1849
+ read -r oldPath arg0 args <<< "${oldInterpreterLine:2}";
1850
+ if [[ -z "${pathName:-}" ]]; then
1851
+ if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then
1852
+ pathName=HOST_PATH;
1853
+ else
1854
+ pathName=PATH;
1855
+ fi;
1856
+ fi;
1857
+ if [[ "$oldPath" == *"/bin/env" ]]; then
1858
+ if [[ $arg0 == "-S" ]]; then
1859
+ arg0=${args%% *};
1860
+ [[ "$args" == *" "* ]] && args=${args#* } || args=;
1861
+ newPath="$(PATH="${!pathName}" type -P "env" || true)";
1862
+ args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args";
1863
+ else
1864
+ if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then
1865
+ echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2;
1866
+ exit 1;
1867
+ else
1868
+ newPath="$(PATH="${!pathName}" type -P "$arg0" || true)";
1869
+ fi;
1870
+ fi;
1871
+ else
1872
+ if [[ -z $oldPath ]]; then
1873
+ oldPath="/bin/sh";
1874
+ fi;
1875
+ newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)";
1876
+ args="$arg0 $args";
1877
+ fi;
1878
+ newInterpreterLine="$newPath $args";
1879
+ newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}};
1880
+ if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then
1881
+ if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then
1882
+ echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\"";
1883
+ escapedInterpreterLine=${newInterpreterLine//\\/\\\\};
1884
+ timestamp=$(stat --printf "%y" "$f");
1885
+ tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX);
1886
+ sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile";
1887
+ local restoreReadOnly;
1888
+ if [[ ! -w "$f" ]]; then
1889
+ chmod +w "$f";
1890
+ restoreReadOnly=true;
1891
+ fi;
1892
+ cat "$tmpFile" > "$f";
1893
+ rm "$tmpFile";
1894
+ if [[ -n "${restoreReadOnly:-}" ]]; then
1895
+ chmod -w "$f";
1896
+ fi;
1897
+ touch --date "$timestamp" "$f";
1898
+ fi;
1899
+ fi;
1900
+ done < <(find "$@" -type f -perm -0100 -print0)
1901
+ }
1902
+ stripDirs ()
1903
+ {
1904
+
1905
+ local cmd="$1";
1906
+ local ranlibCmd="$2";
1907
+ local paths="$3";
1908
+ local stripFlags="$4";
1909
+ local excludeFlags=();
1910
+ local pathsNew=;
1911
+ [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1;
1912
+ [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1;
1913
+ local pattern;
1914
+ if [ -n "${stripExclude:-}" ]; then
1915
+ for pattern in "${stripExclude[@]}";
1916
+ do
1917
+ excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')');
1918
+ done;
1919
+ fi;
1920
+ local p;
1921
+ for p in ${paths};
1922
+ do
1923
+ if [ -e "$prefix/$p" ]; then
1924
+ pathsNew="${pathsNew} $prefix/$p";
1925
+ fi;
1926
+ done;
1927
+ paths=${pathsNew};
1928
+ if [ -n "${paths}" ]; then
1929
+ echo "stripping (with command $cmd and flags $stripFlags) in $paths";
1930
+ local striperr;
1931
+ striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')";
1932
+ find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?;
1933
+ [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 );
1934
+ rm "$striperr";
1935
+ find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null;
1936
+ fi
1937
+ }
1938
+ concatTo ()
1939
+ {
1940
+
1941
+ local -;
1942
+ set -o noglob;
1943
+ local -n targetref="$1";
1944
+ shift;
1945
+ local arg default name type;
1946
+ for arg in "$@";
1947
+ do
1948
+ IFS="=" read -r name default <<< "$arg";
1949
+ local -n nameref="$name";
1950
+ if [[ -z "${nameref[*]}" && -n "$default" ]]; then
1951
+ targetref+=("$default");
1952
+ else
1953
+ if type=$(declare -p "$name" 2> /dev/null); then
1954
+ case "${type#* }" in
1955
+ -A*)
1956
+ echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2;
1957
+ return 1
1958
+ ;;
1959
+ -a*)
1960
+ targetref+=("${nameref[@]}")
1961
+ ;;
1962
+ *)
1963
+ if [[ "$name" = *"Array" ]]; then
1964
+ nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future";
1965
+ targetref+=(${nameref+"${nameref[@]}"});
1966
+ else
1967
+ targetref+=(${nameref-});
1968
+ fi
1969
+ ;;
1970
+ esac;
1971
+ fi;
1972
+ fi;
1973
+ done
1974
+ }
1975
+ _moveSbin ()
1976
+ {
1977
+
1978
+ if [ "${dontMoveSbin-}" = 1 ]; then
1979
+ return;
1980
+ fi;
1981
+ if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then
1982
+ return;
1983
+ fi;
1984
+ echo "moving $prefix/sbin/* to $prefix/bin";
1985
+ mkdir -p $prefix/bin;
1986
+ shopt -s dotglob;
1987
+ for i in $prefix/sbin/*;
1988
+ do
1989
+ mv "$i" $prefix/bin;
1990
+ done;
1991
+ shopt -u dotglob;
1992
+ rmdir $prefix/sbin;
1993
+ ln -s bin $prefix/sbin
1994
+ }
1995
+ updateAutotoolsGnuConfigScriptsPhase ()
1996
+ {
1997
+
1998
+ if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then
1999
+ return;
2000
+ fi;
2001
+ for script in config.sub config.guess;
2002
+ do
2003
+ for f in $(find . -type f -name "$script");
2004
+ do
2005
+ echo "Updating Autotools / GNU config script to a newer upstream version: $f";
2006
+ cp -f "/nix/store/s0xj50a5awma0jwgsqws61014nxzxy19-gnu-config-2024-01-01/$script" "$f";
2007
+ done;
2008
+ done
2009
+ }
2010
+ _overrideFirst ()
2011
+ {
2012
+
2013
+ if [ -z "${!1-}" ]; then
2014
+ _assignFirst "$@";
2015
+ fi
2016
+ }
2017
+ configurePhase ()
2018
+ {
2019
+
2020
+ runHook preConfigure;
2021
+ : "${configureScript=}";
2022
+ if [[ -z "$configureScript" && -x ./configure ]]; then
2023
+ configureScript=./configure;
2024
+ fi;
2025
+ if [ -z "${dontFixLibtool:-}" ]; then
2026
+ export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}";
2027
+ local i;
2028
+ find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do
2029
+ echo "fixing libtool script $i";
2030
+ fixLibtool "$i";
2031
+ done;
2032
+ CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX);
2033
+ 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" {} \;;
2034
+ rm -f "$CONFIGURE_MTIME_REFERENCE";
2035
+ fi;
2036
+ if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then
2037
+ local -r prefixKeyOrDefault="${prefixKey:---prefix=}";
2038
+ if [ "${prefixKeyOrDefault: -1}" = " " ]; then
2039
+ prependToVar configureFlags "$prefix";
2040
+ prependToVar configureFlags "${prefixKeyOrDefault::-1}";
2041
+ else
2042
+ prependToVar configureFlags "$prefixKeyOrDefault$prefix";
2043
+ fi;
2044
+ fi;
2045
+ if [[ -f "$configureScript" ]]; then
2046
+ if [ -z "${dontAddDisableDepTrack:-}" ]; then
2047
+ if grep -q dependency-tracking "$configureScript"; then
2048
+ prependToVar configureFlags --disable-dependency-tracking;
2049
+ fi;
2050
+ fi;
2051
+ if [ -z "${dontDisableStatic:-}" ]; then
2052
+ if grep -q enable-static "$configureScript"; then
2053
+ prependToVar configureFlags --disable-static;
2054
+ fi;
2055
+ fi;
2056
+ if [ -z "${dontPatchShebangsInConfigure:-}" ]; then
2057
+ patchShebangs --build "$configureScript";
2058
+ fi;
2059
+ fi;
2060
+ if [ -n "$configureScript" ]; then
2061
+ local -a flagsArray;
2062
+ concatTo flagsArray configureFlags configureFlagsArray;
2063
+ echoCmd 'configure flags' "${flagsArray[@]}";
2064
+ $configureScript "${flagsArray[@]}";
2065
+ unset flagsArray;
2066
+ else
2067
+ echo "no configure script, doing nothing";
2068
+ fi;
2069
+ runHook postConfigure
2070
+ }
2071
+ auditTmpdir ()
2072
+ {
2073
+
2074
+ local dir="$1";
2075
+ [ -e "$dir" ] || return 0;
2076
+ echo "checking for references to $TMPDIR/ in $dir...";
2077
+ local tmpdir elf_fifo script_fifo;
2078
+ tmpdir="$(mktemp -d)";
2079
+ elf_fifo="$tmpdir/elf";
2080
+ script_fifo="$tmpdir/script";
2081
+ mkfifo "$elf_fifo" "$script_fifo";
2082
+ ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do
2083
+ if isELF "$file"; then
2084
+ printf '%s\0' "$file" 1>&3;
2085
+ else
2086
+ if isScript "$file"; then
2087
+ filename=${file##*/};
2088
+ dir=${file%/*};
2089
+ if [ -e "$dir/.$filename-wrapped" ]; then
2090
+ printf '%s\0' "$file" 1>&4;
2091
+ fi;
2092
+ fi;
2093
+ fi;
2094
+ done;
2095
+ exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c '
2096
+ if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then
2097
+ echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/"
2098
+ exit 1
2099
+ fi
2100
+ ' _ < "$elf_fifo" ) & local pid_elf=$!;
2101
+ local pid_script;
2102
+ ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c '
2103
+ if grep -q -F "$TMPDIR/" "$1"; then
2104
+ echo "wrapper script $1 contains a forbidden reference to $TMPDIR/"
2105
+ exit 1
2106
+ fi
2107
+ ' _ < "$script_fifo" ) & local pid_script=$!;
2108
+ wait "$pid_elf" || {
2109
+ echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!";
2110
+ exit 1
2111
+ };
2112
+ wait "$pid_script" || {
2113
+ echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!";
2114
+ exit 1
2115
+ };
2116
+ rm -r "$tmpdir"
2117
+ }
2118
+ consumeEntire ()
2119
+ {
2120
+
2121
+ if IFS='' read -r -d '' "$1"; then
2122
+ echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2;
2123
+ return 1;
2124
+ fi
2125
+ }
2126
+ _pruneLibtoolFiles ()
2127
+ {
2128
+
2129
+ if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then
2130
+ return;
2131
+ fi;
2132
+ 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" \;
2133
+ }
2134
+ appendToVar ()
2135
+ {
2136
+
2137
+ local -n nameref="$1";
2138
+ local useArray type;
2139
+ if [ -n "$__structuredAttrs" ]; then
2140
+ useArray=true;
2141
+ else
2142
+ useArray=false;
2143
+ fi;
2144
+ if type=$(declare -p "$1" 2> /dev/null); then
2145
+ case "${type#* }" in
2146
+ -A*)
2147
+ echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2;
2148
+ return 1
2149
+ ;;
2150
+ -a*)
2151
+ useArray=true
2152
+ ;;
2153
+ *)
2154
+ useArray=false
2155
+ ;;
2156
+ esac;
2157
+ fi;
2158
+ shift;
2159
+ if $useArray; then
2160
+ nameref=(${nameref+"${nameref[@]}"} "$@");
2161
+ else
2162
+ nameref="${nameref-} $*";
2163
+ fi
2164
+ }
2165
+ isMachO ()
2166
+ {
2167
+
2168
+ local fn="$1";
2169
+ local fd;
2170
+ local magic;
2171
+ exec {fd}< "$fn";
2172
+ LANG=C read -r -n 4 -u "$fd" magic;
2173
+ exec {fd}>&-;
2174
+ if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then
2175
+ return 0;
2176
+ else
2177
+ if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then
2178
+ return 0;
2179
+ else
2180
+ if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then
2181
+ return 0;
2182
+ else
2183
+ return 1;
2184
+ fi;
2185
+ fi;
2186
+ fi
2187
+ }
2188
+ _addRpathPrefix ()
2189
+ {
2190
+
2191
+ if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then
2192
+ export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}";
2193
+ fi
2194
+ }
2195
+ addNodePath ()
2196
+ {
2197
+
2198
+ addToSearchPath NODE_PATH "$1/lib/node_modules"
2199
+ }
2200
+ nixNoticeLog ()
2201
+ {
2202
+
2203
+ _nixLogWithLevel 2 "$*"
2204
+ }
2205
+ buildPhase ()
2206
+ {
2207
+
2208
+ runHook preBuild;
2209
+ if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then
2210
+ echo "no Makefile or custom buildPhase, doing nothing";
2211
+ else
2212
+ foundMakefile=1;
2213
+ local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL");
2214
+ concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray;
2215
+ echoCmd 'build flags' "${flagsArray[@]}";
2216
+ make ${makefile:+-f $makefile} "${flagsArray[@]}";
2217
+ unset flagsArray;
2218
+ fi;
2219
+ runHook postBuild
2220
+ }
2221
+ runPhase ()
2222
+ {
2223
+
2224
+ local curPhase="$*";
2225
+ if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then
2226
+ return;
2227
+ fi;
2228
+ if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then
2229
+ return;
2230
+ fi;
2231
+ if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then
2232
+ return;
2233
+ fi;
2234
+ if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then
2235
+ return;
2236
+ fi;
2237
+ if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then
2238
+ return;
2239
+ fi;
2240
+ if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then
2241
+ return;
2242
+ fi;
2243
+ if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then
2244
+ return;
2245
+ fi;
2246
+ if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then
2247
+ return;
2248
+ fi;
2249
+ if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then
2250
+ return;
2251
+ fi;
2252
+ showPhaseHeader "$curPhase";
2253
+ dumpVars;
2254
+ local startTime endTime;
2255
+ startTime=$(date +"%s");
2256
+ eval "${!curPhase:-$curPhase}";
2257
+ endTime=$(date +"%s");
2258
+ showPhaseFooter "$curPhase" "$startTime" "$endTime";
2259
+ if [ "$curPhase" = unpackPhase ]; then
2260
+ [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}";
2261
+ cd -- "${sourceRoot:-.}";
2262
+ fi
2263
+ }
2264
+ PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}"
2265
+ XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}"
2266
+
2267
+ eval "${shellHook:-}"
2268
+ shopt -s expand_aliases
2269
+
2270
+ exec /tmp/devenv-envsC8iXP/script