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