summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3221e77114022e4d81fb072e918df3262ffe852a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Maintainer: pakrohk <pakrohk@gmail.com>
pkgname=qoder-cli
pkgver=latest
pkgrel=1
pkgdesc="Qoder Agentic CLI - Advanced AI coding agent from Alibaba"
url="https://qoder.com/cli"
arch=('x86_64')
license=('proprietary')

# No runtime dependencies beyond base system (portable binary)
# Build-time: curl (usually present on Arch)
options=('!strip')

prepare() {
  cd "${srcdir}"

  echo "================================================================================"
  echo "Preparing Qoder CLI installation..."
  echo "================================================================================"

  # Check if binary already provided manually
  if [ ! -f "qoder-cli" ]; then
    echo "Downloading latest Qoder CLI using official installation script..."
    echo "Script: curl -fsSL https://qoder.com/install | bash"

    # Run official script to download portable binary
    curl -fsSL https://qoder.com/install | bash || {
      echo "ERROR: Download failed. Check internet connection or sanctions bypass."
      echo "Alternative: Manually download the Linux CLI binary from https://qoder.com/cli"
      echo "          Place it as 'qoder-cli' in this directory and rerun makepkg."
      exit 1
    }

    # Official script typically outputs 'qoder' or 'qodercli' - rename safely
    if [ -f "qoder" ]; then
      mv qoder qoder-cli && echo "Renamed 'qoder' → 'qoder-cli'"
    elif [ -f "qodercli" ]; then
      mv qodercli qoder-cli && echo "Renamed 'qodercli' → 'qoder-cli'"
    else
      echo "ERROR: Expected binary (qoder or qodercli) not found after script execution."
      echo "Please check script output or download manually."
      exit 1
    fi
  else
    echo "Using pre-placed qoder-cli binary from source directory"
  fi

  # Security notice
  echo "================================================================================"
  echo "NOTE: Qoder does not publish official SHA256/MD5 checksums."
  echo "      For security-critical use, verify the binary manually."
  echo "================================================================================"
}

package() {
  cd "${srcdir}"

  echo "================================================================================"
  echo "Installing Qoder CLI..."
  echo "================================================================================"

  # Install portable binary
  install -Dm755 qoder-cli "${pkgdir}/usr/bin/qoder"
  echo "Binary installed to /usr/bin/qoder"

  echo "================================================================================"
  echo "Qoder CLI successfully installed!"
  echo ""
  echo "Launch with: qoder"
  echo "First run: Use /login command inside CLI to sign in (pakrohk@gmail.com)"
  echo "Enjoy agentic coding in your terminal! 🚀"
  echo "================================================================================"
}