Permutation matrices research.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(repo): First commit.

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

This is a binary file and will not be displayed.

+25
flake.lock
··· 1 + { 2 + "nodes": { 3 + "nixpkgs": { 4 + "locked": { 5 + "lastModified": 1724224976, 6 + "narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", 7 + "rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", 8 + "revCount": 669741, 9 + "type": "tarball", 10 + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.669741%2Brev-c374d94f1536013ca8e92341b540eba4c22f9c62/019178de-6006-7f2e-8b92-4b3b936604b8/source.tar.gz" 11 + }, 12 + "original": { 13 + "type": "tarball", 14 + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz" 15 + } 16 + }, 17 + "root": { 18 + "inputs": { 19 + "nixpkgs": "nixpkgs" 20 + } 21 + } 22 + }, 23 + "root": "root", 24 + "version": 7 25 + }
+36
flake.nix
··· 1 + { 2 + description = "A Nix-flake-based C/C++ development environment"; 3 + 4 + inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz"; 5 + 6 + outputs = { self, nixpkgs }: 7 + let 8 + supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 9 + forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f { 10 + pkgs = import nixpkgs { inherit system; }; 11 + }); 12 + in 13 + { 14 + devShells = forEachSupportedSystem ({ pkgs }: { 15 + default = pkgs.mkShell.override { 16 + # Override stdenv in order to change compiler: 17 + # stdenv = pkgs.clangStdenv; 18 + } 19 + { 20 + packages = with pkgs; [ 21 + clang-tools 22 + clang 23 + cmake 24 + codespell 25 + conan 26 + cppcheck 27 + doxygen 28 + gtest 29 + lcov 30 + vcpkg 31 + vcpkg-tool 32 + ] ++ (if system == "aarch64-darwin" then [ ] else [ gdb ]); 33 + }; 34 + }); 35 + }; 36 + }
+41
src/external.cpp
··· 1 + #include "external.hpp" 2 + #include "lib/prelude.hpp" 3 + 4 + // Code taken from: https://stackoverflow.com/a/4424496 5 + fn power(I32 a, I32 n, I32 mod) noexcept -> I64 { 6 + I64 power = I64(a); 7 + I64 result = I64(1); 8 + 9 + while (n) { 10 + if (n & 1) 11 + result = (result * power) % mod; 12 + power = (power * power) % mod; 13 + n >>= 1; 14 + } 15 + return result; 16 + } 17 + 18 + fn witness(I32 a, I32 n) noexcept -> Bool { 19 + I32 t, u, i; 20 + I64 prev, curr; 21 + 22 + u = n / 2; 23 + t = 1; 24 + while (!(u & 1)) { 25 + u /= 2; 26 + ++t; 27 + } 28 + 29 + prev = power(a, u, n); 30 + // [[assume(i <= t)]]; 31 + for (i = 1; i <= t; ++i) { 32 + curr = (prev * prev) % n; 33 + if (curr == 1 && prev != 1 && prev != n - 1) 34 + return true; 35 + prev = curr; 36 + } 37 + 38 + if (curr != 1) 39 + return true; 40 + return false; 41 + }
+46
src/external.hpp
··· 1 + #pragma once 2 + #include "lib/prelude.hpp" 3 + 4 + fn power(I32 a, I32 n, I32 mod) noexcept -> I64; 5 + 6 + fn witness(I32 a, I32 n) noexcept -> Bool; 7 + 8 + /* WARNING: Algorithm deterministic only for numbers < 4,759,123,141 (unsigned 9 + * int's max is 4294967296) if n < 1,373,653, it is enough to test a = 2 and 3. 10 + * if n < 9,080,191, it is enough to test a = 31 and 73. 11 + * if n < 4,759,123,141, it is enough to test a = 2, 7, and 61. 12 + * if n < 2,152,302,898,747, it is enough to test a = 2, 3, 5, 7, and 11. 13 + * if n < 3,474,749,660,383, it is enough to test a = 2, 3, 5, 7, 11, and 13. 14 + * if n < 341,550,071,728,321, it is enough to test a = 2, 3, 5, 7, 11, 13, 15 + * and 17. 16 + */ 17 + fn inline is_prime(Int number) noexcept -> Bool { 18 + if ((!(number & 1) && number != 2) || number < 2 || 19 + (number % 3 == 0 && number != 3)) 20 + return false; 21 + 22 + if (number < 1373653) { 23 + for (Int k = 1; 36 * k * k - 12 * k < number; ++k) 24 + if (number % (6 * k + 1) == 0 || 25 + (number % 6 * k - 1) == 0) 26 + return false; 27 + 28 + return true; 29 + } 30 + 31 + if (number < 9080191) { 32 + if (witness(31, number)) 33 + return false; 34 + if (witness(73, number)) 35 + return false; 36 + return true; 37 + } 38 + 39 + if (witness(2, number)) 40 + return false; 41 + if (witness(7, number)) 42 + return false; 43 + if (witness(61, number)) 44 + return false; 45 + return true; 46 + }
+29
src/lib/lib.cpp
··· 1 + #include "lib.hpp" 2 + #include "prelude.hpp" 3 + #include <cmath> 4 + #include <ranges> 5 + 6 + fn is_primitive_root(UInt p, Int a) noexcept -> Bool { 7 + return (UInt(std::pow(a, (p - 1) / 2)) % p) == p - 1; 8 + } 9 + 10 + fn primitive_roots(UInt p) noexcept -> Vec<UInt> { 11 + Vec<UInt> out; 12 + out.reserve(Size(p)); 13 + for (auto i : vi::iota(1, Int(p))) { 14 + if (is_primitive_root(p, i)) 15 + out.push_back(i); 16 + } 17 + return out; 18 + } 19 + 20 + fn seq(UInt p, UInt a) noexcept -> Vec<UInt> { 21 + Vec<UInt> out; 22 + out.reserve(Size(p)); 23 + for (UInt i = 1, e = a; e != 1; ++i) { 24 + e = UInt(std::pow(a, i)) % p; 25 + out.push_back(e); 26 + } 27 + return out; 28 + } 29 +
+8
src/lib/lib.hpp
··· 1 + #pragma once 2 + #include "prelude.hpp" 3 + 4 + fn is_primitive_root(UInt p, Int a) noexcept -> Bool; 5 + 6 + fn primitive_roots(UInt p) noexcept -> Vec<UInt>; 7 + 8 + fn seq(UInt p, UInt a) noexcept -> Vec<UInt>;
+16
src/lib/prelude.hpp
··· 1 + #pragma once 2 + #include <cstdint> 3 + #include <vector> 4 + #define fn [[nodiscard, gnu::const]] auto 5 + 6 + template <class T> using Vec = std::vector<T>; 7 + using Bool = bool; 8 + using Int = int; 9 + using UInt = unsigned int; 10 + using Size = std::size_t; 11 + // namespace ra = std::ranges; 12 + namespace vi = std::ranges::views; 13 + using U64 = std::uint64_t; 14 + using U32 = std::uint32_t; 15 + using I32 = std::int32_t; 16 + typedef std::int64_t I64;
+23
src/main.cpp
··· 1 + #include "external.hpp" 2 + #include "lib/lib.hpp" 3 + #include "test/test.hpp" 4 + #include <iostream> 5 + #include <ranges> 6 + 7 + fn main() noexcept -> int { 8 + "2 is a primitive root of 11"_test = is_primitive_root(11, 2); 9 + for (auto p : vi::iota(2, 20) | vi::filter(is_prime)) { 10 + auto space = ""; 11 + std::cout << p << ": ["; 12 + for (auto const& i : primitive_roots(UInt(p))) { 13 + std::cout << space << i; 14 + space = " "; 15 + } 16 + std::cout << "]" << std::endl; 17 + } 18 + for (auto e : seq(11, 2)) { 19 + std::cout << e << std::endl; 20 + } 21 + 22 + return 0; 23 + }
+51
src/test/test.cpp
··· 1 + #include "test.hpp" 2 + 3 + Test::Test(CString name) : test_name(name) 4 + { 5 + } 6 + 7 + Test& Test::operator=(std::initializer_list<bool> checks) 8 + { 9 + std::cout << test_name << std::endl; 10 + U64 counter = 0; 11 + for (auto check : checks) { 12 + if (check) { 13 + std::cout << "\t| " << counter << ": passed"; 14 + } else { 15 + std::cerr << format_err(test_name) << std::endl; 16 + throw TestFail(); 17 + } 18 + ++counter; 19 + std::cout << std::endl; 20 + } 21 + return *this; 22 + } 23 + 24 + Test operator""_test(CString str, U64 length) 25 + { 26 + static_cast<void>(length); 27 + return Test(str); 28 + } 29 + 30 + Test& Test::operator=(bool passed) 31 + { 32 + if (passed) { 33 + std::cout << test_name << ": passed" << std::endl; 34 + } else { 35 + std::cerr << format_err(test_name) << std::endl; 36 + throw TestFail(); 37 + } 38 + return *this; 39 + } 40 + 41 + auto red(String const& str) noexcept -> String 42 + { 43 + auto const prefix = "\033[31m"; 44 + auto const suffix = "\033[0m"; 45 + return prefix + str + suffix; 46 + } 47 + 48 + auto format_err(String const& test_name) noexcept -> String 49 + { 50 + return test_name + ": " + red("failed"); 51 + }
+39
src/test/test.hpp
··· 1 + #pragma once 2 + #include <string> 3 + #include <cstdint> 4 + #include <iostream> 5 + #include <exception> 6 + #include <format> 7 + using CString = const char *; 8 + using U64 = std::uint64_t; 9 + using String = std::string; 10 + 11 + enum class TestFail {}; 12 + 13 + auto red(String const& in) noexcept -> String; 14 + 15 + auto format_err(String const& test_name) noexcept -> String; 16 + 17 + class Test { 18 + String test_name; 19 + 20 + public: 21 + Test(CString name); 22 + 23 + Test& operator = (auto f) { 24 + if (f()) { 25 + std::cout << test_name << ": passed" << std::endl; 26 + } else { 27 + std::cerr << test_name << ": failed" << std::endl; 28 + throw TestFail(); 29 + } 30 + return *this; 31 + } 32 + 33 + 34 + Test& operator = (std::initializer_list<bool> checks); 35 + 36 + Test& operator = (bool passed); 37 + }; 38 + 39 + Test operator ""_test(CString str, U64 length);