@ifunny/ifunny-api-types 1.0.3 → 1.2.0

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