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