Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
7 export DEB_BUILD_OPTIONS += noautodbgsym
8
9 include /usr/share/ocaml/ocamlvars.mk
10
11 COQ_VERSION := 9.2
12 COQ_ABI := $(COQ_VERSION)+$(OCAML_ABI)
13
14 PACKAGES := $(shell dh_listpackages)
15
16 export OCAMLINIT_SED += \
17 -e 's%@CoqVersion@%$(COQ_VERSION)%' \
18 -e 's%@CoqABI@%$(COQ_ABI)%'
19
20 %:
21 +dh $@ --with coq,ocaml
22
23 override_dh_auto_configure:
24 ./configure -prefix=/usr -libdir=$(OCAML_STDLIB_DIR)/coq
25
26 override_dh_auto_build:
27 make dunestrap
28 dune build -p rocq-runtime,coq-core,rocq-core,coqide-server,rocqide --display=verbose
29
30 # Check that $(COQ_VERSION) has the right value
31 ACTUAL_COQ_VERSION="$$(./_build/install/default/bin/rocq --version | awk '/version/{print $$5}')"; \
32 if [ "$$ACTUAL_COQ_VERSION" != "$(COQ_VERSION)" ]; then \
33 echo "Please set COQ_VERSION to $$ACTUAL_COQ_VERSION in debian/rules"; \
34 exit 2; \
35 fi
36
37 override_dh_auto_test:
38 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
39 # OCAMLPATH=$(CURDIR)/_build_vo/default/lib make -C test-suite COQBIN=$(CURDIR)/_build_vo/default/bin/ COQLIB=$(CURDIR)/_build_vo/default/lib/coq
40 @echo "TESTS ARE DISABLED FOR NOW!"
41 endif
42
43 override_dh_auto_install:
44 # raw installation
45 dune install rocq-runtime coq-core rocq-core coqide-server rocqide \
46 --destdir=$(CURDIR)/debian/tmp --prefix=/usr --libdir=$(OCAML_STDLIB_DIR) --mandir=/usr/share/man
47 # cleaning what upstream installs and we don't (need to) ship
48 find $(CURDIR)/debian/tmp -name LICENSE -delete
49 find $(CURDIR)/debian/tmp -name README.md -delete
50 find $(CURDIR)/debian/tmp -name "*.byte*" -delete
51 find $(CURDIR)/debian/tmp -name "*.opt*" -delete
52 rm -rf $(CURDIR)/debian/tmp/usr/doc/rocqide/odoc-pages \
53 $(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)/rocq-runtime/revision \
54 $(CURDIR)/debian/tmp$(OCAML_STDLIB_DIR)/coqide-server
55 find $(CURDIR)/debian/tmp -empty -delete
56 # ok, now we detect what to ship
57 find debian/tmp$(OCAML_STDLIB_DIR)/rocq-runtime -regextype posix-awk \
58 -regex '.*\.(cma|cmxs)$$' \
59 >> debian/libcoq-core-ocaml.install
60 find debian/tmp$(OCAML_STDLIB_DIR)/rocq-runtime -regextype posix-awk \
61 -regex '.*\.(a|cmi|cmo|cmt|cmti|cmx|cmxa|ml|mli|o])$$' \
62 >> debian/libcoq-core-ocaml-dev.install
63 # remove dllcoqperf_stubs.so for non-native architectures
64 ifeq (,$(filter amd64 arm64 armhf i386 ppc64el riscv64 s390x, $(DEB_HOST_ARCH)))
65 sed -i '/.*dllcoqperf_stubs.so/d' debian/libcoq-core-ocaml.install
66 endif
67
68 override_dh_gencontrol:
69 for u in $(PACKAGES); do \
70 echo 'F:OCamlABI=$(OCAML_ABI)' >> debian/$$u.substvars; \
71 echo 'F:CoqABI=$(COQ_ABI)' >> debian/$$u.substvars; \
72 done
73 dh_gencontrol
74
75 # why is this necessary?
76 override_dh_fixperms:
77 dh_fixperms
78 find $(CURDIR)/debian -name TimeFileMaker.py -exec chmod -x '{}' \;
79
80 override_dh_auto_clean:
81 make clean
82 rm -f config/Makefile config/coq_byte_config.ml config/coq_config.ml config/coq_config.py config/dune.c_flags
83 rm -f theories/dune user-contrib/Ltac2/dune