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