clojure-lsp: update to 2024.08.05.
[void-pkg.git] / common / xbps-src / libexec / xbps-src-doinstall.sh
blobfb5d35d1a59aec21274533ee010ea8d3f80d1bb6
1 #!/bin/bash
3 # vim: set ts=4 sw=4 et:
5 # Passed arguments:
6 # $1 - pkgname [REQUIRED]
7 # $2 - subpkg mode [REQUIRED]
8 # $2 - cross target [OPTIONAL]
10 if [ $# -lt 2 -o $# -gt 3 ]; then
11 echo "${0##*/}: invalid number of arguments: pkgname subpkg-mode [cross-target]"
12 exit 1
15 PKGNAME="$1"
16 SUBPKG_MODE="$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/install/*.sh; do
26 source_file "$f"
27 done
29 XBPS_INSTALL_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_install_done"
31 ch_wrksrc
33 if [ "$SUBPKG_MODE" = "no" ]; then
34 if [ ! -f $XBPS_INSTALL_DONE ] || [ -f $XBPS_INSTALL_DONE -a -n "$XBPS_BUILD_FORCEMODE" ]; then
35 mkdir -p $XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/$pkgname-$version
37 run_step install "" skip
39 touch -f $XBPS_INSTALL_DONE
41 exit 0
44 XBPS_SUBPKG_INSTALL_DONE="${XBPS_STATEDIR}/${PKGNAME}_${XBPS_CROSS_BUILD}_subpkg_install_done"
46 # If it's a subpkg execute the pkg_install() function.
47 if [ ! -f $XBPS_SUBPKG_INSTALL_DONE ]; then
48 if [ "$sourcepkg" != "$PKGNAME" ]; then
49 # Source all subpkg environment setup snippets.
50 for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
51 source_file "$f"
52 done
54 ${PKGNAME}_package
55 pkgname=$PKGNAME
57 source_file $XBPS_COMMONDIR/environment/build-style/${build_style}.sh
59 install -d $PKGDESTDIR
60 if declare -f pkg_install >/dev/null; then
61 run_pkg_hooks pre-install
62 run_func pkg_install
65 setup_pkg_depends ${pkgname:=$PKGNAME} || exit 1
66 run_pkg_hooks post-install
67 touch -f $XBPS_SUBPKG_INSTALL_DONE
70 exit 0