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