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