mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-07 02:46:50 +00:00
fix(ollama,yq): improve archive handling and man page location
ollama: handle all 3 distribution eras (linux tar.zst, macOS .app bundle, bare binary), fix test -f to test -d for lib/, extract GPU libs from .app bundle. yq: install man page to versioned $pkg_src_dir instead of global ~/.local/share/man/man1/.
This commit is contained in:
@@ -25,23 +25,31 @@ __init_ollama() {
|
||||
# ~/.local/opt/
|
||||
mkdir -p "$(dirname "${pkg_src_dir}")"
|
||||
|
||||
if test -d ./ollama-*/; then
|
||||
# the de facto way (in case it's supported in the future)
|
||||
# mv ./ollama-*/ ~/.local/opt/ollama-v3.27.0/
|
||||
mv ./ollama-*/ "${pkg_src}"
|
||||
elif test -d ./bin; then
|
||||
# how linux is presently done
|
||||
if test -d ./bin; then
|
||||
# linux tar.zst layout: bin/ollama + lib/ollama/
|
||||
mkdir -p "${pkg_src_dir}"
|
||||
mv ./bin "${pkg_src_dir}"
|
||||
if test -f ./lib; then
|
||||
mv ./lib "${pkg_src_dir}"
|
||||
mv ./bin "${pkg_src_dir}/bin"
|
||||
if test -d ./lib; then
|
||||
mv ./lib "${pkg_src_dir}/lib"
|
||||
fi
|
||||
else
|
||||
# how macOS is presently done
|
||||
elif test -d ./Ollama.app; then
|
||||
# macOS zip layout: extract CLI from Ollama.app bundle
|
||||
mkdir -p "${pkg_src_dir}/bin"
|
||||
mv ./Ollama.app/Contents/Resources/ollama "${pkg_src_cmd}"
|
||||
# install shared libs for GPU acceleration
|
||||
mkdir -p "${pkg_src_dir}/lib/ollama"
|
||||
mv ./Ollama.app/Contents/Resources/libggml-*.so "${pkg_src_dir}/lib/ollama/" 2>/dev/null || true
|
||||
mv ./Ollama.app/Contents/Resources/libggml-*.dylib "${pkg_src_dir}/lib/ollama/" 2>/dev/null || true
|
||||
mv ./Ollama.app/Contents/Resources/libmlx*.dylib "${pkg_src_dir}/lib/ollama/" 2>/dev/null || true
|
||||
mv ./Ollama.app/Contents/Resources/mlx.metallib "${pkg_src_dir}/lib/ollama/" 2>/dev/null || true
|
||||
elif test -f ./ollama-*; then
|
||||
# older macOS/linux bare binary format
|
||||
mkdir -p "$(dirname "${pkg_src_cmd}")"
|
||||
mv ./ollama-* "${pkg_src_cmd}"
|
||||
fi
|
||||
|
||||
chmod a+x "${pkg_src_cmd}"
|
||||
|
||||
# remove previous location
|
||||
if test -f ~/.local/bin/ollama; then
|
||||
rm ~/.local/bin/ollama
|
||||
|
||||
@@ -16,12 +16,12 @@ __init_yq() {
|
||||
pkg_install() {
|
||||
mkdir -p "$(dirname "$pkg_src_cmd")"
|
||||
# yq_linux_amd64.tar.gz contains:
|
||||
# - yq_linux_amd64
|
||||
# - yq_linux_amd64 (binary with platform suffix — needs rename)
|
||||
# - yq.1
|
||||
# - install-man-page.sh
|
||||
if [ -e ./yq.1 ]; then
|
||||
mkdir -p ~/.local/share/man/man1
|
||||
mv ./yq.1 ~/.local/share/man/man1/
|
||||
mkdir -p "$pkg_src_dir/share/man/man1"
|
||||
mv ./yq.1 "$pkg_src_dir/share/man/man1/yq.1"
|
||||
fi
|
||||
mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
|
||||
chmod a+x "$pkg_src_cmd"
|
||||
|
||||
Reference in New Issue
Block a user