My digital garden

sync

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