ostree/rust-bindings/rust/Makefile

63 lines
1.6 KiB
Makefile
Raw Normal View History

2020-07-24 13:19:08 +03:00
GIR_REPO := https://github.com/gtk-rs/gir.git
GIR_VERSION := 2d1ffab19eb5f9a2f0d7a294dbf07517dab4d989
OSTREE_REPO := https://github.com/fkrull/ostree.git
2020-08-26 00:31:58 +03:00
OSTREE_VERSION := patch-v2020.5
2020-07-24 13:39:39 +03:00
RUSTDOC_STRIPPER_VERSION := 0.1.13
2019-12-15 16:05:17 +03:00
2019-05-24 22:51:34 +03:00
all: gir
2018-10-09 23:24:06 +03:00
.PHONY: gir gir-report update-gir-files remove-gir-files merge-lgpl-docs ci-build-stages
2018-10-09 23:24:06 +03:00
# -- gir generation --
2018-10-20 12:59:54 +03:00
target/tools/bin/gir:
cargo install --root target/tools --git $(GIR_REPO) --rev $(GIR_VERSION) -- gir
2018-10-09 23:24:06 +03:00
2019-05-24 22:51:34 +03:00
gir: target/tools/bin/gir
target/tools/bin/gir -c conf/ostree-sys.toml
target/tools/bin/gir -c conf/ostree.toml
2018-10-09 23:24:06 +03:00
gir-report: gir
target/tools/bin/gir -c conf/ostree.toml -m not_bound
# -- LGPL docs generation --
2018-10-20 12:59:54 +03:00
target/tools/bin/rustdoc-stripper:
2019-12-15 16:05:17 +03:00
cargo install --root target/tools --version $(RUSTDOC_STRIPPER_VERSION) -- rustdoc-stripper
2018-10-20 12:59:54 +03:00
merge-lgpl-docs: target/tools/bin/gir target/tools/bin/rustdoc-stripper
2019-05-16 22:41:38 +03:00
target/tools/bin/gir -c conf/ostree.toml -m doc
2018-10-20 12:59:54 +03:00
target/tools/bin/rustdoc-stripper -g -o target/vendor.md
# -- gir file management --
2018-10-09 23:24:06 +03:00
update-gir-files: \
remove-gir-files \
gir-files \
gir-files/GLib-2.0.gir \
gir-files/Gio-2.0.gir \
gir-files/GObject-2.0.gir \
gir-files/OSTree-1.0.gir
2018-10-09 23:24:06 +03:00
remove-gir-files:
rm -f gir-files/*.gir
2018-10-09 23:24:06 +03:00
gir-files:
mkdir -p gir-files
%.gir:
curl -o $@ -L https://github.com/gtk-rs/gir-files/raw/master/${@F}
gir-files/OSTree-1.0.gir:
podman build \
2020-08-25 20:54:35 +03:00
--pull \
--build-arg OSTREE_REPO=$(OSTREE_REPO) \
--build-arg OSTREE_VERSION=$(OSTREE_VERSION) \
-t ostree-build \
.
podman run \
--rm \
-v $(PWD)/gir-files:/gir-files \
ostree-build \
bash -eu -c "cp /build/OSTree-1.0.gir /gir-files/"