diff options
-rw-r--r-- | install.sh | 46 |
1 files 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) |