clojure-lsp: update to 2024.08.05.
[void-pkg.git] / common / xbps-src / libexec / xbps-src-prepkg.sh
blob34f91b3f5f9de1929fb2e4beaaf7cba336239bce
1 #!/bin/bash
3 # vim: set ts=4 sw=4 et:
5 # Passed arguments:
6 # $1 - pkgname [REQUIRED]
7 # $2 - cross target [OPTIONAL]
9 if [ $# -lt 1 -o $# -gt 2 ]; then
10 echo "${0##*/}: invalid number of arguments: pkgname [cross-target]"
11 exit 1
14 PKGNAME="$1"
15 XBPS_CROSS_BUILD="$2"
17 for f in $XBPS_SHUTILSDIR/*.sh; do
18 . $f
19 done
21 setup_pkg "$PKGNAME" $XBPS_CROSS_BUILD
23 for f in $XBPS_COMMONDIR/environment/install/*.sh; do
24 source_file "$f"
25 done
28 XBPS_PREPKG_DONE="${XBPS_STATEDIR}/${PKGNAME}_${XBPS_CROSS_BUILD}_prepkg_done"
30 if [ -z "$XBPS_BUILD_FORCEMODE" -a -f $XBPS_PREPKG_DONE ]; then
31 exit 0
34 # If it's a subpkg execute the pkg_install() function.
35 if [ "$sourcepkg" != "$PKGNAME" ]; then
36 # Source all subpkg environment setup snippets.
37 for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
38 source_file "$f"
39 done
41 ${PKGNAME}_package
42 pkgname=$PKGNAME
45 source_file $XBPS_COMMONDIR/environment/build-style/${build_style}.sh
46 setup_pkg_depends $pkgname || exit 1
47 run_pkg_hooks pre-pkg
49 touch -f $XBPS_PREPKG_DONE
51 exit 0