summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5b112eb353c5c944f21141779c49d605d13bec47 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgbase=duckdb
pkgname=(
  'duckdb'
  'python-duckdb'
)
pkgver=0.5.1
pkgrel=1
pkgdesc='A high-performance analytical database system'
arch=('x86_64')
url='https://duckdb.org'
license=('MIT')
depends=(
  'gcc-libs'
  'openssl'
)
makedepends=(
  'git'
  'cmake'
  'python-setuptools'
  'pybind11'
  'python-numpy'
  'python-pandas'
  'libutf8proc'
  'python-pip'
  'python-wheel'
  'python-setuptools-scm'
)
_commit='7c111322de1095436350f95e33c5553b09302165'
source=("$pkgbase::git+https://github.com/duckdb/duckdb.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgbase"

  git describe --tags | sed 's/^v//'
}

prepare() {
  cmake \
    -S "$pkgbase" \
    -B build \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_VISUALIZER_EXTENSION=1 \
    -DBUILD_ICU_EXTENSION=1 \
    -DBUILD_TPCH_EXTENSION=1 \
    -DBUILD_TPCDS_EXTENSION=1 \
    -DBUILD_FTS_EXTENSION=1 \
    -DBUILD_HTTPFS_EXTENSION=1 \
    -DBUILD_PARQUET_EXTENSION=1
}

build() {
  cmake --build build

  python "$pkgbase/tools/pythonpkg/setup.py" build
}

package_duckdb() {
  conflicts=('duckdb-git')
  DESTDIR="$pkgdir" cmake --install build

  # sqlite wrapper
  install -vDm755 -t "$pkgdir/usr/lib" build/tools/sqlite3_api_wrapper/libsqlite3_api_wrapper.so

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgbase" "$pkgbase/LICENSE"
}

package_python-duckdb() {
  pkgdesc+=" (Python API)"
  depends=(
    'python'
    'gcc-libs'
  )
  optdepends=(
    'python-numpy'
    'python-pandas'
  )
  conflicts=('python-duckdb-git')

  # library
  python "$pkgbase/tools/pythonpkg/setup.py" install --root="$pkgdir" --optimize=1 --skip-build

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" "$pkgbase/LICENSE"

  # remove cruft
  rm -rf "$pkgdir/usr/duckdb" "$pkgdir/usr/"*.list
}