@punkfairie/98.css 1.1.21

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