1010# --rocm force ROCm/HIP build
1111# --vulkan force Vulkan build
1212# --cpu CPU-only build (disable GPU auto-detection)
13- # --repo URL override the git repository to clone
13+ # --repo URL override the git repository to clone (env: ACESTEP_CPP_REPO)
14+ # --branch NAME checkout a specific branch/tag after cloning (env: ACESTEP_CPP_BRANCH)
1415
1516set -e
1617
@@ -19,6 +20,7 @@ SRC_DIR="${ACESTEP_CPP_SRC:-$DIR/acestep.cpp}"
1920BIN_DIR=" ${ACESTEP_BIN_DIR:- $DIR / bin} "
2021BUILD_DIR=" $SRC_DIR /build"
2122REPO=" ${ACESTEP_CPP_REPO:- https:// github.com/ audiohacking/ acestep.cpp.git} "
23+ BRANCH=" ${ACESTEP_CPP_BRANCH:- } "
2224FORCE_FLAGS=" "
2325CPU_ONLY=0
2426
@@ -28,6 +30,7 @@ while [ $# -gt 0 ]; do
2830 --src) SRC_DIR=" $2 " ; BUILD_DIR=" $SRC_DIR /build" ; shift ;;
2931 --bin) BIN_DIR=" $2 " ; shift ;;
3032 --repo) REPO=" $2 " ; shift ;;
33+ --branch) BRANCH=" $2 " ; shift ;;
3134 --cuda) FORCE_FLAGS=" -DGGML_CUDA=ON" ;;
3235 --rocm) FORCE_FLAGS=" -DGGML_HIP=ON" ;;
3336 --vulkan) FORCE_FLAGS=" -DGGML_VULKAN=ON" ;;
6063
6164# ── Clone or update acestep.cpp ───────────────────────────────────────────────
6265if [ ! -d " $SRC_DIR /.git" ]; then
63- echo " Cloning acestep.cpp from $REPO ..."
64- git clone --depth 1 " $REPO " " $SRC_DIR "
66+ if [ -n " $BRANCH " ]; then
67+ echo " Cloning acestep.cpp from $REPO (branch: $BRANCH ) ..."
68+ git clone --depth 1 --branch " $BRANCH " " $REPO " " $SRC_DIR "
69+ else
70+ echo " Cloning acestep.cpp from $REPO ..."
71+ git clone --depth 1 " $REPO " " $SRC_DIR "
72+ fi
6573 echo " "
6674else
6775 echo " acestep.cpp source found at $SRC_DIR "
0 commit comments