archrelease: copy trunk to extra-x86_64
[arch-packages.git] / cbindgen / repos / extra-x86_64 / PKGBUILD
blob15059999d0d7513f6b9ef363e61421e9cba1e2dd
1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
3 pkgname=cbindgen
4 pkgver=0.24.3
5 pkgrel=1
6 pkgdesc="A tool for generating C bindings to Rust code"
7 url="https://github.com/eqrion/cbindgen"
8 arch=(x86_64)
9 license=(MPL2)
10 depends=(gcc-libs)
11 makedepends=(cargo git)
12 checkdepends=(cython)
13 options=(debug)
14 _commit=f43ccfc047a1a160267f32355c5e5e7154a2665a  # tags/v0.24.3^0
15 source=("git+$url#commit=$_commit")
16 sha512sums=('SKIP')
18 # Use LTO
19 export CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
21 # Use debug
22 export CARGO_PROFILE_RELEASE_DEBUG=2
24 pkgver() {
25   cd cbindgen
26   git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
29 prepare() {
30   cd cbindgen
31   cargo fetch --locked --target x86_64-unknown-linux-gnu
34 build() {
35   cd cbindgen
36   cargo build --release --frozen --all-targets
39 check() {
40   cd cbindgen
41   # Tests need nightly features
42   RUSTC_BOOTSTRAP=1 cargo test --release --frozen
45 package() {
46   cd cbindgen
47   install -Dt "$pkgdir/usr/bin" target/release/cbindgen
48   install -Dt "$pkgdir/usr/share/doc/$pkgname" -m644 README.md