summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bc2828e956e79eed365bf8ebb617922ddb8cc8a7 (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
# Original repository: https://github.com/hkr04/cpp-mcp
# Maintainer: K_log Televised - youtube klog.website.notdotcom@gmail.com
pkgname=cpp-mcp
pkgver=alpha
pkgrel=1
pkgdesc="C++ implementation of Model Context Protocol (MCP)"
arch=('x86_64' 'i686' 'armv7h' 'aarch64')
url="https://github.com/klogdotwebsitenotdotcom/cpp-mcp"
license=('MIT')
depends=('openssl')
makedepends=('cmake')
# Use git source with specific branch
source=("git+${url}.git#branch=distribution")
sha256sums=('SKIP')

# Build options
options=('!strip' 'staticlibs')
: ${MCP_SSL:=ON}

build() {
  cd "$srcdir/cpp-mcp"
  
  cmake -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DMCP_SSL=${MCP_SSL} \
    -DCMAKE_INSTALL_PREFIX=/usr
  
  cmake --build build
}

check() {
  cd "$srcdir/cpp-mcp/build"
  ctest --output-on-failure
}

package() {
  cd "$srcdir/cpp-mcp"
  
  DESTDIR="$pkgdir" cmake --install build
  
  # Move headers to mcp namespace (matching Debian)
  if [ -d "$pkgdir/usr/include" ]; then
    mkdir -p "$pkgdir/usr/include/mcp"
    mv "$pkgdir/usr/include/mcp_"*.h "$pkgdir/usr/include/mcp/" 2>/dev/null || true
    
    # Move common headers
    cp common/*.h* "$pkgdir/usr/include/mcp/" 2>/dev/null || true
  fi
  
  # Install license
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  
  # Install README and other documentation
  install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  
  # Create pkg-config file for easy linking
  install -Dm644 /dev/stdin "$pkgdir/usr/lib/pkgconfig/cpp-mcp.pc" <<EOF
prefix=/usr
exec_prefix=\${prefix}
libdir=\${prefix}/lib
includedir=\${prefix}/include/mcp

Name: cpp-mcp
Description: C++ implementation of Model Context Protocol (MCP)
Version: ${pkgver}
Libs: -L\${libdir} -lmcp -lpthread
Cflags: -I\${includedir}
Requires: openssl
EOF
}