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