File: rules

package info (click to toggle)
tree-sitter 0.25.9-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,048 kB
  • sloc: ansic: 17,278; javascript: 2,242; makefile: 191; python: 91; cpp: 13
file content (41 lines) | stat: -rwxr-xr-x 1,208 bytes parent folder | download
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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/default.mk

# Work around asserts being enabled in all builds
# https://github.com/tree-sitter/tree-sitter/issues/4960
ifeq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
  CPPFLAGS += -DNDEBUG
endif

CFLAGS += $(CPPFLAGS)

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	dh_auto_clean --buildsystem=rust

override_dh_auto_build:
	dh_auto_build -- PREFIX=/usr LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
	dh_auto_build --buildsystem=rust

# tree-sitter-cli's tests require downloading fixtures at build time, so we can't run those.
# xtask is an internal crate used for release automation
override_dh_auto_test:
	dh_auto_test --buildsystem=rust -- --tests --workspace --exclude tree-sitter-cli --exclude xtask

override_dh_auto_install:
	dh_auto_install -- PREFIX=/usr LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
	dh_auto_install --buildsystem=rust

define crate_ver =
$(shell perl -n -E 'if (/^version\s*=\s*"([\d.]+)["~]/) {say "$$1";}' lib/language/Cargo.toml)
endef

override_dh_gencontrol:
	dh_gencontrol -p librust-tree-sitter-language-dev -- -v$(crate_ver)+$(DEB_VERSION_UPSTREAM_REVISION)
	dh_gencontrol --remaining-packages