Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(oh-my-posh): add package #19747

Merged
merged 2 commits into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions packages/oh-my-posh/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
TERMUX_PKG_HOMEPAGE=https://ohmyposh.dev
TERMUX_PKG_DESCRIPTION="A prompt theme engine for any shell."
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Steven Xu @stevenxxiu"
TERMUX_PKG_VERSION=19.20.0
TERMUX_PKG_SRCURL=https://github.com/JanDeDobbeleer/oh-my-posh/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=a9028c0dbe58680cbd81ad52d999917eec1b45f4379210375bb7b752bde94793
TERMUX_PKG_AUTO_UPDATE=true

termux_step_pre_configure() {
termux_setup_golang

go mod init oh-my-posh
go mod tidy
}

termux_step_make() {
cd "${TERMUX_PKG_SRCDIR}/src/"

local ldflags=''
ldflags+="-linkmode=external "
ldflags+="-X github.com/jandedobbeleer/oh-my-posh/src/build.Version=${TERMUX_PKG_VERSION} "
ldflags+="-X github.com/jandedobbeleer/oh-my-posh/src/build.Date=$(date +%F)"
go build -buildvcs=false -ldflags="${ldflags}" -o oh-my-posh
}

termux_step_make_install() {
cd "${TERMUX_PKG_SRCDIR}/src/"

install -Dm700 ./oh-my-posh "${TERMUX_PREFIX}/bin/"

install -d "${TERMUX_PREFIX}/share/oh-my-posh/themes"
install -m 600 ../themes/* -t "${TERMUX_PREFIX}/share/oh-my-posh/themes"
}