@ifunny/ifunny-api-types 1.0.4 → 1.2.0

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