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