@ifunny/ifunny-api-types 1.0.3 → 1.2.0

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