Skip to content

Instantly share code, notes, and snippets.

@anoduck
Created September 4, 2023 06:58
Show Gist options
  • Save anoduck/090363ca659777b26169696a107a873a to your computer and use it in GitHub Desktop.
Save anoduck/090363ca659777b26169696a107a873a to your computer and use it in GitHub Desktop.
Sh script to build goneovim and desktop environment for testing goneovim.
#!/usr/bin/env sh
SNDBX="$HOME/Sandbox"
WORKDIR="$HOME/Sandbox/goneovim"
export GO111MODULE=off
export QT_PKG_CONFIG=true
export GOPATH="$(go env GOPATH)"
export GOBIN="$GOPATH/bin"
export PATH="$PATH:$GOBIN"
QSET="$(go env GOPATH)/bin/qtsetup"
begin_install () {
if [ -d "$WORKDIR" ]; then
cd "$WORKDIR" || exit
else
if [ -d "$SNDBX" ]; then
cd "$SNDBX" || exit
else
mkdir -p "$SNDBX"
cd "$SNDBX" || exit
fi
git clone https://github.com/akiyosi/goneovim
cd "$WORKDIR" || exit
fi
git checkout freebsd-again
echo "Installing packages"
yes | pkg install git\
go\
pkgconf\
qt5\
qmake\
bash\
bash-completion\
neovim\
xorg\
icewm\
mlterm\
jed\
# virtualbox-ose-additions \
wget
}
fetch_deps () {
echo "Fetching qt libraries"
go get github.com/therecipe/qt
go get github.com/therecipe/qt/core
go get github.com/therecipe/qt/widgets
go mod vendor # <-- You can take these out if needed.
}
install_deps () {
echo "Installing dependencies"
go get github.com/akiyosi/qt/internal/cmd@v0.0.0-20230718095223-7e4e923f23fa
go get github.com/akiyosi/qt/internal/binding/files/docs/5.12.0
go get github.com/akiyosi/qt/internal/binding/files/docs/5.13.0
go get github.com/akiyosi/qt/internal/cmd/moc@v0.0.0-20230718095223-7e4e923f23fa
go get -v -tags=no_env github.com/akiyosi/qt/cmd/...
go mod vendor #<-- You can take these out if needed.
}
set_env () {
echo "Setting up environement"
git clone https://github.com/akiyosi/env_linux_amd64_513.git vendor/github.com/akiyosi/env_linux_amd64_513
go mod vendor #<-- You can take these out if needed.
go get -v github.com/therecipe/qt/cmd/...
}
setup_qt () {
if [ -e "$QSET" ]; then
"$QSET" -test=false
else
echo "Qtsetup failed to install."
exit
fi
if [ -e "$(which qtmoc)" ]; then
qtmoc desktop ./cmd/goneovim
else
echo "Qtmoc not found."
exit
fi
}
finalize_install () {
go generate
echo "Building application"
qtdeploy build freebsd ./cmd/goneovim
}
begin_install
fetch_deps
install_deps
set_env
setup_qt
finalize_install
echo "DONE!"
@anoduck
Copy link
Author

anoduck commented Sep 4, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment