I reconfigured my vm to streamline my building of DeLinuxCo ISO and I have an issue that is just stumping me. Building AUR packages locally fails, but works when using yay!
I created a manjaro-tools directory in my home directory. /home/delinuxco/manjaro-tools
and added pkgbuild directory.
I copied the manjaro-tools config files to /home/delinuxco/.config/manjaro-tools/
Contents of ~/.config/manjaro-tools/manjaro-tools.conf pointing to /home/delinuxco/manjaro-tools/pkgbuild
######################################################
################ manjaro-tools.conf ##################
######################################################
# default target branch
# target_branch=stable
# default target arch: auto detect
# target_arch=$(uname -m)
# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files
cache_dir=/home/delinuxco/manjaro-tools/pkgbuild
# build dir where buildpkg or buildiso chroots are created
# chroots_dir=/home/packages/pkgbuild
chroots_dir=/home/delinuxco/manjaro-tools/pkgbuild
# log dir where log files are created
log_dir='/var/log/manjaro-tools'
The package I am trying to build is called delinuxco, I put the PKGBUILD file in /home/delinuxco/manjaro-tools/pkgbuild/delinuxco
When I try to build the package, I get the following error:
I completely removed manjaro-tools from the system, purged /var/lib as well as /var/cache and in the home directory of anything manjaro-tools. I then reinstalled manjaro-tools, updated the system and rebooted.
After reboot, copied the manjaro-tools from /etc to ~/.config/
Edited ~/.config/manjaro-tools/manjaro-tools.conf and changed the cache and chroots;
######################################################
################ manjaro-tools.conf ##################
######################################################
# default target branch
# target_branch=stable
# default target arch: auto detect
# target_arch=$(uname -m)
# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files
# cache_dir=/var/cache/manjaro-tools
cache_dir=/home/delinuxco/pkgbuild
# build dir where buildpkg or buildiso chroots are created
# chroots_dir=/var/lib/manjaro-tools
chroots_dir=/home/delinuxco/pkgbuild
# log dir where log files are created
# log_dir='/var/log/manjaro-tools'
# custom build mirror server
# build_mirror=https://manjaro.moson.eu/
######################################################
################ manjaro-tools.conf ##################
######################################################
# default target branch
# target_branch=stable
# default target arch: auto detect
# target_arch=$(uname -m)
# cache dir where buildpkg, buildtree cache packages/pkgbuild, builiso iso files
# cache_dir=/var/cache/manjaro-tools
cache_dir=/home/delinuxco/pkgbuild
# build dir where buildpkg or buildiso chroots are created
# chroots_dir=/var/lib/manjaro-tools
chroots_dir=/home/delinuxco/pkgbuild
# log dir where log files are createdbuildpkg -p delinuxco -c
# log_dir='/var/log/manjaro-tools'
# custom build mirror server
# build_mirror=https://manjaro.moson.eu/
################ buildtree ###############
I then created the build directory in ~/pkgbuild
then copied the delinuxco directory into the pkgbuild so that the PKGBUILD file path is: ~/pkgbuild/delinuxco/PKGBUILD
Then from inside ~/pkgbuild directory I ran;
Ah, I see now. Your setup is fine. I’m having trouble focusing with these cluster headaches.
Please post logs using Preformatted text instead of screnshots.
The problem is in your package() function, the error is referring to this line:
cp -Rf ${srcdir}/etc/* ...
That path does not exist. the source tarball is automatically extracted to the SRCDEST: ${srcdir}/${pkgname}-${pkgver}-${arch}. Your prepare() function is completely unnecessary.
However, you could skip extracting it with:
noextract=("${pkgname}-${pkgver}-${arch}.tar.xz")
Then all you’d have to do in the package() function is:
Don’t use new variables if you can help it, but if you do add an underscore in front like I did above. That way they won’t conflict with any existing or future variables used.
Some PKGBUILD critique:
A package already provides and conflicts with itself, no need for either.
Tip: instead of mkdir -p, use install -D to create a leading directory. Permissions should also be set; i.e., install -Dm755 binary "${pkgdir}"/usr/bin/binary.