@ifunny/ifunny-api-types 1.0.3 → 1.2.0

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