diff --git a/makechrootpkg.in b/makechrootpkg.in
index 0d93c2ed2dab9635e6a61fce618ecc02d3063b0f..862e6bcd762ffb1b90082777b6c717910e486402 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -247,6 +247,11 @@ shopt -s nullglob
 ln -sft /srcdest /srcdest_host/*
 ln -sft /startdir /startdir_host/*
 
+# Keep PKGBUILD writable for pkgver()
+rm /startdir/PKGBUILD*
+cp /startdir_host/PKGBUILD* /startdir
+chown nobody /startdir/PKGBUILD*
+
 cd /startdir
 sudo -u nobody makepkg $makepkg_args || exit 1