summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 04b2973e3f944a3586e381e4c3e030fb5320f115 (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
# Maintainer: Yakov Till <yakov.till@gmail.com>
# Contributor: devome <evinedeng@hotmail.com>

_pkgname=firecrawl-py
_pipname="${_pkgname//-/_}"
pkgname="python-${_pkgname}"
pkgver=4.42.0
pkgrel=1
pkgdesc="Python SDK for Firecrawl API"
arch=('any')
url="https://github.com/mendableai/firecrawl"
license=('MIT')
depends=(python-aiohttp python-dotenv python-httpx python-nest-asyncio python-pydantic python-requests python-websockets)
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel')
source=("${_pkgname}-${pkgver}.tar.gz::https://files.pythonhosted.org/packages/source/${_pkgname::1}/${_pkgname}/${_pipname}-${pkgver}.tar.gz")
sha256sums=('48f0210243ae2d8da57647b54d7a372f5fdd5c4c8bf15c67597c92a729788f78')

latestver() {
    python - <<'PY'
import json
import urllib.request

with urllib.request.urlopen("https://pypi.org/pypi/firecrawl-py/json", timeout=10) as response:
    print(json.load(response)["info"]["version"])
PY
}

build() {
    cd "${_pipname}-${pkgver}"
    python -m build --wheel --no-isolation
}

package() {
    cd "${_pipname}-${pkgver}"
    python -m installer --destdir="${pkgdir}" dist/*.whl
    local site_packages="${pkgdir}/usr/lib/$(readlink /usr/bin/python3)/site-packages"
    rm -rf "${site_packages}/build" "${site_packages}/firecrawl/__tests__" "${site_packages}/tests"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}