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