From 4ae0829650ba0f2901e1a24c8dab0abbdbaa1e69 Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Fri, 6 Dec 2024 13:37:00 -0600 Subject: [PATCH] organization --- blusky/.direnv/bin/nix-direnv-reload | 19 - .../nix-profile-24.05-rfq6hpk4a4ki1q18.rc | 1882 --------------- download_hs/.direnv/bin/nix-direnv-reload | 8 - .../.direnv/nix-profile-.928.50aa30a13c4a | 1 - .../.direnv/nix-profile-.928.50aa30a13c4a.rc | 2024 ----------------- find_tweet_user/.direnv/bin/nix-direnv-reload | 19 - .../nix-profile-24.11-wb6agba4kfsxpbnb | 1 - .../nix-profile-24.11-wb6agba4kfsxpbnb.rc | 2000 ---------------- {blusky => source/blusky}/.envrc | 0 {blusky => source/blusky}/feed-jawz.py | 0 {blusky => source/blusky}/shell.nix | 0 clean-cloud.sh => source/clean-cloud.sh | 0 clean-watch.sh => source/clean-watch.sh | 0 .../Other/Bat to Exe/Bat_To_Exe_Converter.exe | Bin .../Bat to Exe/Bat_To_Exe_Converter_(x64).exe | Bin .../Windows/Windows/Other/Bat to Exe/settings | Bin .../Other/RazerChromaSampleApplication.exe | Bin .../Windows/Other/SyncSettings.ffs_gui | 0 .../Windows/Windows/Other/Thumbnail me.ini | 0 .../bulkfilechanger-x64/BulkFileChanger.cfg | 0 .../bulkfilechanger-x64/BulkFileChanger.chm | Bin .../bulkfilechanger-x64/BulkFileChanger.exe | Bin .../Other/bulkfilechanger-x64/readme.txt | 0 .../Windows/Windows/Other/cmder.xml | 0 .../Windows/Windows/Other/config.xlaunch | 0 .../Windows/Windows/Other/md5c_x64.exe | Bin .../Other/new settings.touchmouseptr_setting | Bin .../Other/tabletpro.touchmouseptr_setting | Bin .../Windows/Windows/TabProBG - Pink.png | Bin .../Windows/Windows/TabProBG.png | Bin .../Windows/Windows/TabProBlur.png | Bin .../Windows/Windows/Touch settings.ini | Bin .../Windows/Touch settings.ini.tabletpro | Bin .../Windows/Windows/onenote purple.ini | Bin .../Windows/onenote purple.ini.tabletpro | Bin .../deprecated-rewrite}/Windows/color.ps1 | 0 .../deprecated-rewrite}/Windows/create.ps1 | 0 .../Windows/library scripts/download.ps1 | 0 .../Windows/library scripts/fix.ps1 | 0 .../Windows/library scripts/fix2.ps1 | 0 .../Windows/library scripts/manga.ps1 | 0 .../Windows/remove-emtpy.ps1 | 0 .../deprecated-rewrite}/backups | 0 .../deprecated-rewrite}/discord_chatlogs | 0 .../deprecated-rewrite}/doasedit | 0 .../deprecated-rewrite}/exporg_cal.fish | 0 .../deprecated-rewrite}/kemono.py | 0 .../deprecated-rewrite}/manage_music.fish | 0 .../deprecated-rewrite}/moviezip | 0 .../deprecated-rewrite}/pywal.fish | 0 .../deprecated-rewrite}/rnm.fish | 0 .../deprecated-rewrite}/syncphone | 0 {download_hs => source/download_hs}/.envrc | 0 .../download_hs}/CHANGELOG.md | 0 {download_hs => source/download_hs}/LICENSE | 0 .../download_hs}/app/Main.hs | 0 .../download_hs}/app/test.txt | 0 .../download_hs}/default.nix | 0 .../download_hs}/dist-newstyle/cache/compiler | Bin .../download_hs}/dist-newstyle/cache/config | Bin .../dist-newstyle/cache/elaborated-plan | Bin .../dist-newstyle/cache/improved-plan | Bin .../dist-newstyle/cache/plan.json | 0 .../dist-newstyle/cache/solver-plan | Bin .../dist-newstyle/cache/source-hashes | Bin .../dist-newstyle/cache/up-to-date | Bin .../download_hs}/download-hs.cabal | 0 .../find_tweet_user}/.envrc | 0 .../find_tweet_user}/find_tweet_user.py | 0 .../find_tweet_user}/shell.nix | 0 {gdl => source/gdl}/gdl_log_report | 0 {gdl => source/gdl}/gdl_log_report.sh | 0 {gdl => source/gdl}/gdl_mv | 0 {gdl => source/gdl}/gdl_mv.sh | 0 {gdl => source/gdl}/track_files.fish | 0 .../photos-metadata.sh | 0 plex.py => source/plex.py | 0 .../split-gallery-videos.sh | 0 xhamster.py => source/xhamster.py | 0 79 files changed, 5954 deletions(-) delete mode 100755 blusky/.direnv/bin/nix-direnv-reload delete mode 100644 blusky/.direnv/nix-profile-24.05-rfq6hpk4a4ki1q18.rc delete mode 100755 download_hs/.direnv/bin/nix-direnv-reload delete mode 120000 download_hs/.direnv/nix-profile-.928.50aa30a13c4a delete mode 100644 download_hs/.direnv/nix-profile-.928.50aa30a13c4a.rc delete mode 100755 find_tweet_user/.direnv/bin/nix-direnv-reload delete mode 120000 find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb delete mode 100644 find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb.rc rename {blusky => source/blusky}/.envrc (100%) rename {blusky => source/blusky}/feed-jawz.py (100%) rename {blusky => source/blusky}/shell.nix (100%) rename clean-cloud.sh => source/clean-cloud.sh (100%) rename clean-watch.sh => source/clean-watch.sh (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter.exe (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter_(x64).exe (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/Bat to Exe/settings (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/RazerChromaSampleApplication.exe (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/SyncSettings.ffs_gui (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/Thumbnail me.ini (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.cfg (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.chm (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.exe (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/bulkfilechanger-x64/readme.txt (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/cmder.xml (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/config.xlaunch (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/md5c_x64.exe (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/new settings.touchmouseptr_setting (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Other/tabletpro.touchmouseptr_setting (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/TabProBG - Pink.png (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/TabProBG.png (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/TabProBlur.png (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Touch settings.ini (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/Touch settings.ini.tabletpro (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/onenote purple.ini (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/Windows/onenote purple.ini.tabletpro (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/color.ps1 (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/create.ps1 (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/library scripts/download.ps1 (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/library scripts/fix.ps1 (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/library scripts/fix2.ps1 (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/library scripts/manga.ps1 (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/Windows/remove-emtpy.ps1 (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/backups (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/discord_chatlogs (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/doasedit (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/exporg_cal.fish (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/kemono.py (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/manage_music.fish (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/moviezip (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/pywal.fish (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/rnm.fish (100%) rename {deprecated-rewrite => source/deprecated-rewrite}/syncphone (100%) rename {download_hs => source/download_hs}/.envrc (100%) rename {download_hs => source/download_hs}/CHANGELOG.md (100%) rename {download_hs => source/download_hs}/LICENSE (100%) rename {download_hs => source/download_hs}/app/Main.hs (100%) rename {download_hs => source/download_hs}/app/test.txt (100%) rename {download_hs => source/download_hs}/default.nix (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/compiler (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/config (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/elaborated-plan (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/improved-plan (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/plan.json (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/solver-plan (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/source-hashes (100%) rename {download_hs => source/download_hs}/dist-newstyle/cache/up-to-date (100%) rename {download_hs => source/download_hs}/download-hs.cabal (100%) rename {find_tweet_user => source/find_tweet_user}/.envrc (100%) rename {find_tweet_user => source/find_tweet_user}/find_tweet_user.py (100%) rename {find_tweet_user => source/find_tweet_user}/shell.nix (100%) rename {gdl => source/gdl}/gdl_log_report (100%) rename {gdl => source/gdl}/gdl_log_report.sh (100%) rename {gdl => source/gdl}/gdl_mv (100%) rename {gdl => source/gdl}/gdl_mv.sh (100%) rename {gdl => source/gdl}/track_files.fish (100%) rename photos-metadata.sh => source/photos-metadata.sh (100%) rename plex.py => source/plex.py (100%) rename split-gallery-videos.sh => source/split-gallery-videos.sh (100%) rename xhamster.py => source/xhamster.py (100%) diff --git a/blusky/.direnv/bin/nix-direnv-reload b/blusky/.direnv/bin/nix-direnv-reload deleted file mode 100755 index 92e5a42..0000000 --- a/blusky/.direnv/bin/nix-direnv-reload +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -set -e -if [[ ! -d "/home/jawz/Development/Scripts/blusky" ]]; then - echo "Cannot find source directory; Did you move it?" - echo "(Looking for "/home/jawz/Development/Scripts/blusky")" - echo 'Cannot force reload with this script - use "direnv reload" manually and then try again' - exit 1 -fi - -# rebuild the cache forcefully -_nix_direnv_force_reload=1 direnv exec "/home/jawz/Development/Scripts/blusky" true - -# Update the mtime for .envrc. -# This will cause direnv to reload again - but without re-building. -touch "/home/jawz/Development/Scripts/blusky/.envrc" - -# Also update the timestamp of whatever profile_rc we have. -# This makes sure that we know we are up to date. -touch -r "/home/jawz/Development/Scripts/blusky/.envrc" "/home/jawz/Development/Scripts/blusky/.direnv"/*.rc diff --git a/blusky/.direnv/nix-profile-24.05-rfq6hpk4a4ki1q18.rc b/blusky/.direnv/nix-profile-24.05-rfq6hpk4a4ki1q18.rc deleted file mode 100644 index bbc9059..0000000 --- a/blusky/.direnv/nix-profile-24.05-rfq6hpk4a4ki1q18.rc +++ /dev/null @@ -1,1882 +0,0 @@ -unset shellHook -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -AR='ar' -export AR -AS='as' -export AS -BASH='/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin/bash' -CC='gcc' -export CC -CONFIG_SHELL='/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin/bash' -export CONFIG_SHELL -CXX='g++' -export CXX -HOSTTYPE='x86_64' -HOST_PATH='/nix/store/mr63za5vkxj0yip6wj3j9lya2frdm3zc-coreutils-9.5/bin:/nix/store/myb4rzvdyahvvlyyx32i19nhmr78bc8k-findutils-4.9.0/bin:/nix/store/wk9vn3lcxqya6a5j17v87x18lrkg2ngy-diffutils-3.10/bin:/nix/store/nhr25jgz6bpxbrz6kndjyvgaxipall0j-gnused-4.9/bin:/nix/store/3jc4m5gwimj4mbm01ijgkm2di8hiy5l3-gnugrep-3.11/bin:/nix/store/g7rq3khf0bnm64amflrc4964b7q57dqv-gawk-5.2.2/bin:/nix/store/wqbq6prmrhgm19qqdqm3ijjbap9x74cn-gnutar-1.35/bin:/nix/store/jpqm5igl1gmahp7lxx8j1dy874zvirgm-gzip-1.13/bin:/nix/store/azwrrzpvar2qyn5s4cmrj4jfgfjgmkbv-bzip2-1.0.8-bin/bin:/nix/store/mywvjmd80bayzbi161nly2vfpikyc47h-gnumake-4.4.1/bin:/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin:/nix/store/cjjaglbcsg30bc7rf6xajpp73fkna2mk-patch-2.7.6/bin:/nix/store/kpabg6z89nfry6frc3p5m3zfmk94zyqn-xz-5.4.7-bin/bin:/nix/store/vqhj138xim73r80qcsc546crm4y80ca2-file-5.45/bin' -export HOST_PATH -IFS=' -' -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -LD='ld' -export LD -LINENO='76' -MACHTYPE='x86_64-pc-linux-gnu' -NIX_BINTOOLS='/nix/store/si9c1ncjikjq2hl5m8i6dzrfznmsz7g5-binutils-wrapper-2.41' -export NIX_BINTOOLS -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -NIX_BUILD_CORES='16' -export NIX_BUILD_CORES -NIX_CC='/nix/store/r6k305g2rn0qqkvdxfvzqg7mhh7rw679-gcc-wrapper-13.2.0' -export NIX_CC -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -NIX_CFLAGS_COMPILE=' -frandom-seed=q1bfxk0m81 -isystem /nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env/include -isystem /nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env/include' -export NIX_CFLAGS_COMPILE -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -NIX_HARDENING_ENABLE='bindnow format fortify fortify3 pic relro stackprotector strictoverflow' -export NIX_HARDENING_ENABLE -NIX_LDFLAGS='-rpath /home/jawz/Development/Scripts/blusky/outputs/out/lib -L/nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env/lib -L/nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env/lib' -export NIX_LDFLAGS -NIX_NO_SELF_RPATH='1' -NIX_STORE='/nix/store' -export NIX_STORE -NM='nm' -export NM -OBJCOPY='objcopy' -export OBJCOPY -OBJDUMP='objdump' -export OBJDUMP -OLDPWD='' -export OLDPWD -OPTERR='1' -OSTYPE='linux-gnu' -PATH='/nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env/bin:/nix/store/6wf8zxqql7gmmi96k6swmm0pvqp13gi8-patchelf-0.15.0/bin:/nix/store/r6k305g2rn0qqkvdxfvzqg7mhh7rw679-gcc-wrapper-13.2.0/bin:/nix/store/6g5fhxv0bdm7236ixdwq1izzawbc7grm-gcc-13.2.0/bin:/nix/store/4y2kcviw0cczb56lfl84h7n7j7xm8hh0-glibc-2.39-52-bin/bin:/nix/store/mr63za5vkxj0yip6wj3j9lya2frdm3zc-coreutils-9.5/bin:/nix/store/si9c1ncjikjq2hl5m8i6dzrfznmsz7g5-binutils-wrapper-2.41/bin:/nix/store/q3sm4x963a996qc3d6baw54609ryifak-binutils-2.41/bin:/nix/store/mr63za5vkxj0yip6wj3j9lya2frdm3zc-coreutils-9.5/bin:/nix/store/myb4rzvdyahvvlyyx32i19nhmr78bc8k-findutils-4.9.0/bin:/nix/store/wk9vn3lcxqya6a5j17v87x18lrkg2ngy-diffutils-3.10/bin:/nix/store/nhr25jgz6bpxbrz6kndjyvgaxipall0j-gnused-4.9/bin:/nix/store/3jc4m5gwimj4mbm01ijgkm2di8hiy5l3-gnugrep-3.11/bin:/nix/store/g7rq3khf0bnm64amflrc4964b7q57dqv-gawk-5.2.2/bin:/nix/store/wqbq6prmrhgm19qqdqm3ijjbap9x74cn-gnutar-1.35/bin:/nix/store/jpqm5igl1gmahp7lxx8j1dy874zvirgm-gzip-1.13/bin:/nix/store/azwrrzpvar2qyn5s4cmrj4jfgfjgmkbv-bzip2-1.0.8-bin/bin:/nix/store/mywvjmd80bayzbi161nly2vfpikyc47h-gnumake-4.4.1/bin:/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin:/nix/store/cjjaglbcsg30bc7rf6xajpp73fkna2mk-patch-2.7.6/bin:/nix/store/kpabg6z89nfry6frc3p5m3zfmk94zyqn-xz-5.4.7-bin/bin:/nix/store/vqhj138xim73r80qcsc546crm4y80ca2-file-5.45/bin' -export PATH -PS4='+ ' -RANLIB='ranlib' -export RANLIB -READELF='readelf' -export READELF -SIZE='size' -export SIZE -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -STRINGS='strings' -export STRINGS -STRIP='strip' -export STRIP -XDG_DATA_DIRS='/nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env/share:/nix/store/6wf8zxqql7gmmi96k6swmm0pvqp13gi8-patchelf-0.15.0/share' -export XDG_DATA_DIRS -__structuredAttrs='' -export __structuredAttrs -_substituteStream_has_warned_replace_deprecation='false' -buildInputs='' -export buildInputs -buildPhase='{ echo "------------------------------------------------------------"; - echo " WARNING: the existence of this path is not guaranteed."; - echo " It is an internal implementation detail for pkgs.mkShell."; - echo "------------------------------------------------------------"; - echo; - # Record all build inputs as runtime dependencies - export; -} >> "$out" -' -export buildPhase -builder='/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin/bash' -export builder -cmakeFlags='' -export cmakeFlags -configureFlags='' -export configureFlags -defaultBuildInputs='' -defaultNativeBuildInputs='/nix/store/6wf8zxqql7gmmi96k6swmm0pvqp13gi8-patchelf-0.15.0 /nix/store/vdbrzhl533lr4xn4f48f2c50hymbfhfh-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/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh /nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh /nix/store/r6k305g2rn0qqkvdxfvzqg7mhh7rw679-gcc-wrapper-13.2.0' -depsBuildBuild='' -export depsBuildBuild -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -depsBuildTarget='' -export depsBuildTarget -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -depsHostHost='' -export depsHostHost -depsHostHostPropagated='' -export depsHostHostPropagated -depsTargetTarget='' -export depsTargetTarget -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -doCheck='' -export doCheck -doInstallCheck='' -export doInstallCheck -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -declare -a envBuildBuildHooks=() -declare -a envBuildHostHooks=() -declare -a envBuildTargetHooks=() -declare -a envHostHostHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -declare -a envHostTargetHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -declare -a envTargetTargetHooks=() -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' ) -initialPath='/nix/store/mr63za5vkxj0yip6wj3j9lya2frdm3zc-coreutils-9.5 /nix/store/myb4rzvdyahvvlyyx32i19nhmr78bc8k-findutils-4.9.0 /nix/store/wk9vn3lcxqya6a5j17v87x18lrkg2ngy-diffutils-3.10 /nix/store/nhr25jgz6bpxbrz6kndjyvgaxipall0j-gnused-4.9 /nix/store/3jc4m5gwimj4mbm01ijgkm2di8hiy5l3-gnugrep-3.11 /nix/store/g7rq3khf0bnm64amflrc4964b7q57dqv-gawk-5.2.2 /nix/store/wqbq6prmrhgm19qqdqm3ijjbap9x74cn-gnutar-1.35 /nix/store/jpqm5igl1gmahp7lxx8j1dy874zvirgm-gzip-1.13 /nix/store/azwrrzpvar2qyn5s4cmrj4jfgfjgmkbv-bzip2-1.0.8-bin /nix/store/mywvjmd80bayzbi161nly2vfpikyc47h-gnumake-4.4.1 /nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32 /nix/store/cjjaglbcsg30bc7rf6xajpp73fkna2mk-patch-2.7.6 /nix/store/kpabg6z89nfry6frc3p5m3zfmk94zyqn-xz-5.4.7-bin /nix/store/vqhj138xim73r80qcsc546crm4y80ca2-file-5.45' -mesonFlags='' -export mesonFlags -name='nix-shell-env' -export name -nativeBuildInputs='/nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env' -export nativeBuildInputs -out='/home/jawz/Development/Scripts/blusky/outputs/out' -export out -outputBin='out' -outputDev='out' -outputDevdoc='REMOVE' -outputDevman='out' -outputDoc='out' -outputInclude='out' -outputInfo='out' -outputLib='out' -outputMan='out' -outputs='out' -export outputs -patches='' -export patches -phases='buildPhase' -export phases -pkg='/nix/store/r6k305g2rn0qqkvdxfvzqg7mhh7rw679-gcc-wrapper-13.2.0' -declare -a pkgsBuildBuild=() -declare -a pkgsBuildHost=('/nix/store/6lj4aijcix7h04g37f85zmgzn5l4y97c-python3-3.11.9-env' '/nix/store/6wf8zxqql7gmmi96k6swmm0pvqp13gi8-patchelf-0.15.0' '/nix/store/vdbrzhl533lr4xn4f48f2c50hymbfhfh-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/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh' '/nix/store/gps9qrh99j7g02840wv5x78ykmz30byp-strip.sh' '/nix/store/r6k305g2rn0qqkvdxfvzqg7mhh7rw679-gcc-wrapper-13.2.0' '/nix/store/si9c1ncjikjq2hl5m8i6dzrfznmsz7g5-binutils-wrapper-2.41' ) -declare -a pkgsBuildTarget=() -declare -a pkgsHostHost=() -declare -a pkgsHostTarget=() -declare -a pkgsTargetTarget=() -declare -a postFixupHooks=('_makeSymlinksRelativeInAllOutputs' '_multioutPropagateDev' ) -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -declare -a preConfigureHooks=('_multioutConfig' ) -preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -preferLocalBuild='1' -export preferLocalBuild -prefix='/home/jawz/Development/Scripts/blusky/outputs/out' -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -propagatedBuildInputs='' -export propagatedBuildInputs -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -shell='/nix/store/516kai7nl5dxr792c0nzq0jp8m4zvxpi-bash-5.2p32/bin/bash' -export shell -shellHook='' -export shellHook -stdenv='/nix/store/479jddljb3spih04qb01qlyv39qb2zn9-stdenv-linux' -export stdenv -strictDeps='' -export strictDeps -system='x86_64-linux' -export system -declare -a unpackCmdHooks=('_defaultUnpack' ) -_accumFlagsArray () -{ - - local name; - if [ -n "$__structuredAttrs" ]; then - for name in "$@"; - do - local -n nameref="$name"; - flagsArray+=(${nameref+"${nameref[@]}"}); - done; - else - for name in "$@"; - do - local -n nameref="$name"; - case "$name" in - *Array) - flagsArray+=(${nameref+"${nameref[@]}"}) - ;; - *) - flagsArray+=(${nameref-}) - ;; - esac; - done; - fi -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -_allFlags () -{ - - export system pname name version; - for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'); - do - if (( "${NIX_DEBUG:-0}" >= 1 )); then - printf "@%s@ -> %q\n" "${varName}" "${!varName}" 1>&2; - fi; - args+=("--subst-var" "$varName"); - done -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -pr --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -_makeSymlinksRelative () -{ - - local symlinkTarget; - if [ "${dontRewriteSymlinks-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - while IFS= read -r -d '' f; do - symlinkTarget=$(readlink "$f"); - if [[ "$symlinkTarget"/ != "$prefix"/* ]]; then - continue; - fi; - if [ ! -e "$symlinkTarget" ]; then - echo "the symlink $f is broken, it points to $symlinkTarget (which is missing)"; - fi; - echo "rewriting symlink $f to be relative to $prefix"; - ln -snrf "$symlinkTarget" "$f"; - done < <(find $prefix -type l -print0) -} -_makeSymlinksRelativeInAllOutputs () -{ - - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" _makeSymlinksRelative; - done -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - 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; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - 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" \; -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - source "$pkg/nix-support/setup-hook"; - fi -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if declare -p "$1" 2> /dev/null | grep -q '^'; then - type="$(declare -p "$1")"; - if [[ "$type" =~ "declare -A" ]]; then - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1; - else - if [[ "$type" =~ "declare -a" ]]; then - useArray=true; - else - useArray=false; - fi; - fi; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local i; - find "$dir" -type f -print0 | while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if isELF "$i"; then - if { - printf :; - patchelf --print-rpath "$i" - } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/"; - exit 1; - fi; - fi; - if isScript "$i"; then - if [ -e "$(dirname "$i")/.$(basename "$i")-wrapped" ]; then - if grep -q -F "$TMPDIR/" "$i"; then - echo "wrapper script $i contains a forbidden reference to $TMPDIR/"; - exit 1; - fi; - fi; - fi; - done -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - fi -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget=check; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget=test; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray; - if [ -n "$__structuredAttrs" ]; then - flagsArray+=("${checkFlags[@]:-VERBOSE=y}"); - else - flagsArray+=(${checkFlags:-VERBOSE=y}); - fi; - _accumFlagsArray checkFlagsArray; - flagsArray+=(${checkTarget}); - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | while IFS= read -r -d '' f; do - if gzip -c -n "$f" > "$f".gz; then - rm "$f"; - else - rm "$f".gz; - fi; - done; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - 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" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - prependToVar configureFlags "${prefixKey:---prefix=}$prefix"; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - _accumFlagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - _accumFlagsArray distFlags distFlagsArray; - flagsArray+=(${distTarget:-dist}); - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -dumpVars () -{ - - if [ "${noDumpEnvVars:-0}" != 1 ]; then - { - install -m 0600 /dev/null "$NIX_BUILD_TOP/env-vars" && export 2> /dev/null >| "$NIX_BUILD_TOP/env-vars" - } || true; - fi -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case "${!varSlice-}" in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -getHostRole () -{ - - getRole "$hostOffset" -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.41: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -getTargetRole () -{ - - getRole "$targetOffset" -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.41: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray; - flagsArray+=(${installCheckTarget:-installcheck}); - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray installFlags installFlagsArray; - if [ -n "$__structuredAttrs" ]; then - flagsArray+=("${installTargets[@]:-install}"); - else - flagsArray+=(${installTargets:-install}); - fi; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - if [ -n "$__structuredAttrs" ]; then - patchesArray=(${patches:+"${patches[@]}"}); - else - patchesArray=(${patches:-}); - fi; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - local -a flagsArray; - if [ -n "$__structuredAttrs" ]; then - flagsArray=("${patchFlags[@]:--p1}"); - else - flagsArray=(${patchFlags:--p1}); - fi; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -patchShebangs () -{ - - local pathName; - local update; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - args=${args#* }; - newPath="$(PATH="${!pathName}" command -v "env" || true)"; - args="-S $(PATH="${!pathName}" command -v "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" command -v "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" command -v "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if declare -p "$1" 2> /dev/null | grep -q '^'; then - type="$(declare -p "$1")"; - if [[ "$type" =~ "declare -A" ]]; then - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1; - else - if [[ "$type" =~ "declare -a" ]]; then - useArray=true; - else - useArray=false; - fi; - fi; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _eval "$hook" "$@"; - done; - return 0 -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - if [[ -n $NIX_LOG_FD ]]; then - echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD"; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - local endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}"; - cd "${sourceRoot:-.}"; - fi -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase" -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - 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=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - local savedvar; - savedvar="${!var}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - if [ "$pattern" != "$replacement" ]; then - if [ "${!var}" == "$savedvar" ]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - fi - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - if [ -n "$__structuredAttrs" ]; then - srcsArray=("${srcs[@]}"); - else - srcsArray=($srcs); - fi; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/ym3bq1r8vznaqdh5b9id1i5l31r0lcdl-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -updateSourceDateEpoch () -{ - - local path="$1"; - 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)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" -export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)" -export TMP="$NIX_BUILD_TOP" -export TMPDIR="$NIX_BUILD_TOP" -export TEMP="$NIX_BUILD_TOP" -export TEMPDIR="$NIX_BUILD_TOP" -eval "$shellHook" diff --git a/download_hs/.direnv/bin/nix-direnv-reload b/download_hs/.direnv/bin/nix-direnv-reload deleted file mode 100755 index 186ac96..0000000 --- a/download_hs/.direnv/bin/nix-direnv-reload +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -dir="$(realpath $(dirname ${BASH_SOURCE[0]})/../..)" -_nix_direnv_force_reload=1 direnv exec "$dir" true -direnv reload -# direnv reload updates the mtime of .envrc. Also update the timestamp of the -# profile_rc file to keep track that we actually are up to date. -touch $dir/.direnv/{nix,flake}-profile-*.rc - diff --git a/download_hs/.direnv/nix-profile-.928.50aa30a13c4a b/download_hs/.direnv/nix-profile-.928.50aa30a13c4a deleted file mode 120000 index f405d98..0000000 --- a/download_hs/.direnv/nix-profile-.928.50aa30a13c4a +++ /dev/null @@ -1 +0,0 @@ -/nix/store/0gylbw8l57rajj2zpl8dm9mi5sq0lp93-download-hs-0.1.0.0-env \ No newline at end of file diff --git a/download_hs/.direnv/nix-profile-.928.50aa30a13c4a.rc b/download_hs/.direnv/nix-profile-.928.50aa30a13c4a.rc deleted file mode 100644 index c6c29f1..0000000 --- a/download_hs/.direnv/nix-profile-.928.50aa30a13c4a.rc +++ /dev/null @@ -1,2024 +0,0 @@ -unset shellHook -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -AR='ar' -export AR -AS='as' -export AS -BASH='/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash' -CC='gcc' -export CC -CONFIG_SHELL='/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash' -export CONFIG_SHELL -CXX='g++' -export CXX -HOSTTYPE='x86_64' -HOST_PATH='/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4/bin:/nix/store/bblyj5b3ii8n6v4ra0nb37cmi3lf8rz9-coreutils-9.3/bin:/nix/store/l974pi8a5yqjrjlzmg6apk0jwjv81yqw-findutils-4.9.0/bin:/nix/store/8q25nyfirzsng6p57yp8hsaldqqbc7dg-diffutils-3.10/bin:/nix/store/9c5qm297qnvwcf7j0gm01qrslbiqz8rs-gnused-4.9/bin:/nix/store/rx2wig5yhpbwhnqxdy4z7qivj9ln7fab-gnugrep-3.11/bin:/nix/store/7wfya2k95zib8jl0jk5hnbn856sqcgfk-gawk-5.2.2/bin:/nix/store/xpidksbd07in3nd4sjx79ybwwy81b338-gnutar-1.35/bin:/nix/store/202iqv4bd7lh6f7fpy48p7q4d96lqdp7-gzip-1.13/bin:/nix/store/ik7jardq92dxw3fnz3vmlcgi9c8dwwdq-bzip2-1.0.8-bin/bin:/nix/store/v4iswb5kwj33l46dyh2zqh0nkxxlr3mz-gnumake-4.4.1/bin:/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin:/nix/store/cbj1ph7zi009m53hxs90idl1f5i9i941-patch-2.7.6/bin:/nix/store/76z4cjs7jj45ixk12yy6k5z2q2djk2jb-xz-5.4.4-bin/bin:/nix/store/qmfxld7qhk8qxlkx1cm4bkplg1gh6jgj-file-5.45/bin' -export HOST_PATH -IFS=' -' -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -LANG='en_US.UTF-8' -export LANG -LD='ld' -export LD -LINENO='76' -LOCALE_ARCHIVE='/nix/store/v1ifa3741hza5r1507yd4r0vfkqv0mih-glibc-locales-2.38-27/lib/locale/locale-archive' -export LOCALE_ARCHIVE -MACHTYPE='x86_64-pc-linux-gnu' -NIX_BINTOOLS='/nix/store/1alqjnr40dsk7cl15l5sn5y2zdxidc1v-binutils-wrapper-2.40' -export NIX_BINTOOLS -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -NIX_BUILD_CORES='16' -export NIX_BUILD_CORES -NIX_CC='/nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0' -export NIX_CC -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -NIX_CFLAGS_COMPILE=' -frandom-seed=0gylbw8l57' -export NIX_CFLAGS_COMPILE -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -NIX_HARDENING_ENABLE='fortify fortify3 stackprotector pic strictoverflow format relro bindnow' -export NIX_HARDENING_ENABLE -NIX_LDFLAGS='-rpath /home/jawz/Development/NixOS/scripts/download_hs/outputs/out/lib -L/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4/lib -L/nix/store/9kd4bc8fpclpvf1vdwlbila71svyb6w1-libffi-3.4.4/lib -L/nix/store/s3s7gv33p88kzbgki2bprg2a1nc7jnf8-gmp-with-cxx-6.3.0/lib -L/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4/lib -L/nix/store/9kd4bc8fpclpvf1vdwlbila71svyb6w1-libffi-3.4.4/lib -L/nix/store/s3s7gv33p88kzbgki2bprg2a1nc7jnf8-gmp-with-cxx-6.3.0/lib' -export NIX_LDFLAGS -NIX_NO_SELF_RPATH='1' -NIX_STORE='/nix/store' -export NIX_STORE -NM='nm' -export NM -OBJCOPY='objcopy' -export OBJCOPY -OBJDUMP='objdump' -export OBJDUMP -OLDPWD='' -export OLDPWD -OPTERR='1' -OSTYPE='linux-gnu' -PATH='/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8/bin:/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4/bin:/nix/store/7l5mcp1p5zc2ifvaiw9aaab9f1jxj4j2-remove-references-to/bin:/nix/store/sabz7k6lblgxfmacl3bv3yr20hk876cd-cabal-install-3.10.2.1/bin:/nix/store/l9sxfp8hxxf2nbfv1g31lcir8gqrcyjk-ghcid-0.8.9-bin/bin:/nix/store/ycy6k3p91s6w4nvidhm9rb2inmmy342l-haskell-language-server-2.4.0.0/bin:/nix/store/39w18wppiv87s6npdy0gm0g1zhwcwq7h-aeson-pretty-0.8.9/bin:/nix/store/kpqrp4rjpnjdw3gpiz8gsbsgy6bqmbi3-ghcide-2.4.0.0/bin:/nix/store/gzn7qcy5yc54nyp56336sin3lhapww9a-constraints-extras-0.4.0.0/bin:/nix/store/c3r1zn7w2r1imdppahgx10f33xrm4m4r-hie-bios-0.12.0/bin:/nix/store/1wf8mhpffr6bfdn1z2ak2g932z4h4b8w-hiedb-0.4.3.0/bin:/nix/store/k7nzl2123bcxijr5hvmb941z3jlkr6p1-lsp-types-2.0.2.0/bin:/nix/store/krpz24k6a77fnm4256viwa0m8ml8gp55-implicit-hie-0.1.2.7/bin:/nix/store/blhpw7i3ah8hz17fj60pwhfzz3r21hyp-pretty-simple-4.1.2.0/bin:/nix/store/m25nry771j06hcrfp6a3rgrj8rpjnil1-floskell-0.10.8/bin:/nix/store/5b5vvhzncj7zzmbd97zy1f1cpyr1r7di-fourmolu-0.14.0.0/bin:/nix/store/avjgvs065mmisir9zviyl7bi4k7xfgm5-retrie-1.2.2/bin:/nix/store/613mwgj3nzjs636pn7az7qj160iw3kqz-apply-refact-0.13.0.0/bin:/nix/store/rqqlvs9n4b867gn77mykskrxgkphpkng-hlint-3.6.1/bin:/nix/store/35zfcjbxh7fjcp1szc59d9wscpaajczj-cpphs-1.20.9.1/bin:/nix/store/04miyynj9ygrsca1y5liaxas6b6s27mh-hscolour-1.24.4/bin:/nix/store/c03cia2a5835j24fdgfk1xysf1sn80ry-ormolu-0.7.2.0-bin/bin:/nix/store/az2inb8flj6rfgcparg87qzppjfvqi7h-stylish-haskell-0.14.5.0/bin:/nix/store/85jldj870vzcl72yz03labc93bwvqayx-patchelf-0.15.0/bin:/nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0/bin:/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/bin:/nix/store/cx01qk0qyylvkgisbwc7d3pk8sliccgh-glibc-2.38-27-bin/bin:/nix/store/bblyj5b3ii8n6v4ra0nb37cmi3lf8rz9-coreutils-9.3/bin:/nix/store/1alqjnr40dsk7cl15l5sn5y2zdxidc1v-binutils-wrapper-2.40/bin:/nix/store/1fn92b0783crypjcxvdv6ycmvi27by0j-binutils-2.40/bin:/nix/store/bblyj5b3ii8n6v4ra0nb37cmi3lf8rz9-coreutils-9.3/bin:/nix/store/l974pi8a5yqjrjlzmg6apk0jwjv81yqw-findutils-4.9.0/bin:/nix/store/8q25nyfirzsng6p57yp8hsaldqqbc7dg-diffutils-3.10/bin:/nix/store/9c5qm297qnvwcf7j0gm01qrslbiqz8rs-gnused-4.9/bin:/nix/store/rx2wig5yhpbwhnqxdy4z7qivj9ln7fab-gnugrep-3.11/bin:/nix/store/7wfya2k95zib8jl0jk5hnbn856sqcgfk-gawk-5.2.2/bin:/nix/store/xpidksbd07in3nd4sjx79ybwwy81b338-gnutar-1.35/bin:/nix/store/202iqv4bd7lh6f7fpy48p7q4d96lqdp7-gzip-1.13/bin:/nix/store/ik7jardq92dxw3fnz3vmlcgi9c8dwwdq-bzip2-1.0.8-bin/bin:/nix/store/v4iswb5kwj33l46dyh2zqh0nkxxlr3mz-gnumake-4.4.1/bin:/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin:/nix/store/cbj1ph7zi009m53hxs90idl1f5i9i941-patch-2.7.6/bin:/nix/store/76z4cjs7jj45ixk12yy6k5z2q2djk2jb-xz-5.4.4-bin/bin:/nix/store/qmfxld7qhk8qxlkx1cm4bkplg1gh6jgj-file-5.45/bin' -export PATH -PS4='+ ' -RANLIB='ranlib' -export RANLIB -READELF='readelf' -export READELF -SIZE='size' -export SIZE -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -STRINGS='strings' -export STRINGS -STRIP='strip' -export STRIP -XDG_DATA_DIRS='/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8/share:/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4/share:/nix/store/sabz7k6lblgxfmacl3bv3yr20hk876cd-cabal-install-3.10.2.1/share:/nix/store/9hcmngg8z1rkl26bc2rzbsri3ab4dgzs-attoparsec-0.14.4/share:/nix/store/qr4fjr7iw6q37a2vs3940r156rg3nspx-ghc-check-0.5.0.8/share:/nix/store/k7nzl2123bcxijr5hvmb941z3jlkr6p1-lsp-types-2.0.2.0/share:/nix/store/a2ql46krymn5j1k8qq1s5181qvsxf8ih-fail-4.9.0.0/share:/nix/store/c03cia2a5835j24fdgfk1xysf1sn80ry-ormolu-0.7.2.0-bin/share:/nix/store/85jldj870vzcl72yz03labc93bwvqayx-patchelf-0.15.0/share' -export XDG_DATA_DIRS -__structuredAttrs='' -export __structuredAttrs -buildInputs='' -export buildInputs -buildPhase='runHook preBuild -./Setup build -runHook postBuild -' -export buildPhase -builder='/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash' -export builder -checkPhase='runHook preCheck -checkFlagsArray+=( - "--show-details=streaming" - -) -./Setup test $checkFlags ${checkFlagsArray:+"${checkFlagsArray[@]}"} -runHook postCheck -' -export checkPhase -cmakeFlags='' -export cmakeFlags -compileBuildDriverPhase='runHook preCompileBuildDriver - -for i in Setup.hs Setup.lhs /nix/store/4mdp8nhyfddh7bllbi7xszz7k9955n79-Setup.hs; do - test -f $i && break -done - -echo setupCompileFlags: $setupCompileFlags -ghc $setupCompileFlags --make -o Setup -odir $builddir -hidir $builddir $i - -runHook postCompileBuildDriver -' -export compileBuildDriverPhase -configureFlags='' -export configureFlags -configurePhase='runHook preConfigure - -unset GHC_PACKAGE_PATH # Cabal complains if this variable is set during configure. - -echo configureFlags: $configureFlags -./Setup configure $configureFlags 2>&1 | /nix/store/bblyj5b3ii8n6v4ra0nb37cmi3lf8rz9-coreutils-9.3/bin/tee "$NIX_BUILD_TOP/cabal-configure.log" -if /nix/store/rx2wig5yhpbwhnqxdy4z7qivj9ln7fab-gnugrep-3.11/bin/egrep -q -z '\''Warning:.*depends on multiple versions'\'' "$NIX_BUILD_TOP/cabal-configure.log"; then - echo >&2 "*** abort because of serious configure-time warning from Cabal" - exit 1 -fi - -export GHC_PACKAGE_PATH="$packageConfDir:" - -runHook postConfigure -' -export configurePhase -configurePlatforms='' -export configurePlatforms -defaultBuildInputs='' -defaultNativeBuildInputs='/nix/store/85jldj870vzcl72yz03labc93bwvqayx-patchelf-0.15.0 /nix/store/9vk5fqaik9zx14zpfxipg7lxkdk8c5g9-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/wzdsbnv2ba3nj91aql8jjdddfmkkdh7h-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh /nix/store/wmknncrif06fqxa16hpdldhixk95nds0-strip.sh /nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0' -depsBuildBuild='/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8' -export depsBuildBuild -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -depsBuildTarget='' -export depsBuildTarget -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -depsHostHost='' -export depsHostHost -depsHostHostPropagated='' -export depsHostHostPropagated -depsTargetTarget='' -export depsTargetTarget -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -doCheck='1' -export doCheck -doInstallCheck='' -export doInstallCheck -doc='/home/jawz/Development/NixOS/scripts/download_hs/outputs/doc' -export doc -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -declare -a envBuildBuildHooks=() -declare -a envBuildHostHooks=() -declare -a envBuildTargetHooks=() -declare -a envHostHostHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -declare -a envHostTargetHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -declare -a envTargetTargetHooks=() -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' ) -haddockPhase='runHook preHaddock - -runHook postHaddock -' -export haddockPhase -hardeningDisable='pie' -export hardeningDisable -initialPath='/nix/store/bblyj5b3ii8n6v4ra0nb37cmi3lf8rz9-coreutils-9.3 /nix/store/l974pi8a5yqjrjlzmg6apk0jwjv81yqw-findutils-4.9.0 /nix/store/8q25nyfirzsng6p57yp8hsaldqqbc7dg-diffutils-3.10 /nix/store/9c5qm297qnvwcf7j0gm01qrslbiqz8rs-gnused-4.9 /nix/store/rx2wig5yhpbwhnqxdy4z7qivj9ln7fab-gnugrep-3.11 /nix/store/7wfya2k95zib8jl0jk5hnbn856sqcgfk-gawk-5.2.2 /nix/store/xpidksbd07in3nd4sjx79ybwwy81b338-gnutar-1.35 /nix/store/202iqv4bd7lh6f7fpy48p7q4d96lqdp7-gzip-1.13 /nix/store/ik7jardq92dxw3fnz3vmlcgi9c8dwwdq-bzip2-1.0.8-bin /nix/store/v4iswb5kwj33l46dyh2zqh0nkxxlr3mz-gnumake-4.4.1 /nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15 /nix/store/cbj1ph7zi009m53hxs90idl1f5i9i941-patch-2.7.6 /nix/store/76z4cjs7jj45ixk12yy6k5z2q2djk2jb-xz-5.4.4-bin /nix/store/qmfxld7qhk8qxlkx1cm4bkplg1gh6jgj-file-5.45' -installPhase='runHook preInstall - -./Setup install - - - - -for x in $doc/share/doc/download-hs-0.1.0.0"/html/src/"*.html; do - remove-references-to -t $out $x -done -mkdir -p $doc - - - -runHook postInstall -' -export installPhase -mesonFlags='' -export mesonFlags -name='download-hs-0.1.0.0-env' -export name -nativeBuildInputs='/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8 /nix/store/7l5mcp1p5zc2ifvaiw9aaab9f1jxj4j2-remove-references-to /nix/store/sabz7k6lblgxfmacl3bv3yr20hk876cd-cabal-install-3.10.2.1 /nix/store/1m54rhm5dpxlf1n9g9nx3wib78mw8qbk-ghcid-0.8.9 /nix/store/ycy6k3p91s6w4nvidhm9rb2inmmy342l-haskell-language-server-2.4.0.0 /nix/store/5b5vvhzncj7zzmbd97zy1f1cpyr1r7di-fourmolu-0.14.0.0 /nix/store/hfy4b7pzwxs337sncmnpj0wyd7bw7qka-regex-1.1.0.2' -export nativeBuildInputs -out='/home/jawz/Development/NixOS/scripts/download_hs/outputs/out' -export out -outputBin='out' -outputDev='out' -outputDevdoc='REMOVE' -outputDevman='out' -outputDoc='doc' -outputInclude='out' -outputInfo='out' -outputLib='out' -outputMan='out' -outputs='out doc' -export outputs -patches='' -export patches -pkg='/nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0' -declare -a pkgsBuildBuild=('/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8' '/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4' '/nix/store/9kd4bc8fpclpvf1vdwlbila71svyb6w1-libffi-3.4.4' '/nix/store/s3s7gv33p88kzbgki2bprg2a1nc7jnf8-gmp-with-cxx-6.3.0' ) -declare -a pkgsBuildHost=('/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8' '/nix/store/7l5mcp1p5zc2ifvaiw9aaab9f1jxj4j2-remove-references-to' '/nix/store/sabz7k6lblgxfmacl3bv3yr20hk876cd-cabal-install-3.10.2.1' '/nix/store/xphv07xjmmnvyvk17igc1c5f1dlsh0y5-async-2.2.4' '/nix/store/ig8w7gl1v2pwiw2k1wybrq265i50l4hz-hashable-1.4.3.0' '/nix/store/8qs4lwa3l2lijjqjf951gkx2gghwhb1y-base16-bytestring-1.0.2.0' '/nix/store/11cwl351bs7gmfd6w042mqyw2bz0l8nh-base64-bytestring-1.2.1.0' '/nix/store/cb4d4snhzw0b2lrcb65v1y5yj3w18247-Cabal-3.10.2.1' '/nix/store/1z2n72b8yxlih8kqwhj4db7rlycry1z3-Cabal-syntax-3.10.2.0' '/nix/store/cslysdr8gqwx01kvpgidkmn4wyg6hmlp-cabal-install-solver-3.10.2.1' '/nix/store/jrii9m8arh5nx5l8pwmm026kifwblcqh-edit-distance-0.2.2.1' '/nix/store/1pfld0kfsjblis5rhp44q2cxcsjb7i3m-random-1.2.1.1' '/nix/store/idjn1sf82jxipxznk72p0mpqrqxpp7vd-splitmix-0.1.0.5' '/nix/store/7blmk5qsvn7vlp8784dy522140in1xh1-cryptohash-sha256-0.11.102.1' '/nix/store/mnrjwpc8w2alazbx4kd2mhkv02ddb6rn-echo-0.1.4' '/nix/store/4i2yk299c3pa4k76si59grgzlx9gvd6s-hackage-security-0.6.2.3' '/nix/store/lhwg5l1qyizrmmpqg88888mc3ya98xm3-ed25519-0.0.5.0' '/nix/store/2vwgq70aij11j1vqvydkidb25gn1apx0-lukko-0.1.1.3' '/nix/store/yrnzgmrh5c5kmnmxagxmz6h4nfc5s8a7-network-3.1.4.0' '/nix/store/ssd4wwf6k6nn4gqxzp6zsb268jxq3wqn-network-uri-2.6.4.2' '/nix/store/20j6l1vqfpy6x7qcvzii0x59znr4dwjh-th-compat-0.1.4' '/nix/store/mm9qgsjk7k3bbr9cjkdbnfc2i8bmr8gy-tar-0.5.1.1' '/nix/store/j7b6gz1syq8zhy1zizsvm0r2yg4js4pa-zlib-0.6.3.0' '/nix/store/jh2z5cdylp6vqfz0l657rgrnbb5y298b-HTTP-4000.4.1' '/nix/store/bqnhs77bf809w3xwqiqfd3lk2mp3ad1q-regex-base-0.94.0.2' '/nix/store/21drb8fgiqsrxqj3vda9j78wkcxrz5px-regex-posix-0.96.0.1' '/nix/store/246zdgp8wviq51v58a45hrvj1fa9qyga-resolv-0.1.2.0' '/nix/store/5qm6anr33v5fmxpm5mwr38nzfxzxadpj-safe-exceptions-0.1.7.4' '/nix/store/1m54rhm5dpxlf1n9g9nx3wib78mw8qbk-ghcid-0.8.9' '/nix/store/903w1i6hgc43fzqx1zr1xhl8n32iivh7-ansi-terminal-0.11.5' '/nix/store/zkmrlg558iw9iali9dgv5fvs09x7j8zx-ansi-terminal-types-0.11.5' '/nix/store/i5b1f2syj5zwv4wd1chfy8nx2cvrc2l7-colour-2.3.6' '/nix/store/i5b1f2syj5zwv4wd1chfy8nx2cvrc2l7-colour-2.3.6' '/nix/store/s76x6spy8mycwxm43bf9z6zdi9cgv4h1-cmdargs-0.10.22' '/nix/store/bqj8qxnglfxxz51h9dklymsgygx8vjdl-extra-1.7.14' '/nix/store/f89h6y736jqq796w0hnk4fxsmj8c3wwk-clock-0.8.4' '/nix/store/k9z9m7w0mr81gbq18sz0grcgykzlg0dj-fsnotify-0.4.1.0' '/nix/store/wlw9bihmhfdr5pl4k5zp8j63jxd8cylr-hinotify-0.4.1' '/nix/store/8nmsfwbv07fvnyq7hr1rp8bl32jy5hqr-monad-control-1.0.3.1' '/nix/store/baj56qfy0dfnp5kasxy454878j9pjgrv-transformers-base-0.4.6' '/nix/store/pvv9gyaj24ml0y1iyn7zvr4v94ljcsgs-base-orphans-0.9.1' '/nix/store/x1mgb2djis4gn3cqmfidlpzw70dbxdsr-transformers-compat-0.7.2' '/nix/store/x1mgb2djis4gn3cqmfidlpzw70dbxdsr-transformers-compat-0.7.2' '/nix/store/wh5q1qqczi0f50glcsfqf1fs9dfcjmd0-unix-compat-0.7' '/nix/store/a7la7qizxzjb7z97lq01z4gw8jhp121l-terminal-size-0.3.4' '/nix/store/l9sxfp8hxxf2nbfv1g31lcir8gqrcyjk-ghcid-0.8.9-bin' '/nix/store/ycy6k3p91s6w4nvidhm9rb2inmmy342l-haskell-language-server-2.4.0.0' '/nix/store/39w18wppiv87s6npdy0gm0g1zhwcwq7h-aeson-pretty-0.8.9' '/nix/store/x2jkqdy6nfdkshn9cj2mgw0zmkfn39rg-aeson-2.1.2.1' '/nix/store/9hcmngg8z1rkl26bc2rzbsri3ab4dgzs-attoparsec-0.14.4' '/nix/store/bichw287mqjywp2gsl0ibmv7kmri7yl3-scientific-0.3.7.0' '/nix/store/kl9wlqg4s4r295gnj8j81nzj9lc1nd8b-integer-logarithms-1.0.3.1' '/nix/store/93219li1jq15013lf5nc2kqql3w747r1-primitive-0.8.0.0' '/nix/store/w1xgrfi7jp71q45bx27dcaracxnwwsjv-base-compat-batteries-0.12.3' '/nix/store/cvr8aimw0f00q4787s8gwxj6q5m1746a-base-compat-0.12.3' '/nix/store/9cz1fdbvabn0im11xga1avhdbcg8qrlm-data-fix-0.3.2' '/nix/store/va5lq14l1mz2nlqppa51in7vkscgrj2j-dlist-1.0' '/nix/store/48indjqxgq2qbrrvrc8r8aj6la8rmfd1-generically-0.1.1' '/nix/store/6skdsrws065w363nf3b2yg1wb1i2f5dg-indexed-traversable-0.1.3' '/nix/store/nzn9a15j4668v6h6il5xsrm84ksmlzhd-foldable1-classes-compat-0.1' '/nix/store/sk7appb3pby07d0z825274rrr0a9b7lb-tagged-0.8.7' '/nix/store/by1kmnwna3dzcjyximjz4lciyzblwmhd-OneTuple-0.4.1.1' '/nix/store/kicjcr9kjan8jpd7bpqplx727y33qrqr-QuickCheck-2.14.3' '/nix/store/f5wd69ymasxdypaahss1av3fi1ayqw1l-semialign-1.3' '/nix/store/ravi3jhs70n1z1lxg90fkwhxnb2qkb4x-indexed-traversable-instances-0.1.1.2' '/nix/store/7g4q6659frv4slsfw2gxlr3b4w8f293p-unordered-containers-0.2.19.1' '/nix/store/bxaf56bnb7nw0gr801skfcdrq5rfyqqa-vector-0.13.1.0' '/nix/store/qplxjm9j71fl2vw71n7sqwbdib7y8cx0-vector-stream-0.1.0.0' '/nix/store/wl7j3y8xww1yrr1a49l6a44ilacgr8z7-semigroupoids-5.3.7' '/nix/store/b1y74phhh9x7p37rry05q18sj52gj6v7-bifunctors-5.5.15' '/nix/store/yi5r1sk8iqv595d0g724h0xh0h7agz4q-comonad-5.0.8' '/nix/store/w7vlvsan98lqxmq173206yxjbwymcqp2-distributive-0.6.2.1' '/nix/store/v66gfck08srf4061fsaffw5llpxngab1-th-abstraction-0.4.5.0' '/nix/store/bnfix9g7wplya4cd4gm10ylk9l42yly2-contravariant-1.5.5' '/nix/store/w1g0w0nzvhpra1qna586p612985pawyx-StateVar-1.2.2' '/nix/store/yvdzx5lrh4919x8lzsmksm6wk1kn8w80-these-1.2' '/nix/store/csv1l0zm6vp0xl0xmci7x7i5xhblq86z-assoc-1.1' '/nix/store/x3cb16xn8cg214z2fwwdk89aa7kr6wvi-strict-0.5' '/nix/store/ayz4xj26qs35kjzka3wqspqiq5x56sb6-text-short-0.1.5' '/nix/store/w3s5k3d7h636xbj5cp3j8bz4mfniybpi-time-compat-1.9.6.1' '/nix/store/qbbdid7y1kyzrx6dyxs43f1bjir2x3ml-uuid-types-1.0.5.1' '/nix/store/hzb2gc76akx27d3rplxn6s2hb85ih5cp-witherable-0.4.2' '/nix/store/hq6n8lwh9vhrbsv39pmbb6agcdw1mdmk-cryptohash-sha1-0.11.101.0' '/nix/store/abpb21lm5rf6mr0d78c9kvhb6g3r221q-data-default-0.7.1.1' '/nix/store/1s9gccjiv21j7zgifvwp7jf199hf2cpy-data-default-class-0.1.2.0' '/nix/store/miq1gz8n4ng4ljwyc0r9v0g6m3cbdd0r-data-default-instances-containers-0.0.1' '/nix/store/80piib2cjzz7pbbnnv2ilf8l3qi666fj-data-default-instances-dlist-0.0.1' '/nix/store/c8mwk64awxa33nch3jrxwqxk9g6x93ap-data-default-instances-old-locale-0.0.1' '/nix/store/hxashwdb4knakrpg7yv7rnswpfx1h4wa-old-locale-1.0.0.7' '/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8' '/nix/store/kpqrp4rjpnjdw3gpiz8gsbsgy6bqmbi3-ghcide-2.4.0.0' '/nix/store/fii615m2pf3g5jj1v5w772824ahxrvjn-case-insensitive-1.2.1.0' '/nix/store/02nkl2zchlmjrvxbpi739c02m3sqia29-co-log-core-0.3.2.1' '/nix/store/gbpkq197zicj665miz11ijy7k7g01dz5-dependent-map-0.4.0.0' '/nix/store/gzn7qcy5yc54nyp56336sin3lhapww9a-constraints-extras-0.4.0.0' '/nix/store/713gkzdnx3xqkpkr9hp01jfd347bcarc-constraints-0.13.4' '/nix/store/ss7jxsdvx7589kxjjrjh62iyhmqj87m5-type-equality-1' '/nix/store/r9s1zy2malpx4c5l8lqis0x0lld87g8m-dependent-sum-0.7.2.0' '/nix/store/67djpmq6ld33qkrayxhn4jkni43mnchn-some-1.0.4.1' '/nix/store/l78yhx8l74b6l9h7qr46fb6ypp1v61gd-Diff-0.4.1' '/nix/store/4c1y4yjxry8g523rh8xdlp6az2xb9jx2-enummapset-0.7.1.0' '/nix/store/3mwqljsralgpf4hvckhzyzijm93ly2v8-fingertree-0.1.5.0' '/nix/store/x9zbp4vaf241dyaciwh5r2c0vmnsrr5r-focus-1.0.3.2' '/nix/store/qr4fjr7iw6q37a2vs3940r156rg3nspx-ghc-check-0.5.0.8' '/nix/store/ldgk9yz5m5qrawcyppv7iz58cydfpr41-ghc-paths-0.1.0.12' '/nix/store/ldgk9yz5m5qrawcyppv7iz58cydfpr41-ghc-paths-0.1.0.12' '/nix/store/lgnd11aj00hjq9dxw77fqp0d19p45jd8-ghc-trace-events-0.1.2.7' '/nix/store/vg36pajhazrfll3ddijjl85sq78kzk1m-Glob-0.10.2' '/nix/store/gjr0kpps8cgqyr9j54c71ksf5dj1wx1i-haddock-library-1.11.0' '/nix/store/c3r1zn7w2r1imdppahgx10f33xrm4m4r-hie-bios-0.12.0' '/nix/store/qv9fadi17nmrfwcq5ny8pfydf6w3nq0c-conduit-1.3.5' '/nix/store/bvlcsxpkhssij49sidmdmzg8ypxrpp2h-mono-traversable-1.0.15.3' '/nix/store/6r5wl743sfryykigzm0yjviiqh19pwq6-split-0.2.3.5' '/nix/store/gqg0n1hcm7mzivbgq9ldr9jkcn9v42m7-vector-algorithms-0.9.0.1' '/nix/store/d7h24l8bwjqc8345cmll57idyl1qfyv4-bitvec-1.1.5.0' '/nix/store/mr8xcz5z50sra0ic1q1p4nw70bpm2zn3-resourcet-1.2.6' '/nix/store/xvqg1k17l9m7y4jg2sskl1bq0r9f14q9-unliftio-core-0.2.1.0' '/nix/store/xvqg1k17l9m7y4jg2sskl1bq0r9f14q9-unliftio-core-0.2.1.0' '/nix/store/58rdr1l6lw0srly3jjyaw0g7s3f2lx0i-conduit-extra-1.3.6' '/nix/store/lbg7lk69bwbdkghriqsfhigqd3mxzgr1-streaming-commons-0.2.2.6' '/nix/store/c90g95jsdzylcbhksiqpayklc4n9b4rz-typed-process-0.2.11.1' '/nix/store/h5n8b2zcw5sfsnwv1gs2h5j9cl1jk56k-file-embed-0.0.15.0' '/nix/store/9mc9mz9nfx2q85dxpdm9zjxw9hk23qsz-prettyprinter-1.7.1' '/nix/store/q77w911aaw289x5326f1qx26wyvls3vr-temporary-1.3' '/nix/store/yjrk71awz8pvxqayqcxlhvd5gn9xxba8-yaml-0.11.11.2' '/nix/store/v0wfxyxk1dxah7dj001nx5z9jiaqcn63-libyaml-0.1.2' '/nix/store/3qcj0dndz485wlbdjp8wkypdp4nvnncp-optparse-applicative-0.17.1.0' '/nix/store/mnlah2kf89j4sjy0w1fdk7xxvnyi83d2-ansi-wl-pprint-0.6.9' '/nix/store/69223jmi91zz0a5s6ns8cl3a80a9f83l-hie-compat-0.3.1.1' '/nix/store/1wf8mhpffr6bfdn1z2ak2g932z4h4b8w-hiedb-0.4.3.0' '/nix/store/x101v1iwmm4zsmscg5mlch160rdhz1vf-algebraic-graphs-0.7' '/nix/store/mnv5icw8cpkdsk3n80j1yi0w190bc3sv-lucid-2.11.20230408' '/nix/store/zwma0xr4f2njk09bkhc23h4rvzsa6k4b-blaze-builder-0.4.2.3' '/nix/store/5hfrhchl7syifs9zbbckqkz3dlxhhika-mmorph-1.2.0' '/nix/store/g7zg8nsypzanxyxyv70x6r2z9hlza98x-sqlite-simple-0.4.18.2' '/nix/store/l7f66kibdqg9ip1za26s9kq5zcmzfa4b-blaze-textual-0.2.3.1' '/nix/store/mwqnvm7g2c1i23azhllvli08bcb4fas2-direct-sqlite-2.3.28' '/nix/store/z83pgvkr72ypbcy7r8xj8jplpyc9b22j-Only-0.1' '/nix/store/rw1xh146jgfpnmy8k4ki7b9g2jw19q07-hls-graph-2.4.0.0' '/nix/store/l83z2qxzws5a4xqvpkylm8shfy75dlm4-js-dgtable-0.5.2' '/nix/store/1ipyxgnqsf96zzcqcrdxwg1kvjzc8pv8-js-flot-0.8.3' '/nix/store/h95j7hz85m0gqza6mj6ygx7lignklz0n-js-jquery-3.3.1' '/nix/store/83ciqch1pm7rjyhy89fkfpf7bb59i305-list-t-1.0.5.7' '/nix/store/byx30h22nh1gf3fpz9c3m664prkkxdys-foldl-1.4.15' '/nix/store/3w6jhrka9bd97nq0brfk10b51n5vrgj6-profunctors-5.6.2' '/nix/store/ic3i9j590ggnn129dx3hica63jfw2dly-logict-0.8.0.0' '/nix/store/m8rz47qwcbdqj7zbkkyfjgllahvqkvfm-stm-containers-1.2.0.3' '/nix/store/xb7apwxv6x9d7svjwwsg1bj0d3qdgd7h-deferred-folds-0.9.18.5' '/nix/store/zjk4pr93pi8cik0kqzpx3v40wsw8k5km-stm-hamt-1.2.0.14' '/nix/store/glmx4zq076h4i4vw3223b1cabgr05rgx-primitive-extras-0.10.1.10' '/nix/store/3548jlnyfsnjzziq56cv3kjznhq0bgwb-cereal-0.5.8.3' '/nix/store/fhg7dw7xyzky1i7yzpc4xcbl3md3k07f-primitive-unlifted-0.1.3.1' '/nix/store/qvv5lmx6zy8fy0z71gp549a42x767025-unliftio-0.2.25.0' '/nix/store/79phn69hqw156gi5gfqagxb577g0h72f-hls-plugin-api-2.4.0.0' '/nix/store/yfffn0xgd2anm1xp5q6xd1hbqz2krr5d-hw-fingertree-0.1.2.1' '/nix/store/5xlapbsragg9ki026vily8974jzw47f1-hw-prim-0.6.3.2' '/nix/store/vxgxjrflcghlba06y44iiz4qqxsfnfjg-mmap-0.5.9' '/nix/store/z0b3c9wld298lnhrbcaqr9qf5lsmsci4-lens-5.2.3' '/nix/store/9bfmvfvmwhw80ffrlfz0r6jrrya9pjk7-call-stack-0.4.0' '/nix/store/6vnycf13wcrryaszrmjil9l928h7zpkz-free-5.1.10' '/nix/store/aqaxbxlpfq4x8y1x2f7idyqjh0gs1fr7-kan-extensions-5.2.5' '/nix/store/5gf1jnsf6jas3sw9dz35rkwbl2n6v3c5-adjunctions-4.4.2' '/nix/store/mdd9hbf4d7bd98axr2jf7j0x7s1zaa4i-semigroups-0.20' '/nix/store/8n29pr3qlcycdrx9h8jbbqdgbyn2gdi1-void-0.7.3' '/nix/store/wjmpv8z3n74s8424dd2pfnf2cdd4wjnb-invariant-0.6.2' '/nix/store/v2m43kp6p3hccjm04drkb3x36f493mlp-parallel-3.2.2.0' '/nix/store/a7xrxmqhysm474y8vz5vwgjlgbs18ajv-reflection-2.1.7' '/nix/store/2cjvwfrf7rr9dvvp1gsjwpm1i9qwimfb-lens-aeson-1.2.3' '/nix/store/sz843z98hqrkhwlffy5qy641c7nl0y9w-lsp-2.2.0.0' '/nix/store/k7nzl2123bcxijr5hvmb941z3jlkr6p1-lsp-types-2.0.2.0' '/nix/store/syp0xzpvzir8mhf4ba5k1d49hissj8mw-mod-0.2.0.1' '/nix/store/16l00svhbpdbb81i8wy25hvv5iqx0rq0-semirings-0.6' '/nix/store/a9bhwb9aym47nnanh4l4np6fam41wp2w-row-types-1.0.1.2' '/nix/store/hcq327qwrpi1w8h9ffzfjmfmjm2qinjv-generic-lens-2.2.2.0' '/nix/store/rsyxs8pczaizn93yq047whfz0q2xi09v-generic-lens-core-2.2.1.0' '/nix/store/5bawpzi16v9daj3av50na8mk1zj2c46c-indexed-profunctors-0.1.1.1' '/nix/store/9ishaqcwy24wcn1m9l1vnv423gc52m5v-safe-0.3.19' '/nix/store/hfy4b7pzwxs337sncmnpj0wyd7bw7qka-regex-1.1.0.2' '/nix/store/3f4k76xck8mcvfgqvdq8316xmx31awbn-regex-pcre-builtin-0.95.2.3.8.44' '/nix/store/px5sd3gmlm252ws6m9d20wa4aqr9d3ra-regex-tdfa-1.3.2.2' '/nix/store/v0p5byzyx4zd1s1ca4798192r8dsgwl6-time-locale-compat-0.1.1.5' '/nix/store/4rxdlihx69zpc19w25kybj6ml9mf4c5l-utf8-string-1.0.2' '/nix/store/3q5j6bc41gh95d8z66621vn32rdqx5x3-sorted-list-0.2.1.2' '/nix/store/a732vgcazyf7xxqyx77kbrdmcf9ax4zn-text-rope-0.2' '/nix/store/4d8qzcbby06kdi2wfbinpmbbm02r52ig-uuid-1.3.15' '/nix/store/6y93l92r1fz2n5qwvzwlfr1gli3jhb48-cryptohash-md5-0.11.101.0' '/nix/store/nigm742ywycmq285607nv7gk41zqdhhq-entropy-0.4.1.10' '/nix/store/gajr7a6slqqgjmcgbs9cnbm948kcq5fl-network-info-0.2.1' '/nix/store/z73m74mk7kl400yxp6sl9flca485pq0r-megaparsec-9.3.1' '/nix/store/ihrv2kmcwvzza3g7bf95vaa21arz83yb-parser-combinators-1.3.0' '/nix/store/k3npma131w6dw7vfb3jx4mjkzxb91gpc-opentelemetry-0.8.0' '/nix/store/krpz24k6a77fnm4256viwa0m8ml8gp55-implicit-hie-0.1.2.7' '/nix/store/8j2mrn8a8ap5x60xalr82zlcc4pvv8ma-filepattern-0.1.3' '/nix/store/8j2mrn8a8ap5x60xalr82zlcc4pvv8ma-filepattern-0.1.3' '/nix/store/cg5d7frw50327jm021qwafnl63mg8gkl-implicit-hie-cradle-0.5.0.1' '/nix/store/71ac90vpn54r1zh07midgjdcy6hv5xxz-prettyprinter-ansi-terminal-1.1.3' '/nix/store/rasvc7i5qcid2aajw29bgdclkqwgcg9r-syb-0.7.2.4' '/nix/store/nka4mg1kngxj2k22wb9ic1pbanb1yfvh-gitrev-1.3.1' '/nix/store/q4kq6h84nqpa0ps7flaf9c0a2yzqasn9-githash-0.1.7.0' '/nix/store/sbk9phf4rzqpyxpphlzx6l6rvvc8lymk-hls-alternate-number-format-plugin-2.4.0.0' '/nix/store/3lw894yyya7m6z0ssnxbd0fckrmxz2m0-hls-cabal-fmt-plugin-2.4.0.0' '/nix/store/7mdvms8jrq8snmy778prsh7zl6ikmd8a-process-extras-0.7.4' '/nix/store/lxw7kxn8mpz1ldiqls89y7ig751iwp70-generic-deriving-1.14.5' '/nix/store/msy3hn71dp8f1lclmn917wpk19wanzj4-ListLike-4.7.8.2' '/nix/store/kaf54hm177s2g05a3gqnmgakvwc8g8cc-fmlist-0.9.4' '/nix/store/41yvkym3nkkj98svw23w4qlssp0d8ppa-hls-cabal-plugin-2.4.0.0' '/nix/store/wr1kwnsaazlafj8c49kgxs46dmnfg8bg-hls-call-hierarchy-plugin-2.4.0.0' '/nix/store/xqi65wx8ab4j85pbqd18qv3hykcw2rpm-hls-change-type-signature-plugin-2.4.0.0' '/nix/store/vqx7d0jpci4ad1vr8cmmwcpcy2716930-hls-class-plugin-2.4.0.0' '/nix/store/n97kiyxkq3rj0asfwnfnisnc6ll15nb5-ghc-exactprint-1.6.1.3' '/nix/store/a2ql46krymn5j1k8qq1s5181qvsxf8ih-fail-4.9.0.0' '/nix/store/4x03rr2pzzd318wimbggmj4sld7gda3l-ordered-containers-0.2.3' '/nix/store/dd95bjr9m262v00j9vww1c58r54fl6mh-hls-code-range-plugin-2.4.0.0' '/nix/store/k3flskgs2wpl7s2x43nbg0yx3f57dk7h-hls-eval-plugin-2.4.0.0' '/nix/store/blhpw7i3ah8hz17fj60pwhfzz3r21hyp-pretty-simple-4.1.2.0' '/nix/store/k7nicnz5syr4v9axlp7q2hn38kq2f9gz-hls-explicit-fixity-plugin-2.4.0.0' '/nix/store/w8vjgnqijczzp45gr6gamwdswqhkd9y8-hls-explicit-imports-plugin-2.4.0.0' '/nix/store/073skj46cajgra4p76bwzm5sah83d2sr-hls-explicit-record-fields-plugin-2.4.0.0' '/nix/store/jpgi9xmp1bjv82qa20cavaq71wym0f78-hls-floskell-plugin-2.4.0.0' '/nix/store/m25nry771j06hcrfp6a3rgrj8rpjnil1-floskell-0.10.8' '/nix/store/wg2cdzq8qkwi130jd1p4c6n9h2xbw9g4-haskell-src-exts-1.23.1' '/nix/store/2sdz19qjjxxpfscq5xw66r5wqmjm7xxc-monad-dijkstra-0.1.1.4' '/nix/store/d1cakb1x6wxz6i4hm9ywjksppszhig11-psqueues-0.2.8.0' '/nix/store/f8bp6qfnlkfgqg73z2jafqdnk46lg2bl-hls-fourmolu-plugin-2.4.0.0' '/nix/store/5b5vvhzncj7zzmbd97zy1f1cpyr1r7di-fourmolu-0.14.0.0' '/nix/store/4ak6xcwlm6xchayv2bw76df6xyzgkgm0-ghc-lib-parser-9.6.3.20231014' '/nix/store/6picsjm8hkjqlda4w6rr1i3q2q7vvfh8-MemoTrie-0.6.11' '/nix/store/7aq0hnqnaq00h5bdi6w76fhv9jl8l78p-newtype-generics-0.6.2' '/nix/store/4lkzgm4rvsiy41756fas5jcyy4vbph4z-th-env-0.1.1' '/nix/store/j0i16zvv0jz4c4ix6xs37cg6wqlsyf3g-hls-gadt-plugin-2.4.0.0' '/nix/store/y8xcjhxasg3bn7skhagkrq7jlqhb8il1-hls-refactor-plugin-2.4.0.0' '/nix/store/m1xq3p34djvlr71ljmqbld4c2zkpwql5-regex-applicative-0.3.4' '/nix/store/cq4ld5x1q65acmwhakckmy0000454gsh-filtrable-0.1.6.0' '/nix/store/avjgvs065mmisir9zviyl7bi4k7xfgm5-retrie-1.2.2' '/nix/store/4z3k5wwq0ffpxm1f6glly9w3rs7irixf-random-shuffle-0.0.4' '/nix/store/qin7anvw53ng0c8qsy4ikhx9rndpvnvm-MonadRandom-0.6' '/nix/store/vh080kw2v6wng5w0ryhv1p7lrws61792-hls-hlint-plugin-2.4.0.0' '/nix/store/613mwgj3nzjs636pn7az7qj160iw3kqz-apply-refact-0.13.0.0' '/nix/store/2xcsm1pvxyxdwgd7lvwqm6bygb3cl8nd-filemanip-0.3.6.3' '/nix/store/ch6zpnvaic5503vfamvh9ikzym4rx2kq-refact-0.3.0.2' '/nix/store/cl8wbcrchw1a29xvhny0gff1gjpppd3k-uniplate-1.6.13' '/nix/store/cl8wbcrchw1a29xvhny0gff1gjpppd3k-uniplate-1.6.13' '/nix/store/i405hgm8f6ssxp6blpky846rpm6ap72i-ghc-lib-parser-ex-9.6.0.2' '/nix/store/rqqlvs9n4b867gn77mykskrxgkphpkng-hlint-3.6.1' '/nix/store/35zfcjbxh7fjcp1szc59d9wscpaajczj-cpphs-1.20.9.1' '/nix/store/3d7xaw13halqbf1z0zg4lj0ny7viwmha-polyparse-1.13' '/nix/store/3d7xaw13halqbf1z0zg4lj0ny7viwmha-polyparse-1.13' '/nix/store/73gbq7w9qd8kn9ij4ka0a97yrnx33ckx-deriving-aeson-0.2.9' '/nix/store/04miyynj9ygrsca1y5liaxas6b6s27mh-hscolour-1.24.4' '/nix/store/4lbqhvg3qp14zzj0rqxb7ywkgp2smsxr-hls-module-name-plugin-2.4.0.0' '/nix/store/6n9fznqdljy1dhxy7z3rlrp27zl9mp3d-hls-ormolu-plugin-2.4.0.0' '/nix/store/ara9c3ndzdv9a0z5f35jxipfl9kfqyli-ormolu-0.7.2.0' '/nix/store/c03cia2a5835j24fdgfk1xysf1sn80ry-ormolu-0.7.2.0-bin' '/nix/store/6yhq3dgcyzx07pw2mc1s38iw1hmrwjnh-hls-overloaded-record-dot-plugin-2.4.0.0' '/nix/store/m36cab00w27s2675a4v7abz2qbyq5zk4-hls-pragmas-plugin-2.4.0.0' '/nix/store/s6vnj8z5pi6zbgi2lb9xwmbqfka5nyzv-fuzzy-0.1.0.1' '/nix/store/i60wpxw0lya7rhpcric32cyb23qkmdw8-monoid-subclasses-1.2.4.1' '/nix/store/a87cg7mq5hgcsgcs5kndzih4h3hmnr79-commutative-semigroups-0.1.0.1' '/nix/store/fd2v8prhcrpf60avw6250x8q4vc2jqvj-primes-0.2.1.0' '/nix/store/d89phi1np0wk9n81az296gwkkyv8djx3-hls-qualify-imported-names-plugin-2.4.0.0' '/nix/store/m6rykva6f88nsxn9dz0brccwk66rprb8-hls-rename-plugin-2.4.0.0' '/nix/store/5qb6jyp9v9ix53pv9p2jwvcgg3iqa0y0-hls-retrie-plugin-2.4.0.0' '/nix/store/mgqvya20vkn8qhq4h64nrv8lkzp4hind-hls-splice-plugin-2.4.0.0' '/nix/store/fs0cpv57fsshm662xh71p25rdmdyfwc4-hls-stylish-haskell-plugin-2.4.0.0' '/nix/store/az2inb8flj6rfgcparg87qzppjfvqi7h-stylish-haskell-0.14.5.0' '/nix/store/jl5q6xgs4ijjiyh83hj2qw1amv23fcwx-HsYAML-0.2.1.3' '/nix/store/v1whaa8xs0214afd4g8909r2mfj7a68c-HsYAML-aeson-0.2.0.1' '/nix/store/v1whaa8xs0214afd4g8909r2mfj7a68c-HsYAML-aeson-0.2.0.1' '/nix/store/v1yf7b78xch608v480hq35vkzla4w35d-optparse-simple-0.1.1.4' '/nix/store/v1yf7b78xch608v480hq35vkzla4w35d-optparse-simple-0.1.1.4' '/nix/store/85jldj870vzcl72yz03labc93bwvqayx-patchelf-0.15.0' '/nix/store/9vk5fqaik9zx14zpfxipg7lxkdk8c5g9-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/wzdsbnv2ba3nj91aql8jjdddfmkkdh7h-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh' '/nix/store/wmknncrif06fqxa16hpdldhixk95nds0-strip.sh' '/nix/store/90h6k8ylkgn81k10190v5c9ldyjpzgl9-gcc-wrapper-12.3.0' '/nix/store/1alqjnr40dsk7cl15l5sn5y2zdxidc1v-binutils-wrapper-2.40' ) -declare -a pkgsBuildTarget=() -declare -a pkgsHostHost=('/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4' '/nix/store/9kd4bc8fpclpvf1vdwlbila71svyb6w1-libffi-3.4.4' '/nix/store/s3s7gv33p88kzbgki2bprg2a1nc7jnf8-gmp-with-cxx-6.3.0' '/nix/store/5i51nfixxx3p3gshkfsjj4bzp7wajwxz-ncurses-6.4' ) -declare -a pkgsHostTarget=() -declare -a pkgsTargetTarget=() -pname='download-hs' -export pname -declare -a postFixupHooks=('_makeSymlinksRelativeInAllOutputs' '_multioutPropagateDev' ) -postPatch='' -export postPatch -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -declare -a preConfigureHooks=('_multioutConfig' ) -preConfigurePhases='compileBuildDriverPhase updateAutotoolsGnuConfigScriptsPhase' -export preConfigurePhases -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -preInstallPhases='haddockPhase' -export preInstallPhases -prePatch='' -export prePatch -prePhases='setupCompilerEnvironmentPhase' -export prePhases -prefix='/home/jawz/Development/NixOS/scripts/download_hs/outputs/out' -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -propagatedBuildInputs='' -export propagatedBuildInputs -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -setOutputFlags='' -export setOutputFlags -setupCompilerEnvironmentPhase='NIX_BUILD_CORES=$(( NIX_BUILD_CORES < 16 ? NIX_BUILD_CORES : 16 )) -runHook preSetupCompilerEnvironment - -echo "Build with /nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8." - - -builddir="$(mktemp -d)" -setupPackageConfDir="$builddir/setup-package.conf.d" -mkdir -p $setupPackageConfDir -packageConfDir="$builddir/package.conf.d" -mkdir -p $packageConfDir - -setupCompileFlags="-package-db=$setupPackageConfDir -j$NIX_BUILD_CORES +RTS -A64M -RTS -threaded -rtsopts" -configureFlags="--verbose --prefix=$out --libdir=\$prefix/lib/\$compiler --libsubdir=\$abi/\$libname --docdir=$doc/share/doc/download-hs-0.1.0.0 --with-gcc=$CC --package-db=$packageConfDir --ghc-options=-j$NIX_BUILD_CORES +RTS -A64M -RTS --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-option=-split-sections $configureFlags" -for p in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}"; do - # If this dependency has a package database, then copy the contents of it, -# unless it is one of our GHCs. These can appear in our dependencies when -# we are doing native builds, and they have package databases in them, but -# we do not want to copy them over. -# -# We don'\''t need to, since those packages will be provided by the GHC when -# we compile with it, and doing so can result in having multiple copies of -# e.g. Cabal in the database with the same name and version, which is -# ambiguous. -if [ -d "$p/lib/ghc-9.4.8/package.conf.d" ] && [ "$p" != "/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8" ] && [ "$p" != "/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8" ]; then - cp -f "$p/lib/ghc-9.4.8/package.conf.d/"*.conf $setupPackageConfDir/ - continue -fi - -done -ghc-pkg --package-db="$setupPackageConfDir" recache -for p in "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}"; do - # If this dependency has a package database, then copy the contents of it, -# unless it is one of our GHCs. These can appear in our dependencies when -# we are doing native builds, and they have package databases in them, but -# we do not want to copy them over. -# -# We don'\''t need to, since those packages will be provided by the GHC when -# we compile with it, and doing so can result in having multiple copies of -# e.g. Cabal in the database with the same name and version, which is -# ambiguous. -if [ -d "$p/lib/ghc-9.4.8/package.conf.d" ] && [ "$p" != "/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8" ] && [ "$p" != "/nix/store/nlb9rfsx649rzwy0gfncvwxiic96ivik-ghc-9.4.8" ]; then - cp -f "$p/lib/ghc-9.4.8/package.conf.d/"*.conf $packageConfDir/ - continue -fi - - if [ -d "$p/include" ]; then - configureFlags+=" --extra-include-dirs=$p/include" - fi - if [ -d "$p/lib" ]; then - configureFlags+=" --extra-lib-dirs=$p/lib" - fi -if [[ -d "$p/Library/Frameworks" ]]; then - configureFlags+=" --extra-framework-dirs=$p/Library/Frameworks" -fi -done -ghc-pkg --package-db="$packageConfDir" recache - -runHook postSetupCompilerEnvironment -' -export setupCompilerEnvironmentPhase -shell='/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash' -export shell -src='/nix/store/67c54822gzblj3pzvcmazp7yfh3fhfd2-download_hs' -export src -stdenv='/nix/store/wr08yanv2bjrphhi5aai12hf2qz5kvic-stdenv-linux' -export stdenv -strictDeps='' -export strictDeps -system='x86_64-linux' -export system -declare -a unpackCmdHooks=('_defaultUnpack' ) -version='0.1.0.0' -export version -_accumFlagsArray () -{ - - local name; - if [ -n "$__structuredAttrs" ]; then - for name in "$@"; - do - local -n nameref="$name"; - flagsArray+=(${nameref+"${nameref[@]}"}); - done; - else - for name in "$@"; - do - local -n nameref="$name"; - case "$name" in - *Array) - flagsArray+=(${nameref+"${nameref[@]}"}) - ;; - *) - flagsArray+=(${nameref-}) - ;; - esac; - done; - fi -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -_allFlags () -{ - - export system pname name version; - for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'); - do - if (( "${NIX_DEBUG:-0}" >= 1 )); then - printf "@%s@ -> %q\n" "${varName}" "${!varName}" 1>&2; - fi; - args+=("--subst-var" "$varName"); - done -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -pr --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - xz -d < "$fn" | tar xf - --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -_makeSymlinksRelative () -{ - - local symlinkTarget; - if [ "${dontRewriteSymlinks-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - while IFS= read -r -d '' f; do - symlinkTarget=$(readlink "$f"); - if [[ "$symlinkTarget"/ != "$prefix"/* ]]; then - continue; - fi; - if [ ! -e "$symlinkTarget" ]; then - echo "the symlink $f is broken, it points to $symlinkTarget (which is missing)"; - fi; - echo "rewriting symlink $f to be relative to $prefix"; - ln -snrf "$symlinkTarget" "$f"; - done < <(find $prefix -type l -print0) -} -_makeSymlinksRelativeInAllOutputs () -{ - - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" _makeSymlinksRelative; - done -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - 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; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - 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" \; -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - source "$pkg/nix-support/setup-hook"; - fi -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if declare -p "$1" 2> /dev/null | grep -q '^'; then - type="$(declare -p "$1")"; - if [[ "$type" =~ "declare -A" ]]; then - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1; - else - if [[ "$type" =~ "declare -a" ]]; then - useArray=true; - else - useArray=false; - fi; - fi; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local i; - find "$dir" -type f -print0 | while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if isELF "$i"; then - if { - printf :; - patchelf --print-rpath "$i" - } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/"; - exit 1; - fi; - fi; - if isScript "$i"; then - if [ -e "$(dirname "$i")/.$(basename "$i")-wrapped" ]; then - if grep -q -F "$TMPDIR/" "$i"; then - echo "wrapper script $i contains a forbidden reference to $TMPDIR/"; - exit 1; - fi; - fi; - fi; - done -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - fi -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget=check; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget=test; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray; - if [ -n "$__structuredAttrs" ]; then - flagsArray+=("${checkFlags[@]:-VERBOSE=y}"); - else - flagsArray+=(${checkFlags:-VERBOSE=y}); - fi; - _accumFlagsArray checkFlagsArray; - flagsArray+=(${checkTarget}); - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | while IFS= read -r -d '' f; do - if gzip -c -n "$f" > "$f".gz; then - rm "$f"; - else - rm "$f".gz; - fi; - done; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - 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" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - prependToVar configureFlags "${prefixKey:---prefix=}$prefix"; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - _accumFlagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - _accumFlagsArray distFlags distFlagsArray; - flagsArray+=(${distTarget:-dist}); - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -dumpVars () -{ - - if [ "${noDumpEnvVars:-0}" != 1 ]; then - export 2> /dev/null >| "$NIX_BUILD_TOP/env-vars" || true; - fi -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case "${!varSlice-}" in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -getHostRole () -{ - - getRole "$hostOffset" -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.40: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -getTargetRole () -{ - - getRole "$targetOffset" -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.40: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray; - flagsArray+=(${installCheckTarget:-installcheck}); - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL=$SHELL); - _accumFlagsArray makeFlags makeFlagsArray installFlags installFlagsArray; - if [ -n "$__structuredAttrs" ]; then - flagsArray+=("${installTargets[@]:-install}"); - else - flagsArray+=(${installTargets:-install}); - fi; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - if [ -n "$__structuredAttrs" ]; then - patchesArray=(${patches:+"${patches[@]}"}); - else - patchesArray=(${patches:-}); - fi; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - local -a flagsArray; - if [ -n "$__structuredAttrs" ]; then - flagsArray=("${patchFlags[@]:--p1}"); - else - flagsArray=(${patchFlags:--p1}); - fi; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -patchShebangs () -{ - - local pathName; - local update; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f"; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - args=${args#* }; - newPath="$(PATH="${!pathName}" command -v "env" || true)"; - args="-S $(PATH="${!pathName}" command -v "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" command -v "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" command -v "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if declare -p "$1" 2> /dev/null | grep -q '^'; then - type="$(declare -p "$1")"; - if [[ "$type" =~ "declare -A" ]]; then - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1; - else - if [[ "$type" =~ "declare -a" ]]; then - useArray=true; - else - useArray=false; - fi; - fi; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _eval "$hook" "$@"; - done; - return 0 -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - if [[ -n $NIX_LOG_FD ]]; then - echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&"$NIX_LOG_FD"; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - local endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}"; - cd "${sourceRoot:-.}"; - fi -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -showPhaseHeader () -{ - - local phase="$1"; - case "$phase" in - unpackPhase) - echo "unpacking sources" - ;; - patchPhase) - echo "patching sources" - ;; - configurePhase) - echo "configuring" - ;; - buildPhase) - echo "building" - ;; - checkPhase) - echo "running tests" - ;; - installPhase) - echo "installing" - ;; - fixupPhase) - echo "post-installation fixup" - ;; - installCheckPhase) - echo "running install tests" - ;; - *) - echo "$phase" - ;; - esac -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -print0 | xargs -r -0 -n1 -- realpath -z | sort -u -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - case "$1" in - --replace) - pattern="$2"; - replacement="$3"; - shift 3; - local savedvar; - savedvar="${!var}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - if [ "$pattern" != "$replacement" ]; then - if [ "${!var}" == "$savedvar" ]; then - echo "substituteStream(): WARNING: pattern '$pattern' doesn't match anything in $description" 1>&2; - fi; - fi - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream(): ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream(): ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - if [ -n "$__structuredAttrs" ]; then - srcsArray=("${srcs[@]}"); - else - srcsArray=($srcs); - fi; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/c54kyc3vn0jbq5hznimvx6wz15jxw8jq-gnu-config-2023-09-19/$script" "$f"; - done; - done -} -updateSourceDateEpoch () -{ - - local path="$1"; - 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)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" -export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)" -export TMP="$NIX_BUILD_TOP" -export TMPDIR="$NIX_BUILD_TOP" -export TEMP="$NIX_BUILD_TOP" -export TEMPDIR="$NIX_BUILD_TOP" -eval "$shellHook" diff --git a/find_tweet_user/.direnv/bin/nix-direnv-reload b/find_tweet_user/.direnv/bin/nix-direnv-reload deleted file mode 100755 index 04b6982..0000000 --- a/find_tweet_user/.direnv/bin/nix-direnv-reload +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -set -e -if [[ ! -d "/home/jawz/Development/Scripts/tweepy" ]]; then - echo "Cannot find source directory; Did you move it?" - echo "(Looking for "/home/jawz/Development/Scripts/tweepy")" - echo 'Cannot force reload with this script - use "direnv reload" manually and then try again' - exit 1 -fi - -# rebuild the cache forcefully -_nix_direnv_force_reload=1 direnv exec "/home/jawz/Development/Scripts/tweepy" true - -# Update the mtime for .envrc. -# This will cause direnv to reload again - but without re-building. -touch "/home/jawz/Development/Scripts/tweepy/.envrc" - -# Also update the timestamp of whatever profile_rc we have. -# This makes sure that we know we are up to date. -touch -r "/home/jawz/Development/Scripts/tweepy/.envrc" "/home/jawz/Development/Scripts/tweepy/.direnv"/*.rc diff --git a/find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb b/find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb deleted file mode 120000 index 3b7872e..0000000 --- a/find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb +++ /dev/null @@ -1 +0,0 @@ -/nix/store/f2kzjjcz6kxhqkm2755mrw4ylhv1ba6q-nix-shell-env \ No newline at end of file diff --git a/find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb.rc b/find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb.rc deleted file mode 100644 index 25309ed..0000000 --- a/find_tweet_user/.direnv/nix-profile-24.11-wb6agba4kfsxpbnb.rc +++ /dev/null @@ -1,2000 +0,0 @@ -unset shellHook -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -AR='ar' -export AR -AS='as' -export AS -BASH='/nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32/bin/bash' -CC='gcc' -export CC -CONFIG_SHELL='/nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32/bin/bash' -export CONFIG_SHELL -CXX='g++' -export CXX -HOSTTYPE='x86_64' -HOST_PATH='/nix/store/ph44jcx3ddmlwh394mh1wb7f1qigxqb1-coreutils-9.5/bin:/nix/store/yb8icljkwhk5lla4nci3myndq2m4ywly-findutils-4.10.0/bin:/nix/store/phqahkhjsk8sl2jjiid1d47l2s4wy33h-diffutils-3.10/bin:/nix/store/yd9vbyhbxx62j0cyhd6v0iacz11nxpvc-gnused-4.9/bin:/nix/store/lvnwdmnjm7nvaq0a3vhvvn46iy4ql7gr-gnugrep-3.11/bin:/nix/store/0np7q7np75csai2cwzx57n332vn9ig4i-gawk-5.2.2/bin:/nix/store/zvn9bvrl2g516d2hfnanljiw24qa6w8l-gnutar-1.35/bin:/nix/store/db379c3zrmncmbv5khqxpk6ggbhxjw61-gzip-1.13/bin:/nix/store/girfp68w14pxfii52ak8gcs212y4q2s2-bzip2-1.0.8-bin/bin:/nix/store/21y3gqgm2a3w94m0wcrz1xxshks80z7p-gnumake-4.4.1/bin:/nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32/bin:/nix/store/91ixz3zw9ipc5j93gybir9fp5mzisq8w-patch-2.7.6/bin:/nix/store/6v73xwg2c7p5ap29ckyg18ng87pzlnxs-xz-5.6.2-bin/bin:/nix/store/a6nsbir3y5ni3wwkw933aqvcmyyywnnz-file-5.45/bin' -export HOST_PATH -IFS=' -' -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -LD='ld' -export LD -LINENO='76' -MACHTYPE='x86_64-pc-linux-gnu' -NIX_BINTOOLS='/nix/store/l7n97992gd5piaw8phkxzsz176gfk1yj-binutils-wrapper-2.43.1' -export NIX_BINTOOLS -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -NIX_BUILD_CORES='16' -export NIX_BUILD_CORES -NIX_CC='/nix/store/vh9fsdhgxcnab2qk7vdp2palkkn6j3cp-gcc-wrapper-13.3.0' -export NIX_CC -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -NIX_CFLAGS_COMPILE=' -frandom-seed=f2kzjjcz6k -isystem /nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env/include -isystem /nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env/include' -export NIX_CFLAGS_COMPILE -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -NIX_HARDENING_ENABLE='bindnow format fortify fortify3 pic relro stackprotector strictoverflow zerocallusedregs' -export NIX_HARDENING_ENABLE -NIX_LDFLAGS='-rpath /home/jawz/Development/Scripts/tweepy/outputs/out/lib -L/nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env/lib -L/nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env/lib' -export NIX_LDFLAGS -NIX_NO_SELF_RPATH='1' -NIX_STORE='/nix/store' -export NIX_STORE -NM='nm' -export NM -OBJCOPY='objcopy' -export OBJCOPY -OBJDUMP='objdump' -export OBJDUMP -OLDPWD='' -export OLDPWD -OPTERR='1' -OSTYPE='linux-gnu' -PATH='/nix/store/nk5ncijygravaa05zv2l38smyx7j5l5v-geckodriver-0.35.0/bin:/nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env/bin:/nix/store/dvfb5mrpfhg5211v6pl0a3fmz9idg6w7-patchelf-0.15.0/bin:/nix/store/vh9fsdhgxcnab2qk7vdp2palkkn6j3cp-gcc-wrapper-13.3.0/bin:/nix/store/0vsyw5bhwmisszyfd1a0sdnwvnf4qa5a-gcc-13.3.0/bin:/nix/store/vpsla1ivhavzd4fmi95yzmgb4g9rd072-glibc-2.40-36-bin/bin:/nix/store/ph44jcx3ddmlwh394mh1wb7f1qigxqb1-coreutils-9.5/bin:/nix/store/l7n97992gd5piaw8phkxzsz176gfk1yj-binutils-wrapper-2.43.1/bin:/nix/store/vcvhwiilizhijk7ywyn58p9l005n9sbn-binutils-2.43.1/bin:/nix/store/ph44jcx3ddmlwh394mh1wb7f1qigxqb1-coreutils-9.5/bin:/nix/store/yb8icljkwhk5lla4nci3myndq2m4ywly-findutils-4.10.0/bin:/nix/store/phqahkhjsk8sl2jjiid1d47l2s4wy33h-diffutils-3.10/bin:/nix/store/yd9vbyhbxx62j0cyhd6v0iacz11nxpvc-gnused-4.9/bin:/nix/store/lvnwdmnjm7nvaq0a3vhvvn46iy4ql7gr-gnugrep-3.11/bin:/nix/store/0np7q7np75csai2cwzx57n332vn9ig4i-gawk-5.2.2/bin:/nix/store/zvn9bvrl2g516d2hfnanljiw24qa6w8l-gnutar-1.35/bin:/nix/store/db379c3zrmncmbv5khqxpk6ggbhxjw61-gzip-1.13/bin:/nix/store/girfp68w14pxfii52ak8gcs212y4q2s2-bzip2-1.0.8-bin/bin:/nix/store/21y3gqgm2a3w94m0wcrz1xxshks80z7p-gnumake-4.4.1/bin:/nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32/bin:/nix/store/91ixz3zw9ipc5j93gybir9fp5mzisq8w-patch-2.7.6/bin:/nix/store/6v73xwg2c7p5ap29ckyg18ng87pzlnxs-xz-5.6.2-bin/bin:/nix/store/a6nsbir3y5ni3wwkw933aqvcmyyywnnz-file-5.45/bin' -export PATH -PS4='+ ' -RANLIB='ranlib' -export RANLIB -READELF='readelf' -export READELF -SHELL='/nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32/bin/bash' -export SHELL -SIZE='size' -export SIZE -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -STRINGS='strings' -export STRINGS -STRIP='strip' -export STRIP -XDG_DATA_DIRS='/nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env/share:/nix/store/dvfb5mrpfhg5211v6pl0a3fmz9idg6w7-patchelf-0.15.0/share' -export XDG_DATA_DIRS -__structuredAttrs='' -export __structuredAttrs -_substituteStream_has_warned_replace_deprecation='false' -buildInputs='' -export buildInputs -buildPhase='{ echo "------------------------------------------------------------"; - echo " WARNING: the existence of this path is not guaranteed."; - echo " It is an internal implementation detail for pkgs.mkShell."; - echo "------------------------------------------------------------"; - echo; - # Record all build inputs as runtime dependencies - export; -} >> "$out" -' -export buildPhase -builder='/nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32/bin/bash' -export builder -cmakeFlags='' -export cmakeFlags -configureFlags='' -export configureFlags -defaultBuildInputs='' -defaultNativeBuildInputs='/nix/store/dvfb5mrpfhg5211v6pl0a3fmz9idg6w7-patchelf-0.15.0 /nix/store/n9iajmgf6z1rvwrdxy3fp8q9xa16j7x7-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/12lvf0c7xric9cny7slvf9cmhypl1p67-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/vh9fsdhgxcnab2qk7vdp2palkkn6j3cp-gcc-wrapper-13.3.0' -depsBuildBuild='' -export depsBuildBuild -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -depsBuildTarget='' -export depsBuildTarget -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -depsHostHost='' -export depsHostHost -depsHostHostPropagated='' -export depsHostHostPropagated -depsTargetTarget='' -export depsTargetTarget -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -doCheck='' -export doCheck -doInstallCheck='' -export doInstallCheck -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -declare -a envBuildBuildHooks=() -declare -a envBuildHostHooks=() -declare -a envBuildTargetHooks=() -declare -a envHostHostHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -declare -a envHostTargetHooks=('ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -declare -a envTargetTargetHooks=() -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' ) -initialPath='/nix/store/ph44jcx3ddmlwh394mh1wb7f1qigxqb1-coreutils-9.5 /nix/store/yb8icljkwhk5lla4nci3myndq2m4ywly-findutils-4.10.0 /nix/store/phqahkhjsk8sl2jjiid1d47l2s4wy33h-diffutils-3.10 /nix/store/yd9vbyhbxx62j0cyhd6v0iacz11nxpvc-gnused-4.9 /nix/store/lvnwdmnjm7nvaq0a3vhvvn46iy4ql7gr-gnugrep-3.11 /nix/store/0np7q7np75csai2cwzx57n332vn9ig4i-gawk-5.2.2 /nix/store/zvn9bvrl2g516d2hfnanljiw24qa6w8l-gnutar-1.35 /nix/store/db379c3zrmncmbv5khqxpk6ggbhxjw61-gzip-1.13 /nix/store/girfp68w14pxfii52ak8gcs212y4q2s2-bzip2-1.0.8-bin /nix/store/21y3gqgm2a3w94m0wcrz1xxshks80z7p-gnumake-4.4.1 /nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32 /nix/store/91ixz3zw9ipc5j93gybir9fp5mzisq8w-patch-2.7.6 /nix/store/6v73xwg2c7p5ap29ckyg18ng87pzlnxs-xz-5.6.2-bin /nix/store/a6nsbir3y5ni3wwkw933aqvcmyyywnnz-file-5.45' -mesonFlags='' -export mesonFlags -name='nix-shell-env' -export name -nativeBuildInputs='/nix/store/nk5ncijygravaa05zv2l38smyx7j5l5v-geckodriver-0.35.0 /nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env' -export nativeBuildInputs -out='/home/jawz/Development/Scripts/tweepy/outputs/out' -export out -outputBin='out' -outputDev='out' -outputDevdoc='REMOVE' -outputDevman='out' -outputDoc='out' -outputInclude='out' -outputInfo='out' -outputLib='out' -outputMan='out' -outputs='out' -export outputs -patches='' -export patches -phases='buildPhase' -export phases -pkg='/nix/store/vh9fsdhgxcnab2qk7vdp2palkkn6j3cp-gcc-wrapper-13.3.0' -declare -a pkgsBuildBuild=() -declare -a pkgsBuildHost=('/nix/store/nk5ncijygravaa05zv2l38smyx7j5l5v-geckodriver-0.35.0' '/nix/store/cf0wrnd193zz8lvgx18zlx14rsg02gwc-python3-3.12.6-env' '/nix/store/dvfb5mrpfhg5211v6pl0a3fmz9idg6w7-patchelf-0.15.0' '/nix/store/n9iajmgf6z1rvwrdxy3fp8q9xa16j7x7-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/12lvf0c7xric9cny7slvf9cmhypl1p67-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/vh9fsdhgxcnab2qk7vdp2palkkn6j3cp-gcc-wrapper-13.3.0' '/nix/store/l7n97992gd5piaw8phkxzsz176gfk1yj-binutils-wrapper-2.43.1' ) -declare -a pkgsBuildTarget=() -declare -a pkgsHostHost=() -declare -a pkgsHostTarget=() -declare -a pkgsTargetTarget=() -declare -a postFixupHooks=('_makeSymlinksRelativeInAllOutputs' '_multioutPropagateDev' ) -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -declare -a preConfigureHooks=('_multioutConfig' ) -preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -preferLocalBuild='1' -export preferLocalBuild -prefix='/home/jawz/Development/Scripts/tweepy/outputs/out' -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -propagatedBuildInputs='' -export propagatedBuildInputs -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -shell='/nix/store/717iy55ncqs0wmhdkwc5fg2vci5wbmq8-bash-5.2p32/bin/bash' -export shell -shellHook='' -export shellHook -stdenv='/nix/store/ncv68hjnidcd2bm5abkhklrijhn0cgn6-stdenv-linux' -export stdenv -strictDeps='' -export strictDeps -system='x86_64-linux' -export system -declare -a unpackCmdHooks=('_defaultUnpack' ) -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -_allFlags () -{ - - export system pname name version; - while IFS='' read -r varName; do - nixTalkativeLog "@${varName}@ -> ${!varName}"; - args+=("--subst-var" "$varName"); - done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - nixTalkativeLog "calling implicit '$hookName' function hook"; - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - nixTalkativeLog "sourcing implicit '$hookName' script hook"; - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - nixTalkativeLog "evaling implicit '$hookName' string hook"; - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -pr --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -_logHook () -{ - - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - local hookKind="$1"; - local hookExpr="$2"; - shift 2; - if declare -F "$hookExpr" > /dev/null 2>&1; then - nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; - else - if type -p "$hookExpr" > /dev/null; then - nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; - else - if [[ "$hookExpr" != "_callImplicitHook"* ]]; then - local exprToOutput; - if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then - exprToOutput="$hookExpr"; - else - local hookExprLine; - while IFS= read -r hookExprLine; do - hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; - if [[ -n "$hookExprLine" ]]; then - exprToOutput+="$hookExprLine\\n "; - fi; - done <<< "$hookExpr"; - exprToOutput="${exprToOutput%%\\n }"; - fi; - nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; - fi; - fi; - fi -} -_makeSymlinksRelative () -{ - - local symlinkTarget; - if [ "${dontRewriteSymlinks-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - while IFS= read -r -d '' f; do - symlinkTarget=$(readlink "$f"); - if [[ "$symlinkTarget"/ != "$prefix"/* ]]; then - continue; - fi; - if [ ! -e "$symlinkTarget" ]; then - echo "the symlink $f is broken, it points to $symlinkTarget (which is missing)"; - fi; - echo "rewriting symlink $f to be relative to $prefix"; - ln -snrf "$symlinkTarget" "$f"; - done < <(find $prefix -type l -print0) -} -_makeSymlinksRelativeInAllOutputs () -{ - - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" _makeSymlinksRelative; - done -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - 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; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - 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" \; -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - nixTalkativeLog "sourcing setup hook '$pkg'"; - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; - source "$pkg/nix-support/setup-hook"; - fi -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local i; - find "$dir" -type f -print0 | while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if isELF "$i"; then - if { - printf :; - patchelf --print-rpath "$i" - } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/"; - exit 1; - fi; - fi; - if isScript "$i"; then - if [ -e "$(dirname "$i")/.$(basename "$i")-wrapped" ]; then - if grep -q -F "$TMPDIR/" "$i"; then - echo "wrapper script $i contains a forbidden reference to $TMPDIR/"; - exit 1; - fi; - fi; - fi; - done -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - fi -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget="check"; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget="test"; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | while IFS= read -r -d '' f; do - if gzip -c -n "$f" > "$f".gz; then - rm "$f"; - else - rm "$f".gz; - fi; - done; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -concatStringsSep () -{ - - local sep="$1"; - local name="$2"; - local type oldifs; - if type=$(declare -p "$name" 2> /dev/null); then - local -n nameref="$name"; - case "${type#* }" in - -A*) - echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; - return 1 - ;; - -a*) - local IFS="$sep"; - echo -n "${nameref[*]}" - ;; - *) - echo -n "${nameref// /"${sep}"}" - ;; - esac; - fi -} -concatTo () -{ - - local -; - set -o noglob; - local -n targetref="$1"; - shift; - local arg default name type; - for arg in "$@"; - do - IFS="=" read -r name default <<< "$arg"; - local -n nameref="$name"; - if [[ ! -n "${nameref[@]}" && -n "$default" ]]; then - targetref+=("$default"); - else - if type=$(declare -p "$name" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; - return 1 - ;; - -a*) - targetref+=("${nameref[@]}") - ;; - *) - if [[ "$name" = *"Array" ]]; then - nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; - targetref+=(${nameref+"${nameref[@]}"}); - else - targetref+=(${nameref-}); - fi - ;; - esac; - fi; - fi; - done -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - 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" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - prependToVar configureFlags "${prefixKey:---prefix=}$prefix"; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - concatTo flagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - concatTo flagsArray distFlags distFlagsArray distTarget=dist; - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -dumpVars () -{ - - if [ "${noDumpEnvVars:-0}" != 1 ]; then - { - install -m 0600 /dev/null "$NIX_BUILD_TOP/env-vars" && export 2> /dev/null >| "$NIX_BUILD_TOP/env-vars" - } || true; - fi -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case "${!varSlice-}" in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -getHostRole () -{ - - getRole "$hostOffset" -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.43.1: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -getTargetRole () -{ - - getRole "$targetOffset" -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.43.1: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -nixChattyLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 5 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -nixDebugLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 6 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -nixErrorLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 0 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -nixInfoLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 3 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -nixNoticeLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 2 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -nixTalkativeLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 4 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -nixVomitLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 7 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -nixWarnLog () -{ - - if [[ -z ${NIX_LOG_FD-} ]] || [[ ${NIX_DEBUG:-0} -lt 1 ]]; then - return; - fi; - printf "%s\n" "$*" >&"$NIX_LOG_FD" -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - concatTo patchesArray patches; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - local -a flagsArray; - concatTo flagsArray patchFlags=-p1; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -patchShebangs () -{ - - local pathName; - local update; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - args=${args#* }; - newPath="$(PATH="${!pathName}" type -P "env" || true)"; - args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - sed -i -e "1 s|.*|#\!$escapedInterpreterLine|" "$f"; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - _eval "$hook" "$@"; - done; - return 0 -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime endTime; - startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; - cd -- "${sourceRoot:-.}"; - fi -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase"; - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - 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=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - local savedvar; - savedvar="${!var}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - if [ "$pattern" != "$replacement" ]; then - if [ "${!var}" == "$savedvar" ]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - fi - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - concatTo srcsArray srcs; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/ga0gqnv6qyzvg08jqw0pc2fkyzlv1qrv-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -updateSourceDateEpoch () -{ - - local path="$1"; - [[ $path == -* ]] && path="./$path"; - 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)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" -export NIX_BUILD_TOP="$(mktemp -d -t nix-shell.XXXXXX)" -export TMP="$NIX_BUILD_TOP" -export TMPDIR="$NIX_BUILD_TOP" -export TEMP="$NIX_BUILD_TOP" -export TEMPDIR="$NIX_BUILD_TOP" -eval "${shellHook:-}" diff --git a/blusky/.envrc b/source/blusky/.envrc similarity index 100% rename from blusky/.envrc rename to source/blusky/.envrc diff --git a/blusky/feed-jawz.py b/source/blusky/feed-jawz.py similarity index 100% rename from blusky/feed-jawz.py rename to source/blusky/feed-jawz.py diff --git a/blusky/shell.nix b/source/blusky/shell.nix similarity index 100% rename from blusky/shell.nix rename to source/blusky/shell.nix diff --git a/clean-cloud.sh b/source/clean-cloud.sh similarity index 100% rename from clean-cloud.sh rename to source/clean-cloud.sh diff --git a/clean-watch.sh b/source/clean-watch.sh similarity index 100% rename from clean-watch.sh rename to source/clean-watch.sh diff --git a/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter.exe b/source/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter.exe similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter.exe rename to source/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter.exe diff --git a/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter_(x64).exe b/source/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter_(x64).exe similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter_(x64).exe rename to source/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/Bat_To_Exe_Converter_(x64).exe diff --git a/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/settings b/source/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/settings similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/Bat to Exe/settings rename to source/deprecated-rewrite/Windows/Windows/Other/Bat to Exe/settings diff --git a/deprecated-rewrite/Windows/Windows/Other/RazerChromaSampleApplication.exe b/source/deprecated-rewrite/Windows/Windows/Other/RazerChromaSampleApplication.exe similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/RazerChromaSampleApplication.exe rename to source/deprecated-rewrite/Windows/Windows/Other/RazerChromaSampleApplication.exe diff --git a/deprecated-rewrite/Windows/Windows/Other/SyncSettings.ffs_gui b/source/deprecated-rewrite/Windows/Windows/Other/SyncSettings.ffs_gui similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/SyncSettings.ffs_gui rename to source/deprecated-rewrite/Windows/Windows/Other/SyncSettings.ffs_gui diff --git a/deprecated-rewrite/Windows/Windows/Other/Thumbnail me.ini b/source/deprecated-rewrite/Windows/Windows/Other/Thumbnail me.ini similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/Thumbnail me.ini rename to source/deprecated-rewrite/Windows/Windows/Other/Thumbnail me.ini diff --git a/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.cfg b/source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.cfg similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.cfg rename to source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.cfg diff --git a/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.chm b/source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.chm similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.chm rename to source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.chm diff --git a/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.exe b/source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.exe similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.exe rename to source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/BulkFileChanger.exe diff --git a/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/readme.txt b/source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/readme.txt similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/readme.txt rename to source/deprecated-rewrite/Windows/Windows/Other/bulkfilechanger-x64/readme.txt diff --git a/deprecated-rewrite/Windows/Windows/Other/cmder.xml b/source/deprecated-rewrite/Windows/Windows/Other/cmder.xml similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/cmder.xml rename to source/deprecated-rewrite/Windows/Windows/Other/cmder.xml diff --git a/deprecated-rewrite/Windows/Windows/Other/config.xlaunch b/source/deprecated-rewrite/Windows/Windows/Other/config.xlaunch similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/config.xlaunch rename to source/deprecated-rewrite/Windows/Windows/Other/config.xlaunch diff --git a/deprecated-rewrite/Windows/Windows/Other/md5c_x64.exe b/source/deprecated-rewrite/Windows/Windows/Other/md5c_x64.exe similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/md5c_x64.exe rename to source/deprecated-rewrite/Windows/Windows/Other/md5c_x64.exe diff --git a/deprecated-rewrite/Windows/Windows/Other/new settings.touchmouseptr_setting b/source/deprecated-rewrite/Windows/Windows/Other/new settings.touchmouseptr_setting similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/new settings.touchmouseptr_setting rename to source/deprecated-rewrite/Windows/Windows/Other/new settings.touchmouseptr_setting diff --git a/deprecated-rewrite/Windows/Windows/Other/tabletpro.touchmouseptr_setting b/source/deprecated-rewrite/Windows/Windows/Other/tabletpro.touchmouseptr_setting similarity index 100% rename from deprecated-rewrite/Windows/Windows/Other/tabletpro.touchmouseptr_setting rename to source/deprecated-rewrite/Windows/Windows/Other/tabletpro.touchmouseptr_setting diff --git a/deprecated-rewrite/Windows/Windows/TabProBG - Pink.png b/source/deprecated-rewrite/Windows/Windows/TabProBG - Pink.png similarity index 100% rename from deprecated-rewrite/Windows/Windows/TabProBG - Pink.png rename to source/deprecated-rewrite/Windows/Windows/TabProBG - Pink.png diff --git a/deprecated-rewrite/Windows/Windows/TabProBG.png b/source/deprecated-rewrite/Windows/Windows/TabProBG.png similarity index 100% rename from deprecated-rewrite/Windows/Windows/TabProBG.png rename to source/deprecated-rewrite/Windows/Windows/TabProBG.png diff --git a/deprecated-rewrite/Windows/Windows/TabProBlur.png b/source/deprecated-rewrite/Windows/Windows/TabProBlur.png similarity index 100% rename from deprecated-rewrite/Windows/Windows/TabProBlur.png rename to source/deprecated-rewrite/Windows/Windows/TabProBlur.png diff --git a/deprecated-rewrite/Windows/Windows/Touch settings.ini b/source/deprecated-rewrite/Windows/Windows/Touch settings.ini similarity index 100% rename from deprecated-rewrite/Windows/Windows/Touch settings.ini rename to source/deprecated-rewrite/Windows/Windows/Touch settings.ini diff --git a/deprecated-rewrite/Windows/Windows/Touch settings.ini.tabletpro b/source/deprecated-rewrite/Windows/Windows/Touch settings.ini.tabletpro similarity index 100% rename from deprecated-rewrite/Windows/Windows/Touch settings.ini.tabletpro rename to source/deprecated-rewrite/Windows/Windows/Touch settings.ini.tabletpro diff --git a/deprecated-rewrite/Windows/Windows/onenote purple.ini b/source/deprecated-rewrite/Windows/Windows/onenote purple.ini similarity index 100% rename from deprecated-rewrite/Windows/Windows/onenote purple.ini rename to source/deprecated-rewrite/Windows/Windows/onenote purple.ini diff --git a/deprecated-rewrite/Windows/Windows/onenote purple.ini.tabletpro b/source/deprecated-rewrite/Windows/Windows/onenote purple.ini.tabletpro similarity index 100% rename from deprecated-rewrite/Windows/Windows/onenote purple.ini.tabletpro rename to source/deprecated-rewrite/Windows/Windows/onenote purple.ini.tabletpro diff --git a/deprecated-rewrite/Windows/color.ps1 b/source/deprecated-rewrite/Windows/color.ps1 similarity index 100% rename from deprecated-rewrite/Windows/color.ps1 rename to source/deprecated-rewrite/Windows/color.ps1 diff --git a/deprecated-rewrite/Windows/create.ps1 b/source/deprecated-rewrite/Windows/create.ps1 similarity index 100% rename from deprecated-rewrite/Windows/create.ps1 rename to source/deprecated-rewrite/Windows/create.ps1 diff --git a/deprecated-rewrite/Windows/library scripts/download.ps1 b/source/deprecated-rewrite/Windows/library scripts/download.ps1 similarity index 100% rename from deprecated-rewrite/Windows/library scripts/download.ps1 rename to source/deprecated-rewrite/Windows/library scripts/download.ps1 diff --git a/deprecated-rewrite/Windows/library scripts/fix.ps1 b/source/deprecated-rewrite/Windows/library scripts/fix.ps1 similarity index 100% rename from deprecated-rewrite/Windows/library scripts/fix.ps1 rename to source/deprecated-rewrite/Windows/library scripts/fix.ps1 diff --git a/deprecated-rewrite/Windows/library scripts/fix2.ps1 b/source/deprecated-rewrite/Windows/library scripts/fix2.ps1 similarity index 100% rename from deprecated-rewrite/Windows/library scripts/fix2.ps1 rename to source/deprecated-rewrite/Windows/library scripts/fix2.ps1 diff --git a/deprecated-rewrite/Windows/library scripts/manga.ps1 b/source/deprecated-rewrite/Windows/library scripts/manga.ps1 similarity index 100% rename from deprecated-rewrite/Windows/library scripts/manga.ps1 rename to source/deprecated-rewrite/Windows/library scripts/manga.ps1 diff --git a/deprecated-rewrite/Windows/remove-emtpy.ps1 b/source/deprecated-rewrite/Windows/remove-emtpy.ps1 similarity index 100% rename from deprecated-rewrite/Windows/remove-emtpy.ps1 rename to source/deprecated-rewrite/Windows/remove-emtpy.ps1 diff --git a/deprecated-rewrite/backups b/source/deprecated-rewrite/backups similarity index 100% rename from deprecated-rewrite/backups rename to source/deprecated-rewrite/backups diff --git a/deprecated-rewrite/discord_chatlogs b/source/deprecated-rewrite/discord_chatlogs similarity index 100% rename from deprecated-rewrite/discord_chatlogs rename to source/deprecated-rewrite/discord_chatlogs diff --git a/deprecated-rewrite/doasedit b/source/deprecated-rewrite/doasedit similarity index 100% rename from deprecated-rewrite/doasedit rename to source/deprecated-rewrite/doasedit diff --git a/deprecated-rewrite/exporg_cal.fish b/source/deprecated-rewrite/exporg_cal.fish similarity index 100% rename from deprecated-rewrite/exporg_cal.fish rename to source/deprecated-rewrite/exporg_cal.fish diff --git a/deprecated-rewrite/kemono.py b/source/deprecated-rewrite/kemono.py similarity index 100% rename from deprecated-rewrite/kemono.py rename to source/deprecated-rewrite/kemono.py diff --git a/deprecated-rewrite/manage_music.fish b/source/deprecated-rewrite/manage_music.fish similarity index 100% rename from deprecated-rewrite/manage_music.fish rename to source/deprecated-rewrite/manage_music.fish diff --git a/deprecated-rewrite/moviezip b/source/deprecated-rewrite/moviezip similarity index 100% rename from deprecated-rewrite/moviezip rename to source/deprecated-rewrite/moviezip diff --git a/deprecated-rewrite/pywal.fish b/source/deprecated-rewrite/pywal.fish similarity index 100% rename from deprecated-rewrite/pywal.fish rename to source/deprecated-rewrite/pywal.fish diff --git a/deprecated-rewrite/rnm.fish b/source/deprecated-rewrite/rnm.fish similarity index 100% rename from deprecated-rewrite/rnm.fish rename to source/deprecated-rewrite/rnm.fish diff --git a/deprecated-rewrite/syncphone b/source/deprecated-rewrite/syncphone similarity index 100% rename from deprecated-rewrite/syncphone rename to source/deprecated-rewrite/syncphone diff --git a/download_hs/.envrc b/source/download_hs/.envrc similarity index 100% rename from download_hs/.envrc rename to source/download_hs/.envrc diff --git a/download_hs/CHANGELOG.md b/source/download_hs/CHANGELOG.md similarity index 100% rename from download_hs/CHANGELOG.md rename to source/download_hs/CHANGELOG.md diff --git a/download_hs/LICENSE b/source/download_hs/LICENSE similarity index 100% rename from download_hs/LICENSE rename to source/download_hs/LICENSE diff --git a/download_hs/app/Main.hs b/source/download_hs/app/Main.hs similarity index 100% rename from download_hs/app/Main.hs rename to source/download_hs/app/Main.hs diff --git a/download_hs/app/test.txt b/source/download_hs/app/test.txt similarity index 100% rename from download_hs/app/test.txt rename to source/download_hs/app/test.txt diff --git a/download_hs/default.nix b/source/download_hs/default.nix similarity index 100% rename from download_hs/default.nix rename to source/download_hs/default.nix diff --git a/download_hs/dist-newstyle/cache/compiler b/source/download_hs/dist-newstyle/cache/compiler similarity index 100% rename from download_hs/dist-newstyle/cache/compiler rename to source/download_hs/dist-newstyle/cache/compiler diff --git a/download_hs/dist-newstyle/cache/config b/source/download_hs/dist-newstyle/cache/config similarity index 100% rename from download_hs/dist-newstyle/cache/config rename to source/download_hs/dist-newstyle/cache/config diff --git a/download_hs/dist-newstyle/cache/elaborated-plan b/source/download_hs/dist-newstyle/cache/elaborated-plan similarity index 100% rename from download_hs/dist-newstyle/cache/elaborated-plan rename to source/download_hs/dist-newstyle/cache/elaborated-plan diff --git a/download_hs/dist-newstyle/cache/improved-plan b/source/download_hs/dist-newstyle/cache/improved-plan similarity index 100% rename from download_hs/dist-newstyle/cache/improved-plan rename to source/download_hs/dist-newstyle/cache/improved-plan diff --git a/download_hs/dist-newstyle/cache/plan.json b/source/download_hs/dist-newstyle/cache/plan.json similarity index 100% rename from download_hs/dist-newstyle/cache/plan.json rename to source/download_hs/dist-newstyle/cache/plan.json diff --git a/download_hs/dist-newstyle/cache/solver-plan b/source/download_hs/dist-newstyle/cache/solver-plan similarity index 100% rename from download_hs/dist-newstyle/cache/solver-plan rename to source/download_hs/dist-newstyle/cache/solver-plan diff --git a/download_hs/dist-newstyle/cache/source-hashes b/source/download_hs/dist-newstyle/cache/source-hashes similarity index 100% rename from download_hs/dist-newstyle/cache/source-hashes rename to source/download_hs/dist-newstyle/cache/source-hashes diff --git a/download_hs/dist-newstyle/cache/up-to-date b/source/download_hs/dist-newstyle/cache/up-to-date similarity index 100% rename from download_hs/dist-newstyle/cache/up-to-date rename to source/download_hs/dist-newstyle/cache/up-to-date diff --git a/download_hs/download-hs.cabal b/source/download_hs/download-hs.cabal similarity index 100% rename from download_hs/download-hs.cabal rename to source/download_hs/download-hs.cabal diff --git a/find_tweet_user/.envrc b/source/find_tweet_user/.envrc similarity index 100% rename from find_tweet_user/.envrc rename to source/find_tweet_user/.envrc diff --git a/find_tweet_user/find_tweet_user.py b/source/find_tweet_user/find_tweet_user.py similarity index 100% rename from find_tweet_user/find_tweet_user.py rename to source/find_tweet_user/find_tweet_user.py diff --git a/find_tweet_user/shell.nix b/source/find_tweet_user/shell.nix similarity index 100% rename from find_tweet_user/shell.nix rename to source/find_tweet_user/shell.nix diff --git a/gdl/gdl_log_report b/source/gdl/gdl_log_report similarity index 100% rename from gdl/gdl_log_report rename to source/gdl/gdl_log_report diff --git a/gdl/gdl_log_report.sh b/source/gdl/gdl_log_report.sh similarity index 100% rename from gdl/gdl_log_report.sh rename to source/gdl/gdl_log_report.sh diff --git a/gdl/gdl_mv b/source/gdl/gdl_mv similarity index 100% rename from gdl/gdl_mv rename to source/gdl/gdl_mv diff --git a/gdl/gdl_mv.sh b/source/gdl/gdl_mv.sh similarity index 100% rename from gdl/gdl_mv.sh rename to source/gdl/gdl_mv.sh diff --git a/gdl/track_files.fish b/source/gdl/track_files.fish similarity index 100% rename from gdl/track_files.fish rename to source/gdl/track_files.fish diff --git a/photos-metadata.sh b/source/photos-metadata.sh similarity index 100% rename from photos-metadata.sh rename to source/photos-metadata.sh diff --git a/plex.py b/source/plex.py similarity index 100% rename from plex.py rename to source/plex.py diff --git a/split-gallery-videos.sh b/source/split-gallery-videos.sh similarity index 100% rename from split-gallery-videos.sh rename to source/split-gallery-videos.sh diff --git a/xhamster.py b/source/xhamster.py similarity index 100% rename from xhamster.py rename to source/xhamster.py