@ifunny/ifunny-api-types 1.0.4 → 1.2.2

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