summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-07-09 13:38:11 +0700
committerShulhan <ms@kilabit.info>2022-07-09 13:52:17 +0700
commit90de211ecfec1e434949ee1aea00922d5d6b4e5a (patch)
treefdd2c4dfe55cf3890bc99eb4263b86fe2956f089 /Makefile
parentfddcb64806196a308f04eeb7c6e428e90fbc998e (diff)
downloadgoogle-cloud-ops-agent-git-90de211ecfec1e434949ee1aea00922d5d6b4e5a.tar.xz
all: add task to build package using devtools
The devtools allow package to build in clean chroot [1]. In this build, we bind the host go, go-build cache, and .gradle cache to the chroot/build to minimize re-downloading Go and Java dependencies on the next rebuild. [1] https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index a0a2eab..25aa434 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: all check release
+.PHONY: all check chrootpkg patch release
all:
makepkg -sd
@@ -6,6 +6,21 @@ all:
check:
namcap PKGBUILD
+## Build the package using devtools.
+##
+## We bind the host go, go-build cache, and .gradle cache to the chroot/build
+## to minimize re-downloading Go and Java dependencies on the next rebuild.
+chrootpkg:
+ mkdir -p $$HOME/go
+ mkdir -p $$HOME/.cache/go-build
+ mkdir -p $$HOME/.gradle
+ mkdir -p _build
+ mkarchroot _build/root base-devel systemd || exit 0
+ makechrootpkg -d $$HOME/go:/build/go \
+ -d $$HOME/.cache/go-build:/build/.cache/go-build \
+ -d $$HOME/.gradle:/build/.gradle \
+ -r _build
+
patch:
git -C src/google-cloud-ops-agent-git diff > 0001-apps-hostmetrics.patch && \
makepkg -g