Fix AUR source directory in GoReleaser config#3
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the GoReleaser AUR source-package hooks so the PKGBUILD build steps run from ${srcdir}, fixing cases where the release source tarball extracts directly into the makepkg source directory (rather than a nested ${pkgname}_${pkgver} folder).
Changes:
- Switch
prepare,build, andpackagehooks fromcd "${pkgname}_${pkgver}"tocd "${srcdir}". - Keep the rest of the AUR build environment/export logic unchanged.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Graphixa
left a comment
There was a problem hiding this comment.
Thanks for fixing this. I agree that cd "${pkgname}_${pkgver}" can break when the source archive extracts directly into ${srcdir}.
We can control our release artifacts, but in practice the top level layout can still change over time (GoReleaser changes, config tweaks, or alternative source archives). I would prefer the AUR hooks to be resilient to either layout.
Suggested pattern for prepare, build, and package:
cd "${srcdir}" || exit 1
if [ -d "${pkgname}_${pkgver}" ]; then
cd "${pkgname}_${pkgver}" || exit 1
fi
if [ ! -f "go.mod" ]; then
echo "go.mod not found in ${PWD}"
exit 1
fi
Once that is in, this looks good to me and I will merge.
Summary
${srcdir}Verification
makepkg -f --cleanbuild --nodepssuccessfully forfontget 2.4.0-1FontGet v2.4.0