summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9bd04f32aa5c5f18f6bb0121e831ba4e48d454ca (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
# Maintainer: Your Name <you@example.com>
pkgname=obscura-browser
pkgver=0.1.7
pkgrel=1
pkgdesc="Open-source headless browser for AI agents and web scraping (Rust/V8/CDP)"
arch=('x86_64' 'aarch64')
url="https://github.com/h4ckf0r0day/obscura"
license=('Apache-2.0')
depends=()           # single static binary, no runtime deps
makedepends=(
    'rust'           # >= 1.75 required
    'cargo'
    'clang'          # needed by rusty_v8 to compile V8
    'python'         # gn (V8 build system) requires Python
    'ninja'
    'gn'
)
options=('!lto')     # LTO conflicts with some V8 build steps
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/h4ckf0r0day/obscura/archive/refs/tags/v${pkgver}.tar.gz")

sha256sums=('121383b6209b95102e5522970954d8f97d1538385d998b9d423b40dbc9684a3b')

# Uncomment to enable anti-fingerprinting + tracker blocking (stealth mode).
# When enabled, pass --stealth at runtime to activate.
# _stealth_feature="--features stealth"

_srcname=obscura

prepare() {
    cd "${_srcname}-${pkgver}"
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
    cd "${_srcname}-${pkgver}"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target

    # V8 compiles from source on first build (~5 min, cached afterward).
    # Ensure enough RAM is available (4 GB+ recommended).
    cargo build \
        --frozen \
        --release \
        ${_stealth_feature}
}

check() {
    cd "${_srcname}-${pkgver}"
    cargo test --frozen --release ${_stealth_feature}
}

package() {
    cd "${_srcname}-${pkgver}"
    install -Dm755 "target/release/${_srcname}" "${pkgdir}/usr/bin/${_srcname}"
    install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
    install -Dm644 LICENSE   "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}