summaryrefslogtreecommitdiff
path: root/libs/librsvg/MAKEPKG
blob: 6bc7440bc19546e41273f947645e24cafd101ce9 (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
#!/bin/mkpkg
# description: SVG rendering library with gdk-pixbuf loader
# url: https://gitlab.gnome.org/GNOME/librsvg

name=librsvg
version=2.62.4
release=1
depends=(cairo pango glib libxml2 gdk-pixbuf libunwind)
makedeps=(meson rust cargo-c cargo-audit python3)
source=(https://github.com/GNOME/$name/archive/refs/tags/$version.tar.gz)
renames=($name-$version.tar.gz)
sha256sums=(
    "83d2689f3ab78865ef9b250eb3ec09bd18c864d91e45d66e19ff60d7becfa23e"
)

patch() {
    export CARGO_HOME="$SRC/.cargo"
    cd $name-$version

    cargo vendor --locked ../vendor
    mkdir -p .cargo
    printf '%s\n' \
        '[source.crates-io]' \
        'replace-with = "vendored-sources"' \
        '' \
        '[source.vendored-sources]' \
        'directory = "../vendor"' \
        > .cargo/config.toml

    cargo audit
}

build() {
    export CARGO_HOME="$SRC/.cargo"
    export CARGO_NET_OFFLINE=true
    export CARGO_HTTP_CAINFO=/etc/ssl/cert.pem
    export RUSTFLAGS="-C target-feature=-crt-static"
    cd $name-$version

    # build dir must live inside the source tree: meson's cargo_wrapper.py
    # runs cargo from the build root, so .cargo/config.toml is found from there
    meson setup _build \
        --prefix=/usr \
        --libdir=lib \
        --buildtype=plain \
        --wrap-mode=nodownload \
        -D pixbuf=enabled \
        -D pixbuf-loader=enabled \
        -D rsvg-convert=disabled \
        -D avif=disabled \
        -D introspection=disabled \
        -D vala=disabled \
        -D docs=disabled \
        -D tests=false

    meson compile -C _build
    DESTDIR=$PKG meson install -C _build

    rm -rf $PKG/usr/share/thumbnailers
}

signify() {
    untrusted comment: public key
    RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3
}

# vim: filetype=sh