Package Details: oh-my-posh 24.15.1-1

Git Clone URL: https://aur.archlinux.org/oh-my-posh.git (read-only, click to copy)
Package Base: oh-my-posh
Description: A prompt theme engine for any shell.
Upstream URL: https://github.com/JanDeDobbeleer/oh-my-posh
Keywords: oh-my-posh
Licenses: MIT
Submitter: wszqkzqk
Maintainer: wszqkzqk
Last Packager: wszqkzqk
Votes: 7
Popularity: 0.055111
First Submitted: 2022-10-20 13:30 (UTC)
Last Updated: 2024-12-20 01:16 (UTC)

Dependencies (3)

Required by (1)

Sources (1)

Latest Comments

« First ‹ Previous 1 2

ZhangHua commented on 2023-07-10 06:18 (UTC) (edited on 2023-07-10 06:19 (UTC) by ZhangHua)

Please consider adding -X github.com/jandedobbeleer/oh-my-posh/src/build.Version=v$pkgver -X github.com/jandedobbeleer/oh-my-posh/src/build.Date=$(date +%F) to -ldflags so we can print detailed info in oh-my-posh version --verbose command. However, this means that you need to move -ldflags=-linkmode=external in GOFLAGS variable to go build command as its params, because GOFLAGS does not support value with space.

You can use this patch to achieve this:

diff --git a/PKGBUILD b/PKGBUILD
index 570455b..18423fe 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
 # Maintainer: wszqkzqk <wszqkzqk@qq.com>
 pkgname=oh-my-posh
 pkgver=17.7.0
-pkgrel=1
+pkgrel=2
 pkgdesc="A prompt theme engine for any shell."
 arch=('x86_64' 'armv7h' 'aarch64')
 url="https://github.com/JanDeDobbeleer/oh-my-posh"
@@ -16,10 +16,10 @@ build() {
     export CGO_CFLAGS="${CFLAGS}"
     export CGO_CXXFLAGS="${CXXFLAGS}"
     export CGO_LDFLAGS="${LDFLAGS}"
-    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+    export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"

     cd "$pkgname-$pkgver/src"
-    go build
+    go build -ldflags="-linkmode=external -X github.com/jandedobbeleer/oh-my-posh/src/build.Version=v$pkgver -X github.com/jandedobbeleer/oh-my-posh/src/build.Date=$(date +%F)"
 }

 package() {

TrialnError commented on 2023-01-06 18:41 (UTC)

Temporary fix for the name of the created binary:

@@ -22,7 +22,7 @@ build() {
 }
 package() {
     cd "$pkgname-$pkgver/src"
-    install -Dm 755 ./oh-my-posh -t "${pkgdir}/usr/bin/"
+    install -Dm 755 ./src -D "${pkgdir}/usr/bin/oh-my-posh"
     install -Dm 644 "../COPYING" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
     install -d "${pkgdir}/usr/share/oh-my-posh/themes"
     install -m 644 ../themes/* -t "${pkgdir}/usr/share/oh-my-posh/themes"

a821 commented on 2023-01-06 12:58 (UTC) (edited on 2023-01-07 12:56 (UTC) by a821)

Edit: fixed, thanks :-)

fails to build due to an error in line #25, because the binary is called src instead of oh-my-posh. Maybe an issue to raise upstream.