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