summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-09-11 21:05:02 -0400
committerJune McEnroe <june@causal.agency>2020-09-11 21:05:02 -0400
commit7d5759526f9ebdc66fbc01c3bf7b96543660f71c (patch)
treed30f12e38b9318e21243020ff2bd76eda987243e
parentRemove NetBSD from install script (diff)
downloadsrc-7d5759526f9ebdc66fbc01c3bf7b96543660f71c.tar.gz
src-7d5759526f9ebdc66fbc01c3bf7b96543660f71c.zip
Rewrite install script yet again
Diffstat (limited to '')
-rw-r--r--install.sh46
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)