aboutsummaryrefslogtreecommitdiff
path: root/personal/spotifyd/build
blob: 6e818849a863aad9d6a985d72648625ba50e3c9e (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
#!/bin/sh -e

export CARGO_HOME=$PWD

(
    cd vendor

    for crate in *.crate; do
        tar xf "$crate"

        # Strip the filename from the sha256sum output.
        sha256=$(sha256sum "$crate")
        sha256=${sha256%% *}

        printf '{"package":"%s","files":{}}\n' "$sha256" \
               > "${crate%.crate}/.cargo-checksum.json"
    done
)

mkdir -p .cargo

cat <<EOF > .cargo/config
[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"
EOF


cargo build \
    --release \
    --frozen \
    --no-default-features \
    --features alsa_backend

install -Dm755 target/release/spotifyd "$1/usr/bin/spotifyd"