Skip to content

Commit fd929d6

Browse files
committed
Upstream.
1 parent 2e13990 commit fd929d6

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

_lib/ubiquitous_bash

ubiquitous_bash.sh

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ _ub_cksum_special_derivativeScripts_contents() {
3636
#export ub_setScriptChecksum_disable='true'
3737
( [[ -e "$0".nck ]] || [[ "${BASH_SOURCE[0]}" != "${0}" ]] || [[ "$1" == '--profile' ]] || [[ "$1" == '--script' ]] || [[ "$1" == '--call' ]] || [[ "$1" == '--return' ]] || [[ "$1" == '--devenv' ]] || [[ "$1" == '--shell' ]] || [[ "$1" == '--bypass' ]] || [[ "$1" == '--parent' ]] || [[ "$1" == '--embed' ]] || [[ "$1" == '--compressed' ]] || [[ "$0" == "/bin/bash" ]] || [[ "$0" == "-bash" ]] || [[ "$0" == "/usr/bin/bash" ]] || [[ "$0" == "bash" ]] ) && export ub_setScriptChecksum_disable='true'
3838
export ub_setScriptChecksum_header='2591634041'
39-
export ub_setScriptChecksum_contents='4019983047'
39+
export ub_setScriptChecksum_contents='1900127426'
4040

4141
# CAUTION: Symlinks may cause problems. Disable this test for such cases if necessary.
4242
# WARNING: Performance may be crucial here.
@@ -11188,11 +11188,40 @@ _get_from_nix-user() {
1118811188
# export LANG=C
1118911189
# https://bbs.archlinux.org/viewtopic.php?id=23505
1119011190

11191-
11191+
#nix-env --uninstall geda
11192+
#nix-env --uninstall pcb
11193+
1119211194
_getMost_backend sudo -n -u "$currentUser" /bin/bash -l -c 'export NIXPKGS_ALLOW_INSECURE=1 ; nix-env -iA nixpkgs.geda'
1119311195
_getMost_backend sudo -n -u "$currentUser" /bin/bash -l -c 'xdg-desktop-menu install "$HOME"/.nix-profile/share/applications/geda-gschem.desktop'
1119411196
_getMost_backend sudo -n -u "$currentUser" /bin/bash -l -c 'xdg-desktop-menu install "$HOME"/.nix-profile/share/applications/geda-gattrib.desktop'
1119511197
_getMost_backend sudo -n -u "$currentUser" cp -a /home/"$currentUser"/.nix-profile/share/icons /home/"$currentUser"/.local/share/
11198+
11199+
_getMost_backend sudo -n -u "$currentUser" /bin/bash -l -c 'export NIXPKGS_ALLOW_INSECURE=1 ; nix-env -iA nixpkgs.pcb'
11200+
11201+
# Necessary, do NOT remove. Necessary for 'gsch2pcb' , 'gnetlist' , etc, since installation as a dependency does not make the necessary binaries available to the usual predictable PATH .
11202+
_getMost_backend sudo -n -u "$currentUser" /bin/bash -l -c 'export NIXPKGS_ALLOW_INSECURE=1 ; nix-env -iA nixpkgs.python2'
11203+
11204+
11205+
# Workaround to make macros needed from 'pcb' package available to such programs as 'gsch2pcb' from the 'geda' package .
11206+
#sed 's/.*\/\(.*\)\/bin\/pcb.*/\1/')
11207+
local currentDerivationPath_pcb
11208+
currentDerivationPath_pcb=$(_getMost_backend sudo -n -u "$currentUser" /bin/bash -l -c 'readlink -f "$(type -p pcb)"')
11209+
currentDerivationPath_pcb=$(echo "$currentDerivationPath_pcb" | sed 's/\(.*\)\/bin\/pcb.*/\1/')
11210+
11211+
local currentDerivationPath_gsch2pcb
11212+
currentDerivationPath_gsch2pcb=$(_getMost_backend sudo -n -u "$currentUser" /bin/bash -l -c 'readlink -f "$(type -p gsch2pcb)"')
11213+
currentDerivationPath_gsch2pcb=$(echo "$currentDerivationPath_gsch2pcb" | sed 's/\(.*\)\/bin\/gsch2pcb.*/\1/')
11214+
11215+
_getMost_backend cp -a "$currentDerivationPath_pcb"/share/pcb "$currentDerivationPath_gsch2pcb"/share/
11216+
_getMost_backend cp -a "$currentDerivationPath_pcb"/share/gEDA "$currentDerivationPath_gsch2pcb"/share/
11217+
11218+
# ATTENTION: Unusual .
11219+
_getMost_backend sed -i 's/import errno, os, stat, tempfile$/& , sys/' "$currentDerivationPath_gsch2pcb"/lib/python2.7/site-packages/xorn/fileutils.py
11220+
11221+
# DOCUMENTATION - interesting copilot suggestions that may or may not be relevant
11222+
# --option allow-substitutes false --option allow-unsafe-native-code-during-evaluation true --option substituters 'https://cache.nixos.org https://hydra.iohk.io' --option trusted-public-keys 'cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ='
11223+
#export NIXPKGS_ALLOW_INSECURE=1 ; nix-env --option binary-caches "" -iA nixpkgs.geda nixpkgs.pcb --option keep-outputs true --option merge-outputs-by-path true
11224+
1119611225

1119711226
[[ "$current_getMost_backend_wasSet" == "false" ]] && unset _getMost_backend
1119811227

0 commit comments

Comments
 (0)