File: rules

package info (click to toggle)
coq 8.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 30,604 kB
  • sloc: ml: 192,230; sh: 2,585; python: 2,206; ansic: 1,878; makefile: 818; lisp: 202; xml: 24; sed: 2
file content (126 lines) | stat: -rwxr-xr-x 3,563 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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/make -f
# debian/rules for coq

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Build cache (for accelerating Debian debugging)
BUILDCACHE := $(wildcard ../coq.cache)

# This has to be exported to make some magic below work.
export CAML_LD_LIBRARY_PATH = $(shell pwd)/kernel/byterun

# Show full commands when building Coq
export VERBOSE=1

include /usr/share/ocaml/ocamlvars.mk

HTMLDOC := doc/stdlib/html/index.html

COQPREF := $(CURDIR)/debian/tmp
ADDPREF := COQINSTALLPREFIX=$(COQPREF) OLDROOT=

PACKAGES := $(shell dh_listpackages)

COQ_VERSION := 8.9.0
COQ_ABI := $(COQ_VERSION)+$(OCAML_ABI)

ARCH := $(shell dpkg-architecture -q DEB_TARGET_ARCH)
ifeq ($(ARCH),$(filter $(ARCH),amd64 i386))
NATIVE_COMPUTE := 
else
NATIVE_COMPUTE := -native-compiler no
endif

CONFIGUREOPTS := -arch Linux -prefix /usr -mandir /usr/share/man \
  -configdir /etc/xdg/coq \
  -browser "/usr/bin/x-www-browser %s &" \
  -coqide no \
  -with-doc no \
  $(NATIVE_COMPUTE)

export OCAMLINIT_SED += \
  -e 's%@CoqVersion@%$(COQ_VERSION)%' \
  -e 's%@CoqABI@%$(COQ_ABI)%'

%:
	+dh $@ --with ocaml,python3

# There is already a file named "build" in upstream sources, so the
# above rule is never called. We make it explicitly a phony rule here.
.PHONY: build
build:
	+dh $@ --with ocaml,python3

.PHONY: override_dh_auto_configure
override_dh_auto_configure:
	./configure $(CONFIGUREOPTS)

.PHONY: override_dh_auto_build
override_dh_auto_build:
ifeq ($(BUILDCACHE),)

# VALIDOPTS are the options given to coqchk; the value given here is
# the default one without -silent (-silent maybe cause buildd to
# timeout because of lack of output)

# Don't combine `make world` and `make byte`--doing so triggers a race
# in the build system. See upstream's CHANGES.
	$(MAKE) world STRIP=true
	$(MAKE) byte STRIP=true
	$(MAKE) DOC_TARGETS=$(HTMLDOC) $(HTMLDOC)
else
	rsync -a --exclude=debian --exclude=.git $(BUILDCACHE)/ .
endif
# Check that $(COQ_VERSION) has the right value
	ACTUAL_COQ_VERSION="$$(./bin/coqc --version | awk '/version/{print $$6}')"; \
	if [ "$$ACTUAL_COQ_VERSION" != "$(COQ_VERSION)" ]; then \
	  echo "Please set COQ_VERSION to $$ACTUAL_COQ_VERSION in debian/rules"; \
	  exit 2; \
	fi

.PHONY: override_dh_auto_test
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	CAML_LD_LIBRARY_PATH=$(shell pwd)/kernel/byterun COQLIB=$(shell pwd) \
	  $(MAKE) test-suite COMPLEXITY=
endif

.PHONY: override_dh_auto_install
override_dh_auto_install:
	$(MAKE) $(ADDPREF) install install-byte
	find debian/tmp -regextype posix-awk \
	  -regex '.*\.(cmi|cmx|cmxa|[ao])$$' \
	  | grep -v coq-native \
	  >> debian/libcoq-ocaml-dev.install
	find debian/tmp -name '*.vo' -printf '%P\n' \
	  >> debian/coq-theories.install
	find debian/tmp -name '*.v' -printf '%P\n' \
	  >> debian/coq-theories.install
	find debian/tmp -name '*.glob' -printf '%P\n' \
	  >> debian/coq-theories.install
	find debian/tmp -name '.coq-native' -printf '%P\n' \
	  >> debian/coq-theories.install

.PHONY: override_dh_install
override_dh_install:
	chmod +x debian/coq.install
	dh_install --fail-missing

.PHONY: override_dh_fixperms
override_dh_fixperms:
	dh_fixperms
	chmod -x debian/tmp/usr/lib/coq/tools/TimeFileMaker.py

.PHONY: override_dh_ocaml
override_dh_ocaml:
	dh_ocaml
	for f in debian/*substvars; do echo $$f; cat $$f; done

.PHONY: override_dh_gencontrol
override_dh_gencontrol:
	for u in $(PACKAGES); do \
	  echo 'F:OCamlABI=$(OCAML_ABI)' >> debian/$$u.substvars; \
	  echo 'F:CoqABI=$(COQ_ABI)' >> debian/$$u.substvars; \
	done
	dh_gencontrol