@ifunny/ifunny-api-types 1.0.4 → 1.2.2

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