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