Skip to content

Instantly share code, notes, and snippets.

@quequotion
Last active March 20, 2019 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quequotion/95e85f4442ea4749e4ba999af1bc0a5a to your computer and use it in GitHub Desktop.
Save quequotion/95e85f4442ea4749e4ba999af1bc0a5a to your computer and use it in GitHub Desktop.
Test PKGBUILD for examining how flags are passed to various functions
#Maintainer: Packaging Tester <test@pacman>
pkgname=testpkg
pkgver=1
pkgrel=1
pkgdesc="A package for testing"
arch=('any')
url="https://www.archlinux.org/pacman/"
license=('GPL')
makedepends=('pacman')
depends=('pacman')
options=('!ccache' '!distcc' "buildflags" "makeflags" "!debug")
msg2 "Read PKGBUILD header"
msg2 "cppflags ${CPPFLAGS}"
msg2 "cflags ${CFLAGS}"
msg2 "cxxflags ${CXXFLAGS}"
msg2 "ldflags ${LDFLAGS}"
msg2 "makeflags ${MAKEFLAGS}"
#unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS
prepare() {
msg2 "cppflags ${CPPFLAGS}"
msg2 "cflags ${CFLAGS}"
msg2 "cxxflags ${CXXFLAGS}"
msg2 "ldflags ${LDFLAGS}"
msg2 "makeflags ${MAKEFLAGS}"
#unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS
}
build() {
msg2 "cppflags ${CPPFLAGS}"
msg2 "cflags ${CFLAGS}"
msg2 "cxxflags ${CXXFLAGS}"
msg2 "ldflags ${LDFLAGS}"
msg2 "makeflags ${MAKEFLAGS}"
#unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS
}
check() {
msg2 "cppflags ${CPPFLAGS}"
msg2 "cflags ${CFLAGS}"
msg2 "cxxflags ${CXXFLAGS}"
msg2 "ldflags ${LDFLAGS}"
msg2 "makeflags ${MAKEFLAGS}"
#unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS
}
package() {
msg2 "cppflags ${CPPFLAGS}"
msg2 "cflags ${CFLAGS}"
msg2 "cxxflags ${CXXFLAGS}"
msg2 "ldflags ${LDFLAGS}"
msg2 "makeflags ${MAKEFLAGS}"
#unset CPPFLAGS CFLAGS CXXFLAGS LDFLAGS MAKEFLAGS
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment