@ifunny/ifunny-api-types 1.0.4 → 1.2.0

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