Skip to content

Help setting version in Arch Linux package #1207

@carlsmedstad

Description

@carlsmedstad

I'm struggling to have the binary output the correct version for the AUR package.

See the the build function in the PKGBUILD:

build() {
  cd "$_archive"

  export CGO_CPPFLAGS="${CPPFLAGS}"
  export CGO_CFLAGS="${CFLAGS}"
  export CGO_CXXFLAGS="${CXXFLAGS}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"

  go build -v -o bin ./cmd/task
}

I've tried setting multiple ld flags but I've been unable to get any other output than:

$ go-task --version
Task version: (devel)

For example -X github.com/go-task/task/version=$pkgver which I found here: #1050.

Assistance very much appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: releasingChanges related to the release process.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions