clojure-lsp: update to 2024.08.05.
[void-pkg.git] / common / xbps-src / libexec / xbps-src-dopkg.sh
blob5fec7b9d8d56c70e7a3d51eb9a6c742f0d6d3f1f
1 #!/bin/bash
3 # vim: set ts=4 sw=4 et:
5 # Passed arguments:
6 # $1 - pkgname [REQUIRED]
7 # $2 - path to local repository [REQUIRED]
8 # $3 - cross-target [OPTIONAL]
10 if [ $# -lt 2 -o $# -gt 3 ]; then
11 echo "${0##*/}: invalid number of arguments: pkgname repository [cross-target]"
12 exit 1
15 PKGNAME="$1"
16 XBPS_REPOSITORY="$2"
17 XBPS_CROSS_BUILD="$3"
19 for f in $XBPS_SHUTILSDIR/*.sh; do
20 . $f
21 done
23 setup_pkg "$PKGNAME" $XBPS_CROSS_BUILD
25 for f in $XBPS_COMMONDIR/environment/pkg/*.sh; do
26 source_file "$f"
27 done
29 if [ "$sourcepkg" != "$PKGNAME" ]; then
30 # Source all subpkg environment setup snippets.
31 for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
32 source_file "$f"
33 done
35 ${PKGNAME}_package
36 pkgname=$PKGNAME
39 if [ -s $XBPS_MASTERDIR/.xbps_chroot_init ]; then
40 export XBPS_ARCH=$(<$XBPS_MASTERDIR/.xbps_chroot_init)
43 # Run do-pkg hooks.
44 run_pkg_hooks "do-pkg"
46 # Run post-pkg hooks.
47 run_pkg_hooks post-pkg
49 exit 0