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