@ifunny/ifunny-api-types 1.0.4 → 1.2.0

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