From 7d5759526f9ebdc66fbc01c3bf7b96543660f71c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 11 Sep 2020 21:05:02 -0400 Subject: Rewrite install script yet again --- install.sh | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/install.sh b/install.sh index 33b1450e..871773ba 100644 --- a/install.sh +++ b/install.sh @@ -1,37 +1,37 @@ #!/bin/sh set -eu -pkgAny='curl htop sl the_silver_searcher tree' -pkgDarwin="${pkgAny} git neovim pkg-config" -pkgFreeBSD="${pkgAny} ddate neovim" -pkgLinux="${pkgAny} bc ctags gdb neovim openssh" -pkgOpenBSD="${pkgAny} neovim" +packages='curl htop neovim sl the_silver_searcher tree' -Darwin() { - if [ ! -d /opt/local ]; then - dir=MacPorts-2.6.3 - tar=${dir}.tar.bz2 - curl -O "https://distfiles.macports.org/MacPorts/${tar}" - tar -x -f $tar - (cd $dir && ./configure) - make -C $dir - sudo make -C $dir install - rm -fr $tar $dir - fi - sudo /opt/local/bin/port selfupdate - sudo /opt/local/bin/port -N install $pkgDarwin +FreeBSD() { + sudo pkg install ddate $packages } -FreeBSD() { - pkg install $pkgFreeBSD +OpenBSD() { + doas pkg_add $packages } Linux() { - pacman -Sy --needed $pkgLinux + sudo pacman -Sy --needed bc ctags gdb openbssh $packages } -OpenBSD() { - pkg_add $pkgOpenBSD +installMacPorts() { + xcode-select --install + xcodebuild -license + dir=MacPorts-2.6.3 + tar=${dir}.tar.bz2 + curl -O "https://distfiles.macports.org/MacPorts/${tar}" + tar -x -f $tar + (cd $dir && ./configure) + make -C $dir + sudo make -C $dir install + rm -fr $tar $dir +} + +Darwin() { + [ -d /opt/local ] || installMacPorts + sudo /opt/local/bin/port selfupdate + sudo /opt/local/bin/port -N install git pkgconfig $packages } $(uname) -- cgit 1.4.1